Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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).
Comment | File | Size | Author |
---|---|---|---|
#10 | google_image_sitemap-1920010-4.patch | 4.08 KB | tamarpe |
#4 | google_image_sitemap-1920010-3.patch | 1.09 KB | tamarpe |
#2 | 1920010-2.patch | 1.06 KB | iMiksu |
#1 | 1920010-1.patch | 699 bytes | iMiksu |
Comments
Comment #1
iMiksuPatch provided.
Comment #2
iMiksuI 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.Comment #3
tamarpe CreditAttribution: tamarpe commentedIt 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
Comment #4
tamarpe CreditAttribution: tamarpe commentedI 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.
Comment #5
santimg CreditAttribution: santimg commentedAt 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:
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.
Comment #6
eryth CreditAttribution: eryth commentedApplied patch from #4 and fix from #5. Sitemap generates but not update on RE-generate
-------------------------
Sorry, it was caching, all work perfect)
Comment #7
jerry CreditAttribution: jerry commentedPatch from #4 plus fix from #5 working well for me.
Comment #8
tamarpe CreditAttribution: tamarpe commentedA bit more elegant way, and some code standards fixes
EDIT - A small typo, the next comment is the up-to-date works patch
Comment #9
tamarpe CreditAttribution: tamarpe commentedComment #10
tamarpe CreditAttribution: tamarpe commented