Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem: After updating WPML this error message is displayed: Warning: Illegal string offset 'language_code' in /themes/enfold/config-wpml/config.php on line 488

Solution: This was a bug that has already been fixed. Please, make sure you are using the latest version of WPML.

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.

This topic contains 8 replies, has 4 voices.

Last updated by Bruno 3 years, 9 months ago.

Assigned support staff: Bruno.

Author Posts
November 30, 2016 at 11:11 am #1147452

michaelJ-15

I am trying to: Update

I see:
Warning: Illegal string offset 'language_code' in /homepages/28/d230474398/htdocs/de/wp-content/themes/enfold/config-wpml/config.php on line 488

November 30, 2016 at 2:00 pm #1147683

Bruno

Thank you for contacting us.

This seems like a compatibility issue. As a workaround, please open the "wp-content/themes/enfold/config-wpml/config.php" file on line 488, change this line:

if(is_home() || is_front_page()) $url = $sitepress->language_url($lang['language_code']);

with:

if(is_home() || is_front_page()) $url = $sitepress->language_url($lang);

After following this step, please let me know if the problem is resolved.

Thank you.

November 30, 2016 at 9:35 pm #1148205

michaelJ-15

Thanks a lot! It works. 🙂

December 1, 2016 at 11:12 am #1148702

Bruno

Glad to hear that it now works.

This will be fixed permanently in the next version of WPML. In the next release, you will not need to edit this file again.

Please let me know if I can help with any other questions you may have.

Thank you.

December 5, 2016 at 11:17 am #1151365

Bruno

Hello,

In the next WPML update, the workaround I posted above will no longer work - and will throw an error. You must re-edit the file "wp-content/themes/enfold/config-wpml/config.php" file and on line 488, edit the line:

if(is_home() || is_front_page()) $url = $sitepress->language_url($lang);

to

if(is_home() || is_front_page()) $url = $sitepress->language_url($lang['language_code']);

That is, you should keep the original file without that change I suggested above.

If you have any question about this, please let me know.

Thank you.

December 6, 2016 at 3:20 pm #1152780

jaroslavK

Hi,
I have the same problem on website: it.lawiretechc.cz
Can you help me?

December 6, 2016 at 3:21 pm #1152782

jaroslavK

Hello,
I have similar problem on my website: hidden link
Can you help me?

December 7, 2016 at 1:47 pm #1153872

DAD

Hey, Im using the latest enfold theme. In line 288 the code ist still:
if(is_home() || is_front_page()) $url = $sitepress->language_url($lang['language_code']);

Nevertheless I have the same issue!

December 7, 2016 at 2:11 pm #1153908

Bruno

Please add this code in the functions.php file of your theme:

add_action( 'init', 'wpmlcore_3776_temporary_fix' );
function wpmlcore_3776_temporary_fix() {
    remove_filter( 'WPML_filter_link','avia_change_wpml_home_link', 10 );
}

Note that this should be fixed in the next version of WPML, 3.6.2. Once fixed the above code will no longer be necessary.

Thank you.