Issue with XML sitemap generator after upgrade from 4.1.3 to 4.1.15
-
Everything is in the title ??
I guess the root cause is visible when using the debug feature, error in logs:
[15-Dec-2023 10:38:55 UTC] PHP Fatal error: Uncaught TypeError: Unsupported operand types: int * string in /home/x/uat.closdebreuilly.com/wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorstandardbuilder.php:702
Stack trace: 0 /home/x/uat.closdebreuilly.com/wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorstandardbuilder.php(53): GoogleSitemapGeneratorStandardBuilder->build_product_categories() 1 /home/x/uat.closdebreuilly.com/wp-includes/class-wp-hook.php(324): GoogleSitemapGeneratorStandardBuilder->content() 2 /home/x/uat.closdebreuilly.com/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 3….
/home/x/uat.closdebreuilly.com/wp-admin/options-general.php(10): require_once(‘/home/x/…’) 13 {main}
thrown in /home/x/uat.closdebreuilly.com/wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorstandardbuilder.php on line 702
I initially thought this was related to the link per page settings: config was not modified for a long time. I attempted to deactivate/reactivate, save config: not much effect.
Code seems a bit paranoid about the fact that links_page is an integer, maybe with good reason ?? yet it is surprisingly the lhs that is not an integer:
$offset = ( --$offset ) * $links_per_page;
error_log( ‘offset ‘ . $offset ) reveals the value of $offset to be… ‘-sitemap’ which is likely not an offset!
PS: there was at the same time an upgrade of WooCommerce (to 8.4.0). Product categories are messed up (I have two “unclassified” categories, one translated to french, the site native locale, and one in english) but this was the case before the upgrade. Removing the “product categories” from sitemap generation had sitemap generation working again…
- The topic ‘Issue with XML sitemap generator after upgrade from 4.1.3 to 4.1.15’ is closed to new replies.