The following is then reported in logs:

Duplicate entry 'node-234' for key 'PRIMARY' query: INSERT INTO pathauto_persist (entity_type, entity_id, pathauto) VALUES ('node', 234, 1) dans /[...]/sites/all/modules/pathauto_persist/pathauto_persist.module à la ligne 24.

FYI this happened when saving and sending a simplenews test node.

CommentFileSizeAuthor
#3 pathauto_persist.module.patch671 bytesanrikun

Comments

anrikun’s picture

Title: WSOD when saving a node » SQL error when saving a node

Actually the WSOD seemed to be related to something else.
But the SQL error is still here.

anrikun’s picture

Priority: Major » Normal
anrikun’s picture

Status: Active » Needs review
StatusFileSize
new671 bytes

This should do the trick.

dan.nsk’s picture

This patch does make sense

roderik’s picture

Status: Needs review » Reviewed & tested by the community

Yup.

As far as I can guess, db_affected_rows() returns 0 if no data (i.e. the pathauto field) was actually changed in the database row.

(Error is generated on a client site, but not on my development system.
mysqli driver selected in settings.php; the biggest difference seems to be that phpmyadmin reports Mysql Client Version "5.1.41" for my client site and "mysqlnd 5.0.7-dev" for myself.)

dave reid’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.