• Resolved kazimieras

    (@kazimieras)


    Hallo, after updated to the new version of wpml plugins I have fatal error in cart and checkout pages like this:

    Fatal error: Uncaught InvalidArgumentException: Number comparator expects numeric values to be compared, value ” of type ‘string’ given. in /home/leselt/domains/dresslemuse.com/public_html/staging/wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/comparator/src/NumberComparator.php:52 Stack trace: #0 /home/leselt/domains/dresslemuse.com/public_html/staging/wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/comparator/src/NumberComparator.php(43): WbsVendors\Dgm\Comparator\NumberComparator->normalize() #1 /home/leselt/domains/dresslemuse.com/public_html/staging/wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/comparator/src/AbstractComparator.php(26): WbsVendors\Dgm\Comparator\NumberComparator->cmp() #2 /home/leselt/domains/dresslemuse.com/public_html/staging/wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/comparator/src/AbstractComparator.php(16): WbsVendors\Dgm\Comparator\AbstractComparator-> in /home/leselt/domains/dresslemuse.com/public_html/staging/wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/comparator/src/NumberComparator.php on line 52`

    Maybe You could possibly help to locate the problem ?
    WooCommerce Weight Based Shipping – version 5.3.9
    WPML modules – newest versions
    Woocommerce Version 5.0.0

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Dan

    (@dangoodman)

    Hello,

    The stack trace in the error message is incomplete. Could you check if you can copy the entire message here?

    Also, could you make sure the error disappears if you disable WPML?

    Thread Starter kazimieras

    (@kazimieras)

    Hallo,
    Thank You very much for the reply!
    I checked on more time: after disabling all the WPML plugins (leaving one default EN language) the errors disapears from the frontend.

    I checked again for errors then the WPML plugins are enabled.
    1. pressing the button “add to cart” from a product page:
    Number comparator expects numeric values to be compared, value ” of type ‘string’ given.

    2.pressing “view cart” button:

    Cart
    
    Fatal error: Uncaught InvalidArgumentException: Number comparator expects numeric values to be compared, value '' of type 'string' given. in /home/leselt/domains/dresslemuse.com/public_html/staging/wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/comparator/src/NumberComparator.php:52 Stack trace: #0 /home/leselt/domains/dresslemuse.com/public_html/staging/wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/comparator/src/NumberComparator.php(43): WbsVendors\Dgm\Comparator\NumberComparator->normalize() #1 /home/leselt/domains/dresslemuse.com/public_html/staging/wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/comparator/src/AbstractComparator.php(26): WbsVendors\Dgm\Comparator\NumberComparator->cmp() #2 /home/leselt/domains/dresslemuse.com/public_html/staging/wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/comparator/src/AbstractComparator.php(16): WbsVendors\Dgm\Comparator\AbstractComparator-> in /home/leselt/domains/dresslemuse.com/public_html/staging/wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/comparator/src/NumberComparator.php on line 52
    
    There has been a critical error on this website.
    
    Learn more about debugging in WordPress.

    3. Pressing “check out” button:

    Checkout
    
    Fatal error: Uncaught InvalidArgumentException: Number comparator expects numeric values to be compared, value '' of type 'string' given. in /home/leselt/domains/dresslemuse.com/public_html/staging/wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/comparator/src/NumberComparator.php:52 Stack trace: #0 /home/leselt/domains/dresslemuse.com/public_html/staging/wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/comparator/src/NumberComparator.php(43): WbsVendors\Dgm\Comparator\NumberComparator->normalize() #1 /home/leselt/domains/dresslemuse.com/public_html/staging/wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/comparator/src/AbstractComparator.php(26): WbsVendors\Dgm\Comparator\NumberComparator->cmp() #2 /home/leselt/domains/dresslemuse.com/public_html/staging/wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/comparator/src/AbstractComparator.php(16): WbsVendors\Dgm\Comparator\AbstractComparator-> in /home/leselt/domains/dresslemuse.com/public_html/staging/wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/comparator/src/NumberComparator.php on line 52
    
    There has been a critical error on this website.
    
    Learn more about debugging in WordPress.

    4. Then removing product pressing x button in the cart widget:

    Fatal error: Uncaught InvalidArgumentException: Number comparator expects numeric values to be compared, value '' of type 'string' given. in /home/leselt/domains/dresslemuse.com/public_html/staging/wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/comparator/src/NumberComparator.php:52 Stack trace: #0 /home/leselt/domains/dresslemuse.com/public_html/staging/wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/comparator/src/NumberComparator.php(43): WbsVendors\Dgm\Comparator\NumberComparator->normalize() #1 /home/leselt/domains/dresslemuse.com/public_html/staging/wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/comparator/src/AbstractComparator.php(26): WbsVendors\Dgm\Comparator\NumberComparator->cmp() #2 /home/leselt/domains/dresslemuse.com/public_html/staging/wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/comparator/src/AbstractComparator.php(16): WbsVendors\Dgm\Comparator\AbstractComparator-> in /home/leselt/domains/dresslemuse.com/public_html/staging/wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/comparator/src/NumberComparator.php on line 52
    
    There has been a critical error on this website.
    
    Learn more about debugging in WordPress.
    Thread Starter kazimieras

    (@kazimieras)

    Also I should mension that the same errors apears in both languages (en or lt).

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    @dangoodman I’ve deleted your offer to login to your user’s site. While I know you have the best of intentions, it’s forum policy that you not ask users for admin or server access. Users on the forums aren’t your customers, they’re your open source collaborators, and requesting that kind of access can put you and them at high risk.

    If they are paying customers (such as people who bought a premium service/product from you) then by all means, direct them to your official customer support system. But in all other cases, you need to help them here on the forums.

    Thankfully are other ways to get information you need:

    You get the idea.

    We know volunteer support is not easy, and this guideline can feel needlessly restrictive. It’s actually there to protect you as much as end users. Should their site be hacked or have any issues after you accessed it, you could be held legally liable for damages. In addition, it’s difficult for end users to know the difference between helpful developers and people with malicious intentions. Because of that, we rely on plugin developers and long-standing volunteers (like you) to help us and uphold this particular guideline.

    When you help users here and in public, you also help the next person with the same problem. They’ll be able to read the debugging and solution and educate themselves.

    Plugin Author Dan

    (@dangoodman)

    Hi @kazimieras,

    After checking the staging, it appears the culprit is the WPML String Translation module. It’s interfering with the WBS settings rendering them broken.?

    There is a simple way to reproduce it:
    1. Open a WBS rule’s settings.
    2. Notice the Weight Rate fields contain ‘(invalid)’ text.
    3. Change it to, e.g., ‘charge $0 per each 1kg over 0kg’ (the default state).
    4. Save and refresh the page.
    5. Open the rule again.
    6. Weight Rate is ‘(invalid)’ again.

    The same steps work fine with WPML String Translation disabled.

    Unfortunately, after spending some time, I can’t find what in WPML causes that and how to work it around.

    For now, I think the best option for you is to rollback String Translation to the previous version and contact WPML support about the issue. I believe they have more chances to find the source of the issue since they know better how WPML works.

    Plugin Author Dan

    (@dangoodman)

    @sterndata, Appreciate your hard work on keeping this place sane and clean. However, it seems you missed the part that I didn’t ask to login to the user’s site. What I asked instead was a temp copy.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    @dangoodman Whether it’s staging, temporary, or a production site, you may not ask for admin credentials in these forums.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Fatal error: Uncaught InvalidArgumentException’ is closed to new replies.