backdrop-contrib / xmlsitemap

Provides a sitemap that conforms to the sitemaps.org specification.
GNU General Public License v2.0
1 stars 11 forks source link

"Cached files have not been generated yet" error #81

Closed ghost closed 2 years ago

ghost commented 5 years ago

As soon as I create a new node, I get the little red error notification in the admin bar, which is because XML Sitemap has displayed an error on the Status Reports page:

Cached files have not been generated yet. The XML cached files are out of date and need to be regenerated. You can run cron manually to regenerate the sitemap files.

I think this should be changed to a warning instead of an error, especially as displaying this message constantly until cron runs is quite annoying.

laryn commented 2 years ago

Looks like this is not a red indicator error (at least at a glance here):

https://github.com/backdrop-contrib/xmlsitemap/blob/15f805eb1e440c2d5946cc24f3e7edf7e5802eb5/xmlsitemap.install#L122-L123

Please reopen if I'm mistaken.

ghost commented 2 years ago

@laryn See the rest of the code: https://github.com/backdrop-contrib/xmlsitemap/blob/1.x-1.x/xmlsitemap.install#L125-L143

It changes the severity based on other factors, and when the severity is > 0 (i.e. warning or error) then it changes the description to what my original post stated: https://github.com/backdrop-contrib/xmlsitemap/blob/1.x-1.x/xmlsitemap.install#L141

laryn commented 2 years ago

@BWPanda I'm not seeing this on my site. Which of the two conditions that sets the severity level to an error is triggering this on your environment?

  1. $max_filesize == 0
  2. $generated_ago >= $system_config->get('cron_threshold_error')
quicksketch commented 2 years ago

I took a look at this problem and I couldn't reproduce it being caused by new content being created. After installing XML Sitemap for the first time, you do get a error that the sitemap needs to be generated for the first time. I don't think that's inappropriate though, since otherwise I might wonder why the /sitemap.xml file doesn't exist.

Once the first sitemap is generated, creating further content doesn't seem to retrigger a status report error. It's possible this may have been fixed when @herbdool switched a lot of config values to state in #83.

laryn commented 2 years ago

Closing for now since we can't reproduce. @BWPanda please reopen with more details and steps to reproduce if you are still seeing this!