• Resolved rextherunt

    (@rextherunt)


    Hi there

    I have an issue that is logged as follows:

    CRITICAL Uncaught TypeError: Unsupported operand types: int - string in /wp-content/plugins/woocommerce/packages/woocommerce-admin/src/Notes/NoteTraits.php:32
    Stack trace:
    #0 /wp-content/plugins/woocommerce/packages/woocommerce-admin/src/Notes/MobileApp.php(34): Automattic\WooCommerce\Admin\Notes\MobileApp::wc_admin_active_for(172800)
    #1 /wp-content/plugins/woocommerce/packages/woocommerce-admin/src/Notes/NoteTraits.php(74): Automattic\WooCommerce\Admin\Notes\MobileApp::get_note()
    #2 /wp-content/plugins/woocommerce/packages/woocommerce-admin/src/Events.php(88): Automattic\WooCommerce\Admin\Notes\MobileApp::possibly_add_note()
    #3 /wp-includes/class-wp-hook.php(287): Automattic\WooCommerce\Admin\Events->do_wc_admin_daily()
    #4 /wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters('', Array)
    #5 /wp-includes/plugin.php(551): WP_Hook->do_action(Array)
    #6 /wp-cron.php(138): do_action_ref_array('wc_admin_daily', Array)
    #7 {main}
      thrown in /wp-content/plugins/woocommerce/packages/woocommerce-admin/src/Notes/NoteTraits.php on line 32

    I have updated WP to 5.7.2 and WooCommerce to 5.3.0

    I noted your response to another user which involved disabling WooCommerce Admin, but there is no such option in the current version.

    I found elsewhere that someone had solved their issue by rolling back their PHP version from 8 to 7.4. This worked for me too. However, I need to address the issue so that I can update PHP again in the near future.

    Can you offer any assistance?

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support con

    (@conschneider)

    Engineer

    Hi there,

    Thanks for pointing out the fatal error. This sounds like a compatibility issue with PHP8. I did a quick search and there is a stale GitHub issue that looks similar.

    https://github.com/woocommerce/woocommerce/issues/29994

    Is this behaviour something that you were consistently able to trigger?
    If yes, what were the steps exactly?

    Kind regards,

    Thread Starter rextherunt

    (@rextherunt)

    Thanks for your quick response.

    I’m not sure whether perhaps the host updated PHP to 8, because nothing was changed in our setup. The error happened when trying to edit a product. This was with an outdated WP and WooCommerce version – I can’t remember which ones. I was prompted to update those and many other plugins. After all were updated, I still got the same error. The only solution was changing PHP to 7.4.
    I’m not able to replicate the issue unless I change it back to 8, but will break the site again.

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    Hi there ??

    If I understand correctly, you are using the latest version of WordPress and WooCommerce, and the only solution is to roll back to PHP 7.4, right?

    By any chance, have you performed a full conflict check to discard that the theme or a plugin is causing this issue? You can find a more detailed explanation on how to do a conflict test here.

    Cheers!

    Thread Starter rextherunt

    (@rextherunt)

    Thanks for following up.

    Yes, I am using the latest versions and I have updated my theme. The problem appeared before I did any updates, and it persisted after everything was updated to the latest versions.

    I am loathe to change my theme, as it is advisable to do any theme changes on a staging site to avoid any loss of settings and data.

    We are so often casually told to go back to the default theme, but it is not that simple. To transfer this entire site to a staging site would take a long time, and in the end it would entail different server settings and other factors, which might render the test useless.

    Thread Starter rextherunt

    (@rextherunt)

    Just a quick thought: Can I not use Health Check to test without going through the staging server process?

    Plugin Support AW a11n

    (@slash1andy)

    Automattic Happiness Engineer

    Hey again!

    Health Check likely will work for this, yes.

    Mirko P.

    (@rainfallnixfig)

    Hi @rextherunt,

    Since we haven’t heard from you in a while, we’re hoping that means you were able to get this resolved. I’m going to close this thread out now.

    If you’re still having trouble, please open up a new topic and we’ll be happy to help out.

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘CRITICAL Uncaught TypeError: Unsupported operand types: int – string’ is closed to new replies.