If some of the contents has changed (new pictures or removed pictures) it could update automatically the sitemap. Also this could be done when running CRON, which might be better choice for high traffic sites (or sites which have huge amount of contents).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

iMiksu’s picture

Status: Active » Needs review
FileSize
699 bytes

Patch provided.

iMiksu’s picture

FileSize
1.06 KB

I found out that rebuild wasn't working because it was using drupal_goto() function which can't be used on CLI environment. This causes problems when runnin cron in drush.

I've fixed it in this patch by using drupal_is_cli() function.

tamarpe’s picture

Issue summary: View changes
Status: Needs review » Needs work

It causes infinity redirect loop when running Cron via the website and not in Drush.
When checking -drupal_is_cli(), there should be another check if the path is cron.php

tamarpe’s picture

Status: Needs work » Needs review
FileSize
1.09 KB

I changed the check from !drupal_is_cli(), to if ((strpos(current_path(), '/google_image_sitemap'))), so it works from the button in the module settings, and cron via drush/manually.

santimg’s picture

At first I couldn't apply the patch in #4, I could after adding an empty end of file line.

When applied, I got big load times in some pages, I solved it adding strict type comparison for the strpos() function. Like this:

if (strpos(current_path(), '/google_image_sitemap') !== FALSE) {

Also check the code standards for comments please! They are missing some dots at the end of the lines. I think everything is working correctly after applying these changes.

eryth’s picture

Applied patch from #4 and fix from #5. Sitemap generates but not update on RE-generate
-------------------------
Sorry, it was caching, all work perfect)

jerry’s picture

Patch from #4 plus fix from #5 working well for me.

tamarpe’s picture

A bit more elegant way, and some code standards fixes

EDIT - A small typo, the next comment is the up-to-date works patch

tamarpe’s picture

tamarpe’s picture