• Resolved devbd

    (@devbd)


    Hi, I updated PHP on my site from 7.2 to 8.1 and this caused a fatal error on the site. After checking the logs, the error points to your plugin. The error is

    PHP Fatal error: Uncaught Error: Call to a member function setLogger() on string in /plugins/shopmagic-for-woocommerce_/src/Workflow/Extensions/ExtensionsSet.php:115\nStack trace:\n#0 /plugins/shopmagic-for-woocommerce_/src/Workflow/Extensions/ExtensionsSet.php(86): WPDesk\ShopMagic\Workflow\Extensions\ExtensionsSet->init_extension(Object(WPDesk\ShopMagic\Workflow\Extensions\Builtin\WooCommerceExtension))\n#1 /plugins/shopmagic-for-woocommerce_/src/Plugin.php(276): WPDesk\ShopMagic\Workflow\Extensions\ExtensionsSet->init_extensions()\n#2 /wp-includes/class-wp-hook.php(308): WPDesk\ShopMagic\Plugin->WPDesk\ShopMagic\{closure}(”)\n#3 /wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)\n#4 /wp-includes/…

    The issue is resolved if I revert back to older PHP. The plugin is up to date on version 4.0.2.

    Could you support me with this problem, please?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Bartek

    (@bartj)

    Hi @devbd

    This seems tricky, as we are testing ShopMagic ourselves at PHP 8.1 and everything works fine. Do you by any chance update your plugin through FTP server?

    I noticed, you have added underscore after plugin slug in directory shopmagic-for-woocommerce_. From the top of my head, I’ve got two possible diagnostics:

    1. Please, make sure there’s only one ShopMagic installed in your website. Sometimes it may happen that plugin installation results in another plugin instance (i.e. shopmagic-for-woocommerce-1) instead of clean update
    2. If you are updating your plugin through FTP, I recommend deleting the plugin completely and install it anew, as there may be stranded files from previous versions which may affect the current installation.
    3. Changing PHP version on server is one thing, but it usually doesn’t flush any cache, which may be set it various places (cache plugins, database, server settings). Cache may serve your website with stale code (yes, even PHP code can be cached, it’s frequently due to opcache settings), and this may be temporary, but effectively leaving you with a website down for a few minutes.

    If none of the above help, I’d still recommend performing a clean installation of the plugin, directly downloading the newest release from WordPress download page. Otherwise, I need you to post screenshots with content of a few files to manually verify integrity:

    • src/Workflow/Extensions/ExtensionsSet.php, line 111-117
    • src/Workflow/Extensions/Builtin/WooCommerceExtension.php, line 61-118

    Best regards,
    Bartek

    Plugin Support Tomasz WP Desk

    (@tomaszwp)

    Hello @devbd

    Please write if the tips that @bartj wrote helped.

    Plugin Support Tomasz WP Desk

    (@tomaszwp)

    I am marking this topic as resolved as we have not received any new replies. Please let us know if you need our help again.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fatal error after switching to PHP 8.1’ is closed to new replies.