• Resolved ecommonist

    (@ecommonist)


    I have 2 or 3 snippets, neither of them related to xml. I tried to disable them all, no positive result. Only got normal behaviour deactivating code snippets plugin.

    I got this on logs:

    PHP Fatal error: Uncaught TypeError: Code_Snippets\Frontend::enqueue_highlighting(): Argument #1 ($posts) must be of type array, null given

    php 8.1 wordpress 6.2.2 when i try to visit my xml pages generated by https://www.ads-software.com/support/plugin/xml-sitemap-feed/

    cS: 3.4.0 this happening from last 7-10 days

    • This topic was modified 1 year, 4 months ago by ecommonist.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Thanks for reporting this. I’ll look into the bug and work out a fix.

    Plugin Author Shea Bunge

    (@bungeshea)

    I can’t see any instance in WordPress core where the_posts hook is called with anything but an array. It seems likely that a different plugin or similar you have installed is calling this hook with invalid data.

    It should still be possible to patch this within Code Snippets to make our usage of that hook a little more lenient.

    Thread Starter ecommonist

    (@ecommonist)

    plugin is that I linked in the specs in the first post, when it tries to generate sitemap.xml, codesnippets gives that fatal error.

    Thread Starter ecommonist

    (@ecommonist)

    Not sure if I should look for other alternatives like yoast to generate that xml if as you say, that plugin makes something out of the WP core… what do you think?

    Plugin Author Shea Bunge

    (@bungeshea)

    I think you should be fine to continue using your current plugin. We’ll release a fix for this in Code Snippets to make compatibility a little better.

    Plugin Author Shea Bunge

    (@bungeshea)

    Hi @ecommonist, just wanted to let you know that I’ve tested this with the XML Sitemaps plugin and the error should be fixed in version 3.4.2. Apologies for the delay in getting this resolved.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘code snippets fatal error breaking xml sitemaps’ is closed to new replies.