Warn user that setting changes do not take effect until cron run (regenerated)
manfer - August 20, 2009 - 19:06
| Project: | XML sitemap |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | fixed |
Description
You can enable or disable this option. But as you submit the configuration form the change does not take effect until you run a cron job. I think it is something related with caching but don't know exactly where it comes from.
If it is something related to the caching of all the sitemap. Wouldn't it be possible to cache sitemap without headers to make this "Include a stylesheet in the sitemaps" work instantly?.
It was odd when I changed this option and the sitemap was not affected at all until I finally found the cron job was needed.

#1
Yeah, that's the minimum sitemap lifetime at work. And because of the new architecture of the module, they aren't regenerated until cron. I can see how this is kind of confusing so I see three solutions to help clear this up:
1. Maybe submitting the settings on admin/settings/xmlsitemap should clear the cache files. But when the user visits sitemap.xml, they will get a 404 page not found since the cache files no longer exist.
2. Add a checkbox at the bottom of the form that says "Regenerate the sitemap cache files if options are changed." This could potentially get expensive to run in the browser.
3. Add a warning message after the form is submitted that says "If any settings are changed you need to run cron manually to regenerate the sitemap files."
I think #3 sounds the best. It won't hang the browser after settings submit, but still lets the user know what's happening and why changes aren't taking effect immediately. What do you think?
#2
Well, if I have to choose one of those 3 options I choose the third too.
You didnt say nothing about caching the sitemap without the header (where the xsl line is inserted if "include stylesheet..." option is enabled) so it must not be exactly the problem.
#3
I think it should be a status report warning as well until the data has been regenerated. "Sitemap settings have been modified and xmlsitemap data has not been fully regenerated. Please execute cron.php manually to complete the regeneration of data." sounds good to me for the status report. Hmm the link-to-cron doesn't exist; I assume you mean to edit it. Was it drupal.org/cron you're looking for or one you mean to create?
#4
We do have an existing status report warning if the regenerate_needed flag is TRUE, but it only shows up if cron hasn't run in a while. I guess I could change that to show up if the flag is set no matter what, and also then show that message on the admin page.
As for the cron link, I just put link-to-cron as a dummy link here since it would actually be the link to run cron on the site, but I can't link to that on drupal.org.
#5
This turned into a bit of a stumper for me as well. The message "One or more problems were detected with your XML sitemap configuration. Please check the status report for more information." appeared on the settings page, and the status report only told me I needed to rebuild. As I was on my dev instance I didn't have any cron set up so if I hadn't found this issue I might have given up.
#6
Added a warning message whenever major settings are changed. Also included a screenshot of the warning.