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 3 replies, has 2 voices.

Last updated by Diego Pereira 5 months ago.

Assigned support staff: Diego Pereira.

Author Posts
May 13, 2019 at 1:41 pm #3798873

Lawrance

Hi, This is an old bug that I've posted at https://wpml.org/forums/topic/catchable-fatal-error-object-of-class-wp_error-could-not-be-converted-to-string-16/
===============================================
I got error "Catchable fatal error: Object of class WP_Error could not be converted to string in wp-includes\pluggable.php on line 1251" after upgrade wpml to 4.2.0.

Everything is fine if I downgrade to 4.1.4.
===============================================

I tested this problem at version 4.2.6, This problem still exists.

After I reviewed your code, this error is generated on function 'maybe_redirect_to_translated_taxonomy'.

This function was added at version 4.2.0

This function gets a wrong translated slug from $this->translate_term_values(...)

May 13, 2019 at 7:27 pm #3801329

Diego Pereira
Supporter

Languages: English (English ) Spanish (Español ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello @Lawrance, welcome to the WPML support Forum!

Thanks for the report. I created a clean WP install with WPML that we can use for test here: hidden link

Could you send us more details on how to reproduce this issue on a the clean install? I will forward to our DEV team.

All the best,
Diego

May 14, 2019 at 3:07 am #3802969

Lawrance

I don't know how to reproduce this issue.

Everything's fine if on version 4.1.4, but doesn't work on version >= 4.2.0

Error causes by function maybe_warm_term_id_cache:
After this line: $data = $this->wpdb->get_results(...)

"$this->term_ids" get wrong term id.

Then, back to function: maybe_redirect_to_translated_taxonomy

I meet this line:
if ( $translated_slugs && $slug !== $translated_slugs[0] )

May 14, 2019 at 5:10 pm #3809425

Diego Pereira
Supporter

Languages: English (English ) Spanish (Español ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi there,

In this case, please send us access to your WordPress dashboard (website URL, login and password) I'll check and do some tests. - Please use the private field to send the sensitive data - do not post if you do not see it.

It would be better if you give me a test site rather than the live site.

IMPORTANT Please backup a working copy of site files and database before.

Please also isntall these plugins, they will allow me to create a copy of the website if needed:
Duplicator: https://wordpress.org/plugins/duplicator/
File Manager: https://wordpress.org/plugins/wp-file-manager/
All-in-one WP Migration hidden link
Cloudways WordPress Migrator: https://wordpress.org/plugins/bv-cloudways-automated-migration/

PS: To ensure the quickest and most accurate support, please provide your debug information so that I can get a look at some of your configurations. We have an excellent article on how to located here: https://wpml.org/faq/provide-debug-information-faster-support/.
NOTE: Please be sure to check the box to indicate you can provide debug info and paste your debug info in the debug field provided, and NOT in the general response field.

Kind regards,
Diego

The topic ‘[Closed] Catchable fatal error: Object of class WP_Error could not be converted to string’ is closed to new replies.