I'm trying to update many titles for books in one go. It should be A-OK, however, I get an error. This is what I do:

* admin/content/book
* "edit order and titles" on the book I want to update.
* change the titles of select book pages, a handful or a few dozen at a time
* click "Save book pages".

And this is the error I get, with different node numbers for each new crash:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'node-21015-0-0-und' for key 'PRIMARY': INSERT INTO {field_revision_field_tags} (entity_type, entity_id, revision_id, bundle, delta, language, field_tags_tid) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array ( [:db_insert_placeholder_0] => node [:db_insert_placeholder_1] => 21015 [:db_insert_placeholder_2] => 34405 [:db_insert_placeholder_3] => image [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => 18863 ) in field_sql_storage_field_storage_write() (line 495 of /__/modules/field/modules/field_sql_storage/field_sql_storage.module).

In addition, the book page that the update chokes on now gives a 404 error, although it was rendered OK before this title update.

If I call admin/content/book/(book#) (backspace in the browser) again, and try to repeat the same update, I get this error:

Warning: Creating default object from empty value in book_admin_edit_submit() (line 139 of /__/modules/book/book.admin.inc).
EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7819 of /__/includes/common.inc).

Refreshing the admin/content/book/(book#) page in the browser still shows the title and link to the page that's now gone. However, it's gone - can't be viewed, edited or even deleted from that page.

Updating pages by calling one page at a time and changing their titles just works -- but of course, the now 404 page can't be found, and thus can't be updated.

I've taken to removing every trace of the offending page by hand, from the tables book, node (etc., with revisions and fields), file_managed (etc.) and menu_links.

Any hints on how I could proceed without ditching pages from my site? Thanks!

Comments

Hetta’s picture

Right, so the update inserts a revision in node.vid, which means that the node disappears, for all practical purposes.
I do not use revisions on my site.
This is a bug that corrupts content.

dcam’s picture

The fact that it's failing when trying to insert a duplicate record into {field_revision_field_tags} may be a clue as to what is happening. Is it always this same table?

For the record, I tried to reproduce the issue the other night and couldn't.

Version: 7.36 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.