Tried submitting the same path twice and the validation did not catch the error. The UI shows both values and they are in the DB. This allows getting duplicates for a given path, which is totally undesirable.

Duplicates shown in the list of links, having different priorities and change frequencies.

Files: 
CommentFileSizeAuthor
#9 xmlsitemap-custom-disallow-duplicates-1999958--09.patch2.61 KBjedihe
PASSED: [[SimpleTest]]: [MySQL] 539 pass(es). View
#7 xmlsitemap-custom-disallow-duplicates-1999958--07.patch2.56 KBjedihe
PASSED: [[SimpleTest]]: [MySQL] 539 pass(es). View
xmlsitemap-custom-duplicates.png16.53 KBjedihe

Comments

jedihe’s picture

Status: Active » Needs review
FileSize
1.07 KB
FAILED: [[SimpleTest]]: [MySQL] 515 pass(es), 8 fail(s), and 1 exception(s). View

Status: Needs review » Needs work

The last submitted patch, xmlsitemap-custom-disallow-duplicates-1999958--01.patch, failed testing.

earnie’s picture

Version: 7.x-2.0-rc2 » 7.x-2.x-dev
Status: Needs work » Needs review

Testbot needs -dev version?

earnie’s picture

Status: Needs review » Needs work

The last submitted patch, xmlsitemap-custom-disallow-duplicates-1999958--01.patch, failed testing.

earnie’s picture

Looking at the failures I think you'll need to update the tests with this patch as well.

jedihe’s picture

Status: Needs work » Needs review
FileSize
2.56 KB
PASSED: [[SimpleTest]]: [MySQL] 539 pass(es). View

Reworked patch.

jedihe’s picture

The patch also includes a new test case to ensure no duplicates can be added.

jedihe’s picture

FileSize
2.61 KB
PASSED: [[SimpleTest]]: [MySQL] 539 pass(es). View

Previous patch didn't cover the case for another link having the same id (using a different type than custom). Update attached.

giupenni’s picture

Issue summary: View changes

I have the same problems with 7.x-2.0.
Please fix it because is very huge for google!

jedihe’s picture

@giupenni: can you please test the patch and report back if it solves this issue for you? (remember to not test directly in your live site).

spidersilk’s picture

This problem is not restricted to XML sitemap custom - XML sitemap node and XML sitemap menu are quite capable of duplicating each other's links as well!

Maybe this patch could be adapted to prevent duplicate links from being added to the index no matter which submodule is adding them? It's not much use just having XML sitemap custom checking if a link is a duplicate before adding it, if the menu and node submodules are still duplicating each other's entries! And if it can be, then this support issue could be merged with #2257191: Remove duplicate links when using both menu and node sitemap, which is about duplicates caused by those two.