Working through the tutorial. Added a child category to a container and got the following message in red:

user warning: Duplicate entry '8-7' for key 1 query: INSERT INTO category_hierarchy (cid, parent) VALUES (8, 7) in /web/drupal-4.7.4/includes/database.mysql.inc on line 121.

Followed by the following message in green:

* The menu item Technical has been updated.
* cac_lite module has been installed, but has not been configured.
* Your category was created.

CommentFileSizeAuthor
#2 category-parents-oddity-fix.patch863 bytesbdragon

Comments

hectorplus’s picture

Same here. It happens for me when i go back and update a node, i get the Duplicate warning, it still updates the node, though!
I am not really good at PHP, but i think is just a matter of saying, If the container/category is there, update it, if not, update the rest.

bdragon’s picture

Assigned: Unassigned » bdragon
Status: Active » Needs review
StatusFileSize
new863 bytes

*sigh*

Deja-vu. The original problem that led to my category_get_parents bugfixes...

Please try this patch. I believe it should take care of your issues.

Jaza’s picture

Status: Needs review » Fixed

Patch committed to HEAD and 4.7. Thanks.

Let's hope that this is the end of the 'duplicate entry' errors! However, I doubt that this alone will fix them all - probably more fixes are still needed.

Anonymous’s picture

Status: Fixed » Closed (fixed)