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.
XML sitemap custom adds only one link, deleting the previous one.
I need to add several links to the site map, while the module allows you to add only one link, replacing the previous one.
Comment | File | Size | Author |
---|---|---|---|
#3 | xmlsitemap-d8_custom_link-2715397.patch | 959 bytes | G42 |
Comments
Comment #2
pick_d CreditAttribution: pick_d commentedExactly the same issue here.
Event Log is clear.
Drupal 8.3.2
Comment #3
G42 CreditAttribution: G42 commentedThe issue stems from the way the module gets the highest ID from the database table. The SQL query uses a MAX expression on the xmlsitemap ID column, but that value is stored as a varchar(32) so the MAX function grabs 999 as the highest ID number instead of 1028 (or whatever is the highest ID).
I've created a patch that does not modify the database schema, however changing the ID column from varchar to int would allow the MAX expression in the sql query to function properly and might be faster than the array sorting my patch adds.
Comment #4
G42 CreditAttribution: G42 commentedDoh this is a duplicate issue: https://www.drupal.org/node/2836208
Comment #5
sjerdoDuplicate of #2836208: ID is set as VARCHAR, performing a 'MAX(id)' gets wrong data
Comment #6
sjerdo