Problem/Motivation

I enabled the `xmlsitemap_custom` module. When adding more custom links, the same link would keep being overridden causing only 1 link to be added.

Proposed resolution

I will attach a patch shortly... but I discovered the reason the same link was being overridden was because there was a `$query->addExpression('MAX(id)');` It would always give me 999 as the max. Looking at the table in the db, I noticed it was set to varchar. Proposing to change to int and add an update hook to fix this issue.

Remaining tasks

Tests....

Data model changes

`id` field will be changed from `varchar` to `int`.

Comments

evanjenkins created an issue. See original summary.

evanjenkins’s picture

keats76’s picture

Ugh, I just ran into this as well. An integer key stored as a varchar? Scary. Anyway, please add this patch to the dev release. It's pretty bad when the code is calling "MAX(id)" on a varchar field and returns a "max" that is based on a string and is incorrect. It will overwrite existing data and corrupt the database table. :(

daften’s picture

I've added an updated patch with an additional use statement, since the one from #2 failed for me.

evanjenkins’s picture

daften’s picture

My bad, my patch was applied against alpha2, sorry :s