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.
I have no idea whether this is a problem in Node Convert or XML Sitemap. But when I try to convert a node, it works, but after conversion is done, XML Sitemap tries to do something that causes a PDO Exception.
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0-' for key 'PRIMARY': INSERT INTO {xmlsitemap} (subtype, language, access, status, status_override, la...
(and causing multiple undefined indexes after this)
Any idea how/why this error is triggered?
Comment | File | Size | Author |
---|---|---|---|
#3 | xmlsitemap-incompatible-2394047-3.patch | 630 bytes | niko- |
Comments
Comment #1
shadysamir CreditAttribution: shadysamir commentedSame for me. I had to disable xmlsitemap to do node conversion
Comment #2
vincer CreditAttribution: vincer commentedSimilar issue here, maybe.
My initial error when trying to convert a single node was:
However, the errors when I tried a batch conversion from the content admin page was:
The node does convert, but only one at a time. If I select multiple items and run a batch I get the same error but nothing converts.
Comment #3
niko- CreditAttribution: niko- commentedThis patch solve node convert part of this bug.
Reason of this bug following:
Node convert try to load xmlsitemap data for changing node type in xmlsitemap table using xmlsitemap_link_load and does not check if link really present in table. After this it try to save updated corrupted link data (becouse xmlsitemap_link_load return FALSE if link not present) back.
But this patch not fully solve problem becouse xmlsitemap_link_save rice following message for existing links.
Caught exception: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'node-27318-0-0-und' for key 'PRIMARY'
although updates the data in xmlsitemap table
Comment #4
apmsooner CreditAttribution: apmsooner commentedThe patch prevents the empty table record from trying to insert which is what generates the errors. The node record still gets created in the xmlsitemap table regardless of node bundle settings but I feel thats an issue with the xml sitemap module as in my testing, any node created programatically gets a record inserted into that table regardless of node bundle settings.
Ultimately the patch fixes a problem i had where the bundle column for a field table attached to the node being converted was not getting updated to the new bundle and i have some custom validation logic that does table lookups on that field that depends on the correct bundle. Anyone who has seen this error, you might want to have a look at your field tables for converted nodes and check if their bundle is correct. I had to manually update several records for my case.