This morning I upgraded some wordpress blogs, where I am also using the qtranslate plugin.
After upgrading to WordPress 3.9 the home page was broken.
Looking into the server logs I quickly found the problem:
PHP Catchable fatal error: Object of class WP_Post could not be converted to string in ../wp-content/plugins/qtranslate/qtranslate_core.php on line 455
I wrote to this quick and dirty patch to have the site back online. If you have a better patch please share !
Saverio
Thanks Saverio
How can I apply this patch?
Pingback: Fix qTranslate with WordPress 3.9 » alexander kirk » Blog Archive
Hi,
I have posted about a better fix in my blog: Fix qTranslate with WordPress 3.9. It takes care of the root of the cause by removing the second parameter of the called function. See my post for more detailed info.
Regards,
Alex
Hi mate,
and thanks for your post, it helped me out to solve this issue.
Actually, the error is complaining about line 455 and you are changing a different row. Your code does not return any error because it will never get to that line. I finally solved this issue by modifying line 455 like from:
return $before.($format, $date).$after;
to:
return $before->post_content.strftime($format, $date).$after;
Cheers
Hi
Do the above fixes resolve the problem with the visual editor?
Thanks
THANK YOU! deliberately with capital letters 🙂
It works! – Thank you so much!
Where have I to applicate this patch?
I’m not sure, but….
We are talking of
qtranslate/qtranslate_core.php
(reach it from plugin page)
What says picture Saverio posted:
Line diff… only describes differences fund
(this one) “diff –git a/wp-content/plugins/qtranslate/qtranslate_core.php b/wp-content/plugins/qtranslate/qtranslate_core.php
index 17b4669..9ac128a 100644
— a/wp-content/plugins/qtranslate/qtranslate_core.php
+++ b/wp-content/plugins/qtranslate/qtranslate_core.php
@@ -414,6 +414,7 @@ function qtrans_updateTermLibrary() {”
only describe differences fund.
You havo to fine line of the function:
function qtrans_strftime($format, $date, $default = ”, $before = ”, $after = ”) {
// don’t do anything if format is not given
+ return $default;
if($format==”) return $default;
// add date suffix ability (%q) to strftime
$day = intval(ltrim(strftime(“%d”,$date),’0′));
and copy the + line:
” return $default;”
THANK YOU! also me deliberately with capital letters cause I’m inexpert and it solved my panic in a flash. 😀
Pingback: A suggestion to fix Qtranslate problem with recently WP 3.9 update | Wocmultimedia's Blog
Hi.
This is what i want.. Thank u so much…
Pingback: I installed mqTranslate: the fork of qTranslate plugin compatible with WordPress 3.9 | ZioPRoTo
THANK YOU SO MUCH!
quick n dirty is the way to go =)
Hi,
Thank u so, so much
WP 3.9.1 and qTranslate 2.5.39 and qtranslate_javascript.php/qtrans_hook_on_tinyMCE in line 292
— ed = new tinymce.Editor(id, tinyMCEPreInit.mceInit[id]);
+++ ed = new tinymce.Editor(id, tinyMCEPreInit.mceInit[id], tinymce);
Thank you!!!!!!!!!
@Mata: thanks for the tip for the tinyMCE editor constructor fix! It seems we have have the visual editor working again after making the change you posted.
Thank You, @Mata and @Hackeando el Genoma !
Saved the day 🙂
That’s very dirty. Use Patches of programmer of qTranslate instead: https://plugins.trac.wordpress.org/changeset?sfp_email=&sfph_mail=&reponame=&new=907393%40qtranslate&old=845820%40qtranslate
OMG @Mata WTF… thank you so much :O It works flawlessly! Yay 😀
Tanks friend!
Really thanks @Mata !!!!!
Pingback: qTranslate Eklenti Notları - WP Notları
Hi,
I try to make it work on GoDaddy WordPress 4.0 site but the patch fails for me.
I tried the offical fix and the dirty too. One by one and together. But no luck. 🙁
Any experiences with this problem on 4.0??
Thank you
Thank You, Hackeando el Genoma! I searched for a good solution and Your’s really works. You made my day 😀
Thanks on the wp 4.0.1 work too.
@Hackeando el Genoma thanks mate, your solution is working for me in 4.1.
cheers
Thanks,
It is working