[Resolved] Fatal Error on Homepage After Latest WPML Update
This thread is resolved. Here is a description of the problem and solution.
Problem: After updating the WPML Multilingual CMS plugin, the client experienced a fatal error on the homepage, caused by the rawurlencode() function. The error indicated a type mismatch, expecting a string but receiving an array. This issue was resolved by rolling back the plugin version, but reappeared when certain plugins were reactivated. Solution: We recommended deactivating all third-party plugins and then reactivating them one by one to identify the problematic plugin. It turned out that the 'iubenda | All-in-one Compliance for GDPR / CCPA Cookie Consent + more' plugin was causing the issue when activated. We suggested checking the plugin's compatibility and configuration with WPML by visiting the Useful resources.
Please note that this solution might be outdated or not applicable to your specific case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket.
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.
Background of the issue:
I am trying to load the homepage normally after updating the WPML Multilingual CMS plugin to the latest version. The issue can be seen at hidden link. I expected to see the homepage displaying correctly, just like before the update.
Symptoms:
Instead, I got a fatal error caused by rawurlencode(), which crashes the homepage. The rest of the site still works fine. The error goes away if I roll back to the previous version of the plugin. The error: <code><b>Fatal error</b>: Uncaught TypeError: rawurlencode(): Argument #1 ($string) must be of type string, array given in /www/beautyaholicsshop_478/public/wp-content/plugins/sitepress-multilingual-cms/classes/cookie/class-wpml-cookie.php:16 Stack trace: #0 /www/beautyaholicsshop_478/public/wp-content/plugins/sitepress-multilingual-cms/classes/cookie/class-wpml-cookie.php(16): rawurlencode(Array) #1 /www/beautyaholicsshop_478/public/wp-content/plugins/sitepress-multilingual-cms/classes/language/Detection/CookieLanguage.php(67): WPML_Cookie->set_cookie('wp-wpml_current...', Array, 1744706859, '/', '') #2 /www/beautyaholicsshop_478/public/wp-content/plugins/sitepress-multilingual-cms/classes/request-handling/wpml-request.class.php(181): WPMLLanguageDetectionCookieLanguage->set('wp-wpml_current...', Array) #3 /www/beautyaholicsshop_478/public/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(1175): WPML_Request->set_language_cookie(Array) #4 /www/beautyaholicsshop_478/public/wp-content/plugins/sitepress-multilingual-cms/inc/template-functions.php(1383): SitePress->switch_lang(Array, true) #5 /www/beautyaholicsshop_478/public/wp-includes/class-wp-hook.php(324): wpml_switch_language_action(Array) #6 /www/beautyaholicsshop_478/public/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #7 /www/beautyaholicsshop_478/public/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #8 /www/beautyaholicsshop_478/public/wp-content/plugins/revslider/includes/wpml.class.php(161): do_action('wpml_switch_lan...', Array) #9 /www/beautyaholicsshop_478/public/wp-includes/class-wp-hook.php(324): RevSliderWpml->change_lang(Array, true, Array, Object(RevSliderSlider)) #10 /www/beautyaholicsshop_478/public/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #11 /www/beautyaholicsshop_478/public/wp-content/plugins/revslider/includes/slider.class.php(1834): apply_filters('revslider_get_p...', Array, true, Array, Object(RevSliderSlider)) #12 /www/beautyaholicsshop_478/public/wp-content/plugins/revslider/includes/slider.class.php(1770): RevSliderSlider->get_parent_slides(true, Array, 'it') #13 /www/beautyaholicsshop_478/public/wp-content/plugins/revslider/includes/output.sr6.class.php(1098): RevSliderSlider->get_slides_for_output(true, 'it') #14 /www/beautyaholicsshop_478/public/wp-content/plugins/revslider/includes/output.sr6.class.php(826): RevSliderOutput->get_slides() #15 /www/beautyaholicsshop_478/public/wp-content/plugins/revslider/includes/output.sr6.class.php(712): RevSliderOutput->add_slider_base() #16 /www/beautyaholicsshop_478/public/wp-content/plugins/revslider/revslider.php(286): RevSliderOutput->add_slider_to_stage('home-page-slide...') #17 /www/beautyaholicsshop_478/public/wp-content/plugins/revslider/revslider.php(267): add_revslider('home-page-slide...', '') #18 /www/beautyaholicsshop_478/public/wp-content/themes/kona/includes/page-title.php(320): putRevSlider('home-page-slide...') #19 /www/beautyaholicsshop_478/public/wp-includes/template.php(812): require('/www/beautyahol...') #20 /www/beautyaholicsshop_478/public/wp-includes/template.php(745): load_template('/www/beautyahol...', false, Array) #21 /www/beautyaholicsshop_478/public/wp-includes/general-template.php(206): locate_template(Array, true, false, Array) #22 /www/beautyaholicsshop_478/public/wp-content/themes/kona-child/header.php(338): get_template_part('includes/page', 'title') #23 /www/beautyaholicsshop_478/public/wp-includes/template.php(810): require_once('/www/beautyahol...') #24 /www/beautyaholicsshop_478/public/wp-includes/template.php(745): load_template('/www/beautyahol...', true, Array) #25 /www/beautyaholicsshop_478/public/wp-includes/general-template.php(48): locate_template(Array, true, true, Array) #26 /www/beautyaholicsshop_478/public/wp-content/themes/kona/page.php(10): get_header() #27 /www/beautyaholicsshop_478/public/wp-includes/template-loader.php(106): include('/www/beautyahol...') #28 /www/beautyaholicsshop_478/public/wp-blog-header.php(19): require_once('/www/beautyahol...') #29 /www/beautyaholicsshop_478/public/index.php(17): require('/www/beautyahol...') #30 {main} thrown in <b>/www/beautyaholicsshop_478/public/wp-content/plugins/sitepress-multilingual-cms/classes/cookie/class-wpml-cookie.php</b> on line <b>16</b><br /></code>
Questions:
Could you please take a look and let me know how to fix this?
Thanks for contacting us. Your homepage in Italian loads fine hidden link when I inspected. Probably you've undo the changes and could you please share temporary access (WP-Admin and FTP) to a test site where the problem has been replicated, if possible. This will enable me to provide better assistance and determine if any configurations need to be modified.
Please note that it is important to have a backup for security purposes and to prevent any potential data loss. You can use the UpdraftPlus plugin (https://wordpress.org/plugins/updraftplus/) to fulfill your backup requirements.
Your upcoming reply will be treated with confidentiality and will only be visible to you and me.
✙ To resolve the issue, I may need your consent to deactivate and reactivate plugins and the theme, as well as make configuration changes on the site if necessary. This emphasizes the significance of having a backup.
Thanks for your patience. I've deactivated most of the third-party plugins, and the page now loads correctly: hidden link. It seems that one of the third-party plugins might be causing the issue. Could you try reactivating them one by one to identify which one is triggering the problem?
Thanks for the update! I’ll go ahead and start reactivating the plugins one by one to identify which one is causing the issue. I’ll let you know as soon as I find the culprit.
Thanks again for your help. I’ve finished reactivating the plugins one by one, and I’ve identified the one causing the issue — it’s the iubenda | All-in-one Compliance for GDPR / CCPA Cookie Consent + more plugin. When it’s activated, the homepage crashes.
Let me know if you have any suggestions on how to resolve this, or if you’d recommend reaching out directly to the plugin’s support team.