• Resolved cseevinck

    (@cseevinck)


    When trying the plugin with php 8.2 I get the below error. When I run it with php 7.4 it works fine. I have reverted to php 7.4 on the indicated website.

    Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, bool given in /code/wp-content/plugins/insert-headers-and-footers/includes/auto-insert/class-wpcode-auto-insert-type.php:270

    Can you please tell me when the plugin will support php 8.2?

    • This topic was modified 7 months, 2 weeks ago by cseevinck.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @cseevinck,

    Thank you for reporting this issue, at the moment we support PHP 8.1 as PHP 8.2 not yet fully supported by WordPress either.

    Regardless, I’ll make sure we get this addressed in the next release.

    Looking at the code there I can’t see an instance where that variable is not an array – are you using the latest version of the plugin? Activating/deactivating a snippet should rebuild that option and you should no longer get the error.

    Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @cseevinck,

    I wanted to let you know we added an extra check there to prevent the error from happening even if the option is for some reason not an array coming from the database. Please update the plugin to the latest version (2.1.4).

    Thread Starter cseevinck

    (@cseevinck)

    Thanks very much. I will update the plugin and check it out.

    Thread Starter cseevinck

    (@cseevinck)

    When running php 8.1 I still get this error after updating to the latest version of your plugin.
    Warning: foreach() argument must be of type array|object, bool given in /code/wp-content/plugins/insert-headers-and-footers/includes/class-wpcode-snippet-cache.php on line 37 Fatal error: Uncaught TypeError: usort(): Argument #1 ($array) must be of type array, bool given in /code/wp-content/plugins/insert-headers-and-footers/includes/class-wpcode-snippet-cache.php:41

    Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @cseevinck,

    Thank you for the update, we just issued an updated that addresses this issue.

    Thread Starter cseevinck

    (@cseevinck)

    @gripgrip Thanks very much for your fast response. It now works great.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Crash when running on php 8.2’ is closed to new replies.