meldsolutions/Meld-Google-Sitemaps

Issue with custom getURLStem() methods

Closed this issue · 2 comments

I have a Mura install with several sites under it.

All the sites apart from the default site have a custom getURLStem() method in {siteid}/includes/contentRenderer.cfc.

This works fine when generating sitemaps manually with the respective site selected in the admin.

However, when the generate call is not made from the admin - e.g. when it's scheduled - the contentRenderer returned by getContentRenderer is the one for the default site, which doesn't have the custom method, and so the generated URLs are incorrect.

Is it possible to ensure that when calling the generation URL, the contentRenderer returned is the one for the siteid passed in the parameters?

If you add a dump of the renderer object to the result page, you can see that if the call is made by clicking the "Generate Sitemap" button, the contentRenderer is the correct one for the site. But if it's just called directly, it uses the contentRenderer from the default site.

Note: By "default", I mean the first site that Mura finds with the current domain name.
For example, if you have 3 sites:

www.mydomain.com/en/
www.mydomain.com/fr/
www.mydomain.com/nl/

....then, if you access the sitemap generation page directly, it will always be the /en/ contentRenderer that is used.

Pushed a changed that should correct this behaviour.

Thanks Grant - I can confirm that the code change fixes the issue...