Fork of bentideswell/magento1-wordpress-integration with PHP 8.2 compatibility fixes.
The original sitemap observer has two issues:
-
Session conflict (PHP 8.2): The observer calls
addIsViewableFilter()which triggersMage::getSingleton('customer/session')during admin store emulation. On PHP 8.2 with Redis sessions (Cm_RedisSession), this causes a session conflict and the observer silently fails, generating the sitemap without blog URLs. -
Save & Generate timing: The observer hooks into
sitemap_sitemap_save_before. When using "Save & Generate" in the admin, the save event fires before generation (modifying the old file), thengenerateXml()overwrites it. A singleton guard prevents the observer from running again after generation.
Fix: Added a second observer on sitemap_urlset_generating_before (OpenMage 20.x+) that writes blog URLs directly to the file stream during generation. The original save_before observer is kept as a fallback for older Magento 1.x and uses a flag to skip when the stream observer has already run. Both observers use addStatusFilter() instead of addIsViewableFilter() to avoid the session dependency.
Files changed:
app/code/community/Fishpig/Wordpress/Model/Observer.phpapp/code/community/Fishpig/Wordpress/etc/config.xml
composer config repositories.fishpig-wp vcs https://github.com/createhosting/magento1-wordpress-integration
composer require fishpig/magento1-wordpress-integrationSee the original repository for licence details.
Original author: Ben Tideswell / FishPig
Fork maintainer: Create Hosting Ltd