• Resolved AndyHenderson

    (@andyhenderson)


    From this stack trace produced when running version 4.1.7:

    [05-Mar-2023 00:32:47 UTC] PHP Fatal error: Uncaught TypeError: Unsupported operand types: int * string in /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorstandardbuilder.php:516
    Stack trace:
    #0 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorstandardbuilder.php(44): GoogleSitemapGeneratorStandardBuilder->build_taxonomies(Object(GoogleSitemapGenerator), 'event')
    #1 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-includes/class-wp-hook.php(310): GoogleSitemapGeneratorStandardBuilder->content(Object(GoogleSitemapGenerator), 'tax', 'event-venue')
    #2 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-includes/class-wp-hook.php(340): WP_Hook->apply_filters('', Array)
    #3 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #4 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-content/plugins/google-sitemap-generator/sitemap-core.php(1965): do_action('sm_build_conten...', Object(GoogleSitemapGenerator), 'tax', 'event-venue')
    #5 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorloader.php(387): GoogleSitemapGenerator->show_sitemap(Array)
    #6 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorloader.php(250): GoogleSitemapGeneratorLoader::call_show_sitemap('params=tax-even...')
    #7 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-includes/class-wp-hook.php(306): GoogleSitemapGeneratorLoader::do_template_redirect()
    #8 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-includes/class-wp-hook.php(340): WP_Hook->apply_filters(NULL, Array)
    #9 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #10 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-includes/template-loader.php(13): do_action('template_redire...')
    #11 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-blog-header.php(19): require_once('/homepages/0/d8...')
    #12 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/index.php(17): require('/homepages/0/d8...')
    #13 {main}
    thrown in /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorstandardbuilder.php on line 516

    you will see the sitemap generator crashes when processing taxonomy “event-venue”. “event-venue” and “event-category” are two taxonomies created by popular plugin Event Organiser. I’m sure there are other plugins that use a hyphen in the same way.

    Because you look for hyphens to indicate a sub-page number, the hyphen in the category name results in $offset becoming a string which causes the error on line 516.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @andyhenderson,

    Thanks for reaching out to us. In order to debug and track your issue, we need some information like the XML Sitemaps plugin version you are facing the problem with and your sitemap URL.

    Thread Starter AndyHenderson

    (@andyhenderson)

    I provided the version in my initial note: 4.1.7.

    You can see the sitemap at https://haylingu3a.org/sitemap.xml but it won’t help you. The bug means the problem taxonomies don’t appear and I have since disabled them in any case.

    If you look at the code leading up to line 516 in class-googlesitemapgeneratorstandardbuilder.php and the provided stack trace it’s pretty obvious why the plug-in crashes when it encounters a taxonomy containing a hyphen.

    Hi @andyhenderson thanks for providing details. We will track this issue in our upcoming version.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Fatal error processing taxonomies containing hyphens’ is closed to new replies.