Resolved
Reported for: WPML Multilingual CMS 3.1.9.3
Resolved in: 3.1.9.4
Overview of the issue
Catchable fatal error: Object of class stdClass could not be converted to string in /home/lahjatup/public_html/markkinointiopisto.fi/wp-content/plugins/sitepress-multilingual-cms/inc/wpml-config/wpml-config.class.php on line 252
Or
Warning: dirname() expects parameter 1 to be string, object given in /home1/treasure/public_html/dev/wp-content/plugins/sitepress-multilingual-cms/inc/wpml-config/wpml-config.class.php on line 252
The above PHP errors will appear in your Admin pages like your plugins, theme or Translation Management > Multilingual Content Setup pages.
Workaround
- Login via FTP
- Locate the sitepress-multilingual-cms/
inc/wpml-config/wpml-config. class.php file - Locate the line mentioned in the PHP error you see (252). For example:
$type = ( dirname( $file ) == get_template_directory() || dirname( $file ) == get_stylesheet_directory() ) ? 'theme' : 'plugin'; $admin_text_context = basename( dirname( $file ) );
- Delete both lines of code
- In the same file locate the following code (around line 210):
}else{ $config = icl_xml2array( file_get_contents( $file ) ); }
- Modify this block of code to become:
}else{ $config = icl_xml2array( file_get_contents( $file ) ); $type = ( dirname( $file ) == get_template_directory() || dirname( $file ) == get_stylesheet_directory() ) ? 'theme' : 'plugin'; $admin_text_context = basename( dirname( $file ) ); }
- Save the file and upload to your server
thx
I made the sugested modification of the include file, but I don’t see any effect.
The Error-Message still appears in the nav-menus-php page.
Daniel
Hello Daniel,
Could you please open a support forum ticket for the issue? This way we will be able to assist better.
Thanks!
Workaround worked 🙂
Thank you very much
Tuna Ciner
You are very welcome! 🙂
Worked for me too. Thank-you!
Happy to hear this. You are welcome!
It works. Thank you.
It doesn’t work for me. Still have message three times!
Hello Antonia,
May I suggest then please to open a support ticket in our forum so we can see what is happening?
Thank you so much!
@antonia, I took your support ticket. I’ll try to help you there, awaiting your response.
It works for me too!
Hello. This fix also worked for me 🙂
fixed thanks a lot
Thanks a lot – it helped
thanks it worked for me!!
The workaround is no longer needed if you are using the latest stable release of WPML 🙂