• Resolved kreekhoorn

    (@kreekhoorn)


    Hi,

    Thank you very much for this great plugin! I recently updated a website to PHP 8, however then a Fatal Error occurs from this plugin. Could you check this out? I will try to post the error, and maybe a possible solution later today/tommorrow.

    Kind regards,
    Kenneth

    • This topic was modified 3 years, 8 months ago by kreekhoorn.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mark Tomlinson

    (@marktomlinson)

    I’m looking into this right now. My upgrade to PHP 8.0.3 failed, so I’ll need to fix that first.

    Meanwhile, do you know the nature of the fatal error, and which module it failed in?

    Thread Starter kreekhoorn

    (@kreekhoorn)

    Thanks for you quick reply! I think I’ve found the issue and a solution.

    In /src/utility/general.php on line 176 the check is not correct anymore. This results in an empty string passed to the abs() function later on, which results in a fatal error.

    To fix line 176 should be replaced with:
    if ( ! empty( $markup ) )

    The error that was raised was
    [Thu Apr 01 20:02:56.074345 2021] [proxy_fcgi:error] [pid 11484:tid 139834597304064] [client 127.0.0.1:56662] AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught TypeError: abs(): Argument #1 ($num) must be of type int|float, string given in {domainroot}/wp-content/plugins/markup-by-attribute-for-woocommerce/src/utility/general.php:165

    If you need any more info, let me know.
    Kenneth

    Plugin Author Mark Tomlinson

    (@marktomlinson)

    I found the same thing! Essentially, !empty and <>0 are no longer the same in PHP 8.

    There are similar IF’s throughout the code, resulting in some other anomalies–such as updating the variation descriptions when there is no markup. Even when it does not present an obvious problem, I still want to correct the code.

    So, I’ve done that. I need to run through regression testing and update the version numbers before I can publish the new version. Be expecting it later today.

    Thread Starter kreekhoorn

    (@kreekhoorn)

    Great! Good to hear. Thanks for your awesome (quick) work on this plugin and thanks for your quick reply!

    If I can help you with anything, let me know.

    Plugin Author Mark Tomlinson

    (@marktomlinson)

    The updated version is now available, and should appear as such on your WordPress plugins page. It resolves the issue throughout the code. Thank you for brining it to my attention.

    During regression testing I noticed a little unrelated glitch when markup rounding is used and the markup rounds to zero. Not a big deal and I don’t think anyone will notice except me. But, I will be correcting that as well, so don’t be surprised if I release another version in the next couple of days.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP 8 Support’ is closed to new replies.