• Resolved ChiefWigs1982

    (@chiefwigs1982)


    Our plugin updated to 4.1.0 today and the website broke – I saw you released 4.1.1 and I hoped that would fix the issue, but alas, it was still broken.

    I’ve managed to roll back to an older version that was still working (4.0.6, fwiw), so this isn’t as urgent, but you should still know.

    The error we’re getting on checkout is:

    [11-Nov-2020 16:04:55 UTC] PHP Fatal error:  Uncaught TypeError: Argument 1 passed to WCMP_NL_Postcode_Fields::isCountryWithSplitAddressFields() must be of the type string, null given, called in /home/123456/public_html/wp-content/plugins/woocommerce-myparcel/includes/class-wcmp-postcode-fields.php on line 673 and defined in /home/123456/public_html/wp-content/plugins/woocommerce-myparcel/includes/class-wcmp-postcode-fields.php:1142
    Stack trace:
    #0 /home/123456/public_html/wp-content/plugins/woocommerce-myparcel/includes/class-wcmp-postcode-fields.php(673): WCMP_NL_Postcode_Fields::isCountryWithSplitAddressFields(NULL)
    #1 /home/123456/public_html/wp-includes/class-wp-hook.php(287): WCMP_NL_Postcode_Fields->merge_street_number_suffix(111111, Array)
    #2 /home/123456/public_html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
    #3 /home/123456/public_html/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #4 /home/123456/public_html/wp-content/plugins/woocommerce/includes/class-wc-checkout.php(396): do_action('woocomm in /home/123456/public_html/wp-content/plugins/woocommerce-myparcel/includes/class-wcmp-postcode-fields.php on line 1142
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Richard Perdaan

    (@richardperdaan)

    Hi @chiefwigs1982,

    What the error indicates, is that there is no known shipping country. As soon as you look at the order, is there a shipping country?

    Thread Starter ChiefWigs1982

    (@chiefwigs1982)

    Hi Richard, thanks for your reply!

    We only take one address on the orders, and we have the “Force shipping to the customer billing address” setting in WooCommerce checked, so only the billing address is captured, and that’s always worked fine up to the v4.1 update. “Country” is a required field for the billing address too.

    jopb

    (@jopb)

    Same issue, appeared since the “Allow split address field for Belgium as well” feature:

    Error: Argument 1 passed to WCMP_NL_Postcode_Fields::isCountryWithSplitAddressFields() must be of the type string, null given, called in /www/wp-content/plugins/woocommerce-myparcel/includes/class-wcmp-postcode-fields.php on line 672 and defined in /www/wp-content/plugins/woocommerce-myparcel/includes/class-wcmp-postcode-fields.php:1142, referer: https://brutebonen.nl/winkel/afrekenen/
    
    Stack trace:
    #0 /www/wp-content/plugins/woocommerce-myparcel/includes/class-wcmp-postcode-fields.php(672): WCMP_NL_Postcode_Fields::isCountryWithSplitAddressFields(NULL), referer: https://brutebonen.nl/winkel/afrekenen/
    #1 /www/wp-includes/class-wp-hook.php(287): WCMP_NL_Postcode_Fields->merge_street_number_suffix(9729, Array), referer: https://brutebonen.nl/winkel/afrekenen/
    #2 /www/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array), referer: https://brutebonen.nl/winkel/afrekenen/
    #3 /www/wp-includes/plugin.php(478): WP_Hook->do_action(Array), referer: https://brutebonen.nl/winkel/afrekenen/
    #4 /www/wp-content/plugins/woocommerce/includes/class-wc-checkout.php(396): do_action('woocommerce_che...', 9729, Array), referer: https://brutebonen.nl/winkel/afrekenen/
    #5 /www/wp-content/plugins/woocommerce/includes/class-wc-checkout.php(1148): WC_Checkout->crea...erce/includes/class-wc-checkout.php(396): do_action('woocommerce_che...', 9729, Array), referer: https://brutebonen.nl/winkel/afrekenen/
    

    We don’t have “Force shipping to the customer billing address” set, but only require a shipping address. In the shipping address Country is required. Please roll back the “Allow split address field for Belgium as well” feature

    • This reply was modified 4 years ago by jopb.
    • This reply was modified 4 years ago by jopb.
    • This reply was modified 4 years ago by jopb.
    strebor

    (@strebor)

    I have the EXACT same problem. All worked fine, till the plugin upgraded from 4.0.6 to 4.1.x. Even the latest 4.1.2. still causes this PHP Fatal error:

    Got error ‘PHP message: PHP Warning: array_replace_recursive(): Expected parameter 2 to be an array, string given in /home/username/www/www.website.com/wp-content/plugins/woocommerce-myparcel/includes/admin/settings/class-wcmp-settings-data.php on line 168’, referer: https://www.website.com/wp-admin/admin.php?page=w3tc_dashboard&w3tc_note=flush_all

    Rolling back to 4.0.6 immediately fixed it.

    Please look deeper into what is causing this.
    The site uses a country, but whatever the user enters, the plugin cannot figure out the address and does not calculate a fee.

    Plugin Author Richard Perdaan

    (@richardperdaan)

    @chiefwigs1982 and @jopb ,
    In version 4.1.3 the problem with shipping country should be solved.

    Plugin Author Richard Perdaan

    (@richardperdaan)

    @strebor ,
    Zou je een mail naar [email protected] willen sturen. Dit probleem moet namelijk al opgelost zijn. Hierdoor kunnen wij meekijken op jouw website en kunnen we snel op een oplossing komen.

    strebor

    (@strebor)

    @richardperdaan

    Thanks! I’ll test 4.1.3 first. If that still does not fix the issue, then I’ll contact your support.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Fatal error with with version 4.1.0 and 4.1.1’ is closed to new replies.