Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with sitemap detail route #15

Closed
jlachancekffein opened this issue Oct 31, 2019 · 2 comments
Closed

Issue with sitemap detail route #15

jlachancekffein opened this issue Oct 31, 2019 · 2 comments

Comments

@jlachancekffein
Copy link

This rules is not working correctly :

'sitemap_<siteId:\d>_<type:(entry|product|category)>_<sectionId:\d>_<handle:.*>.xml' => 'seo-fields/sitemap/detail'

src/craftCMS/vendor/studioespresso/craft-seo-fields/src/SeoFields.php (line 216)

Working : http://.../sitemap_1_entry_4_about_single.xml
Not working : http://.../sitemap_1_entry_10_careers_channel.xml

The problem is the (:\d) regex symbol. You need to use (:\d+) because siteId and sectionid param can have more than one digit.

I fix it by overriding the rules inside our project module.

$event->rules = array_merge($event->rules, [
    'sitemap_<siteId:\d+>_<type:(entry|product|category)>_<sectionId:\d+>_<handle:.*>.xml' => 'seo-fields/sitemap/detail'
]);

But it's not ideal to have to override this plugin route.

Can you fix it please ?

@janhenckens
Copy link
Member

Yes, I'll put out a release tonight!

@janhenckens
Copy link
Member

Fixed 1.0.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants