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

Last updated by Bobby 2 months, 2 weeks ago.

Assigned support staff: Bobby.

Author Posts
August 5, 2019 at 4:40 pm #4342037

Kim Gamez

Google Search Console detected a 500 error on a few of my custom taxonomy archive pages.
hidden link
when checking the logs this is the error message
Recoverable fatal error: Object of class WP_Error could not be converted to string in /app/public/wp-includes/pluggable.php on line 1282

I was able to determine that it was WPML that was causing the issue as when disabled the issue was no longer happening.

The error is caused by the maybe_redirect_to_translated_taxonomy function in sitepress-multilingual-cms/classes/query-filtering/class-wpml-query-parser.php line 272. For some reason my install returning a WP_Error when the term does not exsist.

August 5, 2019 at 10:06 pm #4343151

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi There,

if you go to WPML->Settings->Taxonomy Translation do you see your custom taxonomy listed?

if yes please set it to either

 Translatable Only or Translatable - Fallback to default

and let me know your results please

August 6, 2019 at 1:09 pm #4347689

Kim Gamez

The taxonomy is set to "Not translatable". I do not want the zip code of a location to be translatable.

August 6, 2019 at 1:17 pm #4347757

Kim Gamez

I also have another open ticket that I started back in September of last year that involves me not being able to update my taxonomies and save without error or some warning showing up about the product_type not being synced and I have to go to some support page to fix it. I did that and that is around the time all of the issues in the DB started to happen.

I am not sure why if the taxonomy is not translatable the function maybe_redirect_to_translated_taxonomy would ever return true. I would think that we would just return out of the function right away if the taxonomy in question is set to not translate.

August 6, 2019 at 8:41 pm #4350481

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

As a test what are your results if you set it to "Translatable Only" , there is no need to add translations just change it from "not translatable" to "Translatable Only".

i have seen a similar error before and it was being caused by the taxonomy being set to 'not translatable"

please let me know your results

August 7, 2019 at 1:01 pm #4355275

Kim Gamez

Bobby,
I have tested on a clone of and setting it to fall back does fix the issue but also causes the error/issue that was found and is still unresolved. https://wpml.org/forums/topic/custom-query-for-featured-products-not-returning-products-on-translated-page/page/4/#post-2929320.

August 7, 2019 at 9:21 pm #4358323

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

I believe this is something that should be brought up to your orginal ticket as the taxonomy here should be set to either Translatable Only or Translatable - Fallback to default to resolve this error you receive.

as i can see my colleague updated in the ticket regarding its status

August 8, 2019 at 2:17 pm #4363741

Kim Gamez

So I should reference this issue/error in the other ticket? Do you think they are related?

August 8, 2019 at 9:20 pm #4366139

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

If i understand correct if you set the taxonomy to Translatable then the error is resolved correct?

but then you mentioned that you are then experiencing the issue mentioned in your previous ticket. Was that issue temporary resolved by switching the taxonomy to "Not Translatable? " and was this the recommendation of our developers ?

from what i can see the issue from that ticket should be fixed from our side in the future updates

i am not sure that they are related i am just wondering if turning the taxonomy to Not Translatable was advised by our developers as a workaround

Note : from my side i have updated the assigned supporter of your ticket so she is aware of this ticket as well

August 9, 2019 at 1:27 pm #4370783

Kim Gamez

Bobby,
You are correct if I switch the vendor_zip category to translatable the error does resolve but the underlying issue is not fixed. I was not asked by the developers to switch this taxonomy to "Not Translatable" but do not want my team to be able to even try and translate a zip code as it would never change regardless of the language.

The issue with your solution to switch to translate/fallback, besides be not wanting the taxonomy to be translated, is that clicking the save button on the settings page under the taxonomy section will cause the DB issues mentioned in the other support ticket.

I guess I have to wait until the other issue I have is resolved before we will be able to move forward fixing this one.

At the end of the day I really feel like something is not connecting as it should in the database. I did some debugging on my own for the url mentioned above and found that the system thought that the redirect should be happening (it was translated) and the translated term ID returned results for a term from a completely different taxonomy. I assume that these missconnections were caused by the other support ticket so I will wait to hear back on that and thanks for connecting the info from this ticket to the other ticket.

August 9, 2019 at 8:07 pm #4372757

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

A lot of times as you can see within WPML-.Settings->Taxonomy Translation there are mutliple categories that are greyed out and locked in the option to "Translatable" this is because this is an expected behavior (for example i have included some other taxonomies grayed out by default )

since changing the settings of this taxonomy affects the original issue i would recommend to wait until the original issue is resolved