Deleting an attribute key was throwing a sql foreign key constraint error
Permalink Browser Info Environment
On 8.2.1, i tried deleting a Page Selector Attribute that I had created and every time it threw errors due to a foreign key constraint violation. I ended up updating the deleteKey() method so that it called parent::deleteKey() at the end and that seemed to clear up the issue.
Just wanted to post here in case anyone else ran into this
public function deleteKey() { $db = Loader::db(); $arr = $this->attributeKey->getAttributeValueIDList(); foreach($arr as $id) { $db->Execute('delete from atPageSelector where avID = ?', array($id)); } // added this line parent::deleteKey(); }
Just wanted to post here in case anyone else ran into this
Type: | Discussion |
---|---|
Status: | In Progress |
This change fixes this issue:https://github.com/Mnkras/page_selector_attribute/pull/6...
I actually had made a pull request right after posting this issue -https://github.com/Mnkras/page_selector_attribute/pull/4...
Guess I should have left a comment about it.
Guess I should have left a comment about it.
Sorry, I didn't check the other pull request contents (your pull request has the "5.7" title, which is not very self-explanatory...)
(5.7 branch)
Thanks!