Rather than ask to the user to manually rebuild the sitemap content, it would be good if the code would do it automatically.
Maybe it's a silly idea, but creating a file similar to cron.php could be a solution; the file would be invoked from cron, in the same way cron.php is normally invoked, and it would rebuild the sitemap cache files.
Comments
Comment #1
dave reidThe module never asks a user to manually rebuild the sitemap. It should only show a warning when cron hasn't run when it should, hence it needs a manual rebuild. xmlsitemap_node and xmlsitemap_menu() both implement hook_cron() which adds content at cron, and xmlsitemap_node adds the node links when they are created.
Comment #2
avpadernoI ask my apologies; I thought that the warning meant that the module needed to rebuild the sitemap cache files.
By manually rebuild I meant the same thing you mean by manual rebuild; I didn't mean the module is asking the user to create himself the sitemap (even if that would not be a bad idea ;-)).
The point is that the code does create cache files that are then served when the sitemap content is requested. Those cache files are created when the menu callback
xmlsitemap_output()is invoked, and it callsxmlsitemap_generate($chunk).Comment #3
dave reidIt only tries to do it if 1. the cache files don't currently exist or 2. if the users goes to sitemap.xml?refresh and has the 'administer xmlsitemap' permission. The second reason is mostly for testing and development right now. Even then, it will only generate a the specific sitemap chunk and not all the pages.
Comment #4
dave reidThe system to generate the files on cron already exists. The current code in xmlsitemap_output_chunk() is mostly for testing and development purposes and should not execute for normal users. As such, I am marking as fixed.