Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 6:00 – 12:00 8:00 – 12:00 6:00 – 12:00 8:00 – 12:00 6:00 – 12:00 -
- 13:00 – 15:00 13:00 – 17:00 13:00 – 15:00 13:00 – 17:00 13:00 – 15:00 -

Supporter timezone: America/Lima (GMT-05:00)

Tagged: 

This topic contains 11 replies, has 5 voices.

Last updated by christian.g 1 year, 2 months ago.

Assisted by: Nicolas V..

Author Posts
April 4, 2024 at 4:01 am #15480886

tarekS-7

There's error in checkout page due php ver 8.2 I found a fatal error in woocommerce log

2024-04-04T03:53:29+00:00 Critical Uncaught TypeError: md5(): Argument #1 ($string) must be of type string, array given in /home/u754615691/domains/accesslife.co/public_html/wp-content/plugins/wpml-string-translation/classes/gettext-hooks/Hooks.php:102 CONTEXT: {"error":{"type":1,"file":"\/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-content\/plugins\/wpml-string-translation\/classes\/gettext-hooks\/Hooks.php","line":102},"backtrace":["","#0 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-content\/plugins\/wpml-string-translation\/classes\/gettext-hooks\/Hooks.php(102): md5()","#1 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-includes\/class-wp-hook.php(324): WPML\\ST\\Gettext\\Hooks->gettext_filter()","#2 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-includes\/plugin.php(205): WP_Hook->apply_filters()","#3 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-includes\/l10n.php(206): apply_filters()","#4 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-includes\/l10n.php(306): translate()","#5 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-content\/plugins\/bosta-woocommerce\/bosta-woocommerce.php(418): __()","#6 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-includes\/class-wp-hook.php(324): bosta_custom_checkout_fields()","#7 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-includes\/class-wp-hook.php(348): WP_Hook->apply_filters()","#8 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-includes\/plugin.php(517): WP_Hook->do_action()","#9 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-content\/themes\/flatsome\/woocommerce\/checkout\/form-checkout.php(63): do_action()","#10 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-content\/plugins\/woocommerce\/includes\/wc-core-functions.php(345): include('\/home\/u75461569...')","#11 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-content\/plugins\/woocommerce\/includes\/shortcodes\/class-wc-shortcode-checkout.php(372): wc_get_template()","#12 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-content\/plugins\/woocommerce\/includes\/shortcodes\/class-wc-shortcode-checkout.php(69): WC_Shortcode_Checkout::checkout()","#13 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-content\/plugins\/woocommerce\/includes\/class-wc-shortcodes.php(72): WC_Shortcode_Checkout::output()","#14 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-content\/plugins\/woocommerce\/includes\/class-wc-shortcodes.php(95): WC_Shortcodes::shortcode_wrapper()","#15 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-includes\/shortcodes.php(433): WC_Shortcodes::checkout()","#16 [internal function]: do_shortcode_tag()","#17 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-includes\/shortcodes.php(273): preg_replace_callback()","#18 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-includes\/class-wp-hook.php(324): do_shortcode()","#19 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-includes\/plugin.php(205): WP_Hook->apply_filters()","#20 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-includes\/post-template.php(256): apply_filters()","#21 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-content\/themes\/flatsome\/woocommerce\/checkout\/layouts\/checkout.php(18): the_content()","#22 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-includes\/template.php(812): require('\/home\/u75461569...')","#23 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-content\/plugins\/woocommerce\/includes\/wc-core-functions.php(284): load_template()","#24 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-content\/themes\/flatsome\/page-checkout.php(9): wc_get_template_part()","#25 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-includes\/template-loader.php(106): include('\/home\/u75461569...')","#26 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-blog-header.php(19): require_once('\/home\/u75461569...')","#27 \/home\/u754615691\/domains\/accesslife.co\/public_html\/index.php(17): require('\/home\/u75461569...')","#28 {main}","thrown"]}

when I deactivated plugin it's working

checkout page error.png
April 4, 2024 at 10:53 pm #15485961

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi there.

Before this ticket gets assigned to one of my colleagues, I will try to help.

I created a custom search URL for you so that you can quickly find the existing support tickets that are based on the same topics and that already contain solutions shared by my colleagues:
hidden link

This way, you might find the solution faster and we might spend less time on this ticket.

Please take a look over the results from the homepage and let us know if you managed to get this resolved.

We will be waiting for your response.

Mihai

April 4, 2024 at 11:00 pm #15485966

tarekS-7

Hi Mihai,

Thanks for your reply.

Unfortunately, I’ve tested it but didn’t work.

https://wpml.org/forums/topic/fatal-error-caused-by-passing-an-array-should-be-a-string-into-md5-in-php8/

April 5, 2024 at 3:29 pm #15488858

Pierre
Supporter

Languages: English (English ) French (Français ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi @tarekS-7,

If you already updated to WordPress 6.5, you should also run all WPML plugins to their latest version (WPML 4.6.10, ST 3.2.10). As we are currently doing a progressive rollout, you may have to update manually (https://wpml.org/faq/why-dont-wpml-updates-show-up-right-away-in-my-wordpress-admin/).

Please check the WPML 4.6.10 announcement => https://wpml.org/changelog/2024/04/wpml-4-6-10-and-wcml-5-3-6-ready-for-wordpress-6-5/.

Let us know if it helps.

Thanks,
Pierre

April 5, 2024 at 3:40 pm #15488915

tarekS-7

I’ve updated the plugin and still the same problem.

Please assign the case to any engineer

April 5, 2024 at 4:09 pm #15489018

christian.g
Supporter

Hi @tareks-7,

the plugin Bosta WooCommerce seams to pass an array to the translation function here:

 \/home\/u754615691\/domains\/accesslife.co\/public_html\/wp-content\/plugins\/bosta-woocommerce\/bosta-woocommerce.php(418): __()","#6

But it must be a string as defined by WordPress: https://developer.wordpress.org/reference/functions/__/

Please try disabling that plugin.

Best,
Christian

April 5, 2024 at 4:32 pm #15489108

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hi Tarek,

We need to replicate on our servers and run some tests. Would it be possible to get a copy of your site?
For this, you need to temporarily install a plugin called “Duplicator” on your site. This will allow you to create a copy of your site and your content.
I have activated a private field for you where you can share those files (package + installer).
- You MUST exclude /wp-content/uploads and /wp-content/cache from the copy to reduce the size
- Once the package is ready, if the files are too large to upload them to the private field, you can share a link to Google Drive, Dropbox, WeTransfer or any other similar service.

Once the problem is resolved I will delete the local site. Let me know if this is ok with you.
https://wpml.org/faq/provide-supporters-copy-site/

duplicator.png
April 5, 2024 at 11:20 pm #15490081

tarekS-7

Yes bosta plugin is causing the problem but this is the logistics company. Is there's any other way to solve it from WPML side?

April 6, 2024 at 12:34 am #15490140

tarekS-7

My staging is working properly I added bosta plugin from staging to live and still the same problem

April 6, 2024 at 12:35 am #15490149

tarekS-7

Could you please activate private access again?

April 7, 2024 at 11:14 am #15491513

tarekS-7

Dears,

Can I have an update

April 8, 2024 at 8:08 am #15492937

christian.g
Supporter

Well, it needs to be fixed by the plugin author of Bosta WooCommerce.

But seams that plugin is quite stale. You could fix it by your own opening this file:

OPEN FILE

./wp-content/plugins/bosta-woocommerce/bosta-woocommerce.php

FIND

 $states[$i] = __($resultStates[$i], 'wps');

REPLACE WITH

$states[$i] = is_string( $resultStates[$i] ) ? __($resultStates[$i], 'wps') : $resultStates[$i];

=> SAVE.

Please keep in mind: if the plugin gets updated, your change is lost.

Best,
Christian

The topic ‘[Closed] WPML string translation causing checkout page error’ is closed to new replies.