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.
If the UPDATE set the same values as already in the database - no rows are affected and the db_affected_rows() gives 0. In this case you get this error as a insert is executed for a key that already exists in the database:
user warning: Duplicate entry '4' for key 1 query: INSERT INTO project_release_projects (nid, releases, version_format) VALUES (4, 0, '') in sites\all\modules\project\release\includes\project_edit_releases.inc on line 266.
In cache.inc I have seen this will be catched with "@" on the INSERT.
Comment | File | Size | Author |
---|---|---|---|
#5 | 1394398_Duplicate_entry_in_project_release_projects_all.patch | 3.66 KB | hass |
#1 | 1394398 Duplicate entry in project_release_projects.patch | 1.05 KB | hass |
Comments
Comment #1
hass CreditAttribution: hass commentedPatch attached
Comment #3
hass CreditAttribution: hass commented#1: 1394398 Duplicate entry in project_release_projects.patch queued for re-testing.
Comment #5
hass CreditAttribution: hass commentedd.o Testbot seems to have issue with spaces in patch files...
As db_affected_rows() is used very often I fixed a few more that may have the same issues.
Comment #7
hass CreditAttribution: hass commentedComment #8
hass CreditAttribution: hass commented#5: 1394398_Duplicate_entry_in_project_release_projects_all.patch queued for re-testing.
Comment #9
hass CreditAttribution: hass commentedComment #9.0
hass CreditAttribution: hass commentedA
Comment #11
hass CreditAttribution: hass commented