12

I have found a bug after the upgrading the Wordpress to the last version of the software 3.9.

I get this error:

Thu Apr 17 17:21:52 2014] [warn] mod_fcgid: stderr: 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, referer: http://www.mywebsite.com/

Why do this happen?

Michelangelo
  • 1,398
  • 2
  • 14
  • 37
  • What's the code on the line mentioned? If you don't have any luck on here, try http://wordpress.stackexchange.com/ which might suite better for any wordpress related dev question. – Daniel W. Apr 17 '14 at 15:42
  • Why not file a bug with the author of the plugin? It's obvious that the issue is with plugin not working with 3.9. Perhaps wait for a fix from them? – dotty Apr 17 '14 at 15:44
  • @DanFromGermany I don't know the website wordpress.stackexchange.com ... however thanks – Michelangelo Apr 17 '14 at 20:40

4 Answers4

48

Solved!!

You have to remove the "$before." in qtranslate_core.php file from the last line, qtranslate works here with WP 3.9 !

so the result must be:

return strftime($format, $date).$after;

We will wait the qTranslate upgrade!

thanks

Gwenc37
  • 2,064
  • 7
  • 18
  • 22
Michelangelo
  • 1,398
  • 2
  • 14
  • 37
3

I wanted to add my 2 cents after investigating this issue myself. I don't like to ever hack the core of WP or the plugins. When I got the error indicated by the author of this thread, I fixed it by going into Settings -> Languages and clicking the Advanced Settings tab.

Under the Date / Time Conversion section it was set to the first option Use emulated date function. I changed it to Use strftime instead of date. and voila, no more error and no hacking the core!

Report back if this worked for you or if you had any issues.

Wordpress: v3.9.1 qTranslate: v2.5.39

Shan Robertson
  • 2,742
  • 3
  • 25
  • 43
1

For me (WP 4.1.1, qTranslate 2.5.39) the following helped:

  1. From the dashboard, go to Plugins > qTranslate > Settings
  2. Click the "Advanced Settings" link
  3. In the "Date / Time Conversion" settings group select "Use strftime instead of date and replace formats with the predefined formats for each language." (was set to "Use strftime instead of date").

Voila!

evictorov
  • 33
  • 1
  • 12
0

Unfortunately all above didn't work for me, but I found another solution, which helped me solve that issue:

in file qtranslate_core.php you must change this line

function qtrans_dateFromPostForCurrentLanguage($old_date, $format ='', $before = '', $after = '') {

to

function qtrans_dateFromPostForCurrentLanguage($old_date, $format ='') {

and this line

return qtrans_strftime(qtrans_convertDateFormat($format), mysql2date('U',$post->post_date), $old_date, $before, $after);

to

return qtrans_strftime(qtrans_convertDateFormat($format), mysql2date('U',$post->post_date), $old_date);
Aleks Dorohovich
  • 1,622
  • 1
  • 13
  • 17