prestaconcept / PrestaSitemapBundle

A symfony bundle that provides tools to build a rich application sitemap. The main goals are : simple, no databases, various namespace (eg. google image), respect constraints etc.
MIT License
355 stars 102 forks source link

Fix access to segmented sitemaps #265

Closed Polylogic closed 8 months ago

yann-eugone commented 3 years ago

Hello @Polylogic ! Thank you for contributing.

We still have some trouble here :

Please take some time to answer and fix these points, otherwise I will have to close this PR

Polylogic commented 3 years ago

Hi. I'm not sure about tests. This patch is pretty straightforward and only applies to the on-demand sitemap generation When you request a sitemap segment, for example http://domain.tld/sitemap.entries_2.xml , the value passed to Generator::populate($section) is "entries_2". Which means we need to cut off the segment number "_2" in order to handle SitemapPopulateEvent($this, $section) event correctly. The regular expression is the same as the one used in the Dumper::dump().

yann-eugone commented 3 years ago

@Polylogic seems that failing tests are due to incompatible version of the used tools, I opened #266 that should fix the issue. After the PR is merged, I'd appriate if you can rebase your branch.

I see the problem you had, but I would like to double check the behavior : can you add a test case in both unit & integration ?

yann-eugone commented 8 months ago

Alternative PR was done, with tests