Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Getting a PDOException error. The same as reported in #4 here Undefined index: en-US in corresponding_node_references_update() but this site is not multilingual.
It occurs:
- at admin/config/system/corresponding_node_references
- check the box for field instances
- click Save
- Error:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'PRIMARY': INSERT INTO {corresponding_node_references} (node_types_content_fields, enabled) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => 1 ) in drupal_write_record() (line 6859 of /Applications/MAMP/htdocs/d7/includes/common.inc).
Comment | File | Size | Author |
---|---|---|---|
#1 | Capture.PNG | 13.41 KB | adam_b |
Comments
Comment #1
adam_b CreditAttribution: adam_b commentedSame for me :(
Comment #2
czigor CreditAttribution: czigor commentedDo you have ctools enabled?
Comment #3
keva CreditAttribution: keva commentedyes - ctools 7.x-1.0-rc1
but none of its sub-modules
Comment #4
czigor CreditAttribution: czigor commentedCan you please try disabling-enabling the module?
Comment #5
czigor CreditAttribution: czigor commentedI think I have found the bug. Try 7.x-4.22.
Comment #6
keva CreditAttribution: keva commented7.x-4.22 works, and the error is gone.
However, adding a node with a reference results in this Notice:
Notice: Undefined offset: 2 in corresponding_node_references_processing_node() (line 134 of /Applications/MAMP/htdocs/d7/sites/all/modules/cnr/corresponding_node_references.module).
But it does work - the automatic references are built.
Comment #7
czigor CreditAttribution: czigor commentedGo to the corresponding_node_references table in your database and remove all the lines that have an empty 'node_types_content_fields' field. That should solve the notice problem.
Comment #8
adam_b CreditAttribution: adam_b commentedSame response as #6 - error was fixed, but notice appeared. Applying the fix in #7 corrected this.
All looking great now - many thanks.
Comment #9
keva CreditAttribution: keva commentedworks great now. Thanks very much!