Wordpress 3.9 - 4.1 and qTranslate issue

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?

Answers


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


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


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!


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);

Need Your Help

Getting the index of the returned max or min item using max()/min() on a list

python list max min

I'm using Python's max and min functions on lists for a minimax algorithm, and I need the index of the value returned by max() or min(). In other words, I need to know which move produced the max (...

C++ unit testing framework

c++ unit-testing

I use the Boost Test framework for my C++ code but there are two problems with it that are probably common to all C++ test frameworks: