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

Last updated by Alejandro 8 months ago.

Assigned support staff: Alejandro.

Author Posts
January 3, 2019 at 4:00 pm #3053594

José Luis Aránegas Soto

After proceeding to update my version of WordPress, certain elements of my website have disappeared. I have activated debugging and I get the following errors:

Error en la base de datos de WordPress: [Unknown column 't.trid' in 'on clause']
SELECT wp_posts.* FROM wp_posts JOIN wp_icl_translations wpml_translations ON wp_posts.ID = wpml_translations.element_id AND wpml_translations.element_type = CONCAT('post_', wp_posts.post_type) INNER JOIN wp_icl_translations translations_default ON translations_default.element_type = 'post_location' AND translations_default.language_code='es' AND translations_default.trid = t.trid WHERE 1=1 AND wp_posts.post_type = 'location' AND ((wp_posts.post_status = 'publish')) AND ( ( ( wpml_translations.language_code = 'es' OR 0 ) AND wp_posts.post_type IN ('post','page','attachment','product','product_variation','hb_accommodation','review','location','room_type','accommodation','sidebar' ) ) OR wp_posts.post_type NOT IN ('post','page','attachment','product','product_variation','hb_accommodation','review','location','room_type','accommodation','sidebar' ) ) ORDER BY wp_posts.post_title ASC

Error en la base de datos de WordPress: [Unknown column 't.trid' in 'on clause']
SELECT SQL_CALC_FOUND_ROWS wp_posts.*, 1 rooms_available, 0 rooms_booked , ( SELECT MIN(vacancies.price_per_day) min_price_per_day FROM wp_byt_accommodation_vacancies vacancies WHERE 1=1 AND vacancies.accommodation_id = translations_default.element_id AND vacancies.end_date >= '2019-01-03' ORDER BY min_price_per_day ASC LIMIT 1 ) accommodation_price FROM wp_posts JOIN wp_icl_translations wpml_translations ON wp_posts.ID = wpml_translations.element_id AND wpml_translations.element_type = CONCAT('post_', wp_posts.post_type) INNER JOIN wp_icl_translations translations_default ON translations_default.element_type = 'post_accommodation' AND translations_default.language_code='es' AND translations_default.trid = t.trid WHERE 1=1 AND wp_posts.post_type = 'accommodation' AND ((wp_posts.post_status = 'publish')) AND ( ( ( wpml_translations.language_code = 'es' OR 0 ) AND wp_posts.post_type IN ('post','page','attachment','product','product_variation','hb_accommodation','review','location','room_type','accommodation','sidebar' ) ) OR wp_posts.post_type NOT IN ('post','page','attachment','product','product_variation','hb_accommodation','review','location','room_type','accommodation','sidebar' ) ) GROUP BY wp_posts.ID HAVING 1=1 ORDER BY RAND() LIMIT 0, 4

If I deactivate your translation plugin, the lost elements return to the web, without translating.

What can motivate this erroneous behavior?

Thank you.

January 3, 2019 at 4:06 pm #3053605

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hello

The error message is indicating that an expected column/field in the icl_translations table that is missing.

I would like to confirm this on your site. Is this possible?
If so,
- please send access details for wp-admin on your installation in the private area that I will open for you now
- please also install and activate the ARI Adminer for my use.

Otherwise, please send me a screenshot of the table structure for icl_translations in your next reply.

Thanks

January 4, 2019 at 1:23 pm #3056478

José Luis Aránegas Soto

Have you been able to review my problem?

January 4, 2019 at 2:42 pm #3056876

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello, my name is Alejandro.

Since Yvette currently has a few days off, I will replace her here in the forum.
I hope this is OK with you.

I already talked to Yvette about your issue so i could catch up on her support research and i'm trying to figure out what's going on by only using the screenshot you sent. i tried to access your site but it blocked me due to security reasons, could you please disable the site so i can access it?

That might speed things up, in the meantime please follow these steps:

-Deactivate your AMP plugin (and check if that solves the problem)

❌ Before proceeding please make a full website backup! ❌
- Go to WPML -> Support -> Troubleshooting
Press the following buttons:
• "Clear the cache in WPML"
• "Remove ghost entries from the translation tables"
• "Fix element_type collation"
• "Set language information"
• "Fix post type assignment for translations"
Please check if the issue is fixed after every button press.
Let me know how this goes and if any of the steps helped you fix this.

January 4, 2019 at 9:47 pm #3057969

José Luis Aránegas Soto

Sorry I'm late. I have done all the suggested steps but the problem persists even if I do them all.

I have reactivated the username and password indicated, try again to access.

Thank you very much.

January 7, 2019 at 9:34 am #3061958

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello,

I tried to access the site but it's throwing a timeout error, so i wasn' able to access it.

Could you please fix that and let me know please?

If you want, i can also provide a staging environment where you can migrate the site to, I could work there without risking anything on the current site. if you like the idea, then follow the steps i will leave in the next answer.

Let me know how it goes.

January 9, 2019 at 5:12 pm #3072995

José Luis Aránegas Soto

You have just finished the migration that you have proposed to me.

January 11, 2019 at 12:08 pm #3080520

José Luis Aránegas Soto

Have you been able to verify the migration?

January 11, 2019 at 1:09 pm #3080851

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Sorry for the delay in the answer.

Yes i have checked the site and the table and i'm still running a few tests, i'll leave another answer here as soon as i get a positive result.

Regards,
Alejandro.

January 11, 2019 at 7:53 pm #3081881

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello, i ran a few tests to try to check what was the issue and i couldn't find anything gone on the site or anything.

I did notice that you had autoptimize which i must've missed before. so i suggest you flush the plugins' cache and then deactivate it.

See, that plugin can break your site on some situations so maybe that could be the cause of the issue.

Could you try doing that and activate WPML again and see what happens?

Before you do that, erase everything on the log, check it again and see if when WPML is off you don't get any errors.
Then proceed to activate all the WPML plugins and check again if the error mentioned before re-appears, please?

Thanks in advance for the answer.

January 13, 2019 at 7:36 pm #3085144

José Luis Aránegas Soto

The problem continues.

Warning: Parameter 2 to BookYourTravel_Accommodation_Helper::build_accommodations_search_where() expected to be a reference, value given in /var/www/vhosts/41/217272/webspace/siteapps/WordPress-240446/htdocs/wp-includes/class-wp-hook.php on line 286 Warning: Parameter 2 to BookYourTravel_Accommodation_Helper::build_accommodations_search_join() expected to be a reference, value given in /var/www/vhosts/41/217272/webspace/siteapps/WordPress-240446/htdocs/wp-includes/class-wp-hook.php on line 286 Warning: Parameter 2 to BookYourTravel_Accommodation_Helper::build_accommodations_search_groupby() expected to be a reference, value given in /var/www/vhosts/41/217272/webspace/siteapps/WordPress-240446/htdocs/wp-includes/class-wp-hook.php on line 286 Warning: Parameter 2 to BookYourTravel_Accommodation_Helper::build_accommodations_search_orderby() expected to be a reference, value given in /var/www/vhosts/41/217272/webspace/siteapps/WordPress-240446/htdocs/wp-includes/class-wp-hook.php on line 286 Warning: Parameter 2 to BookYourTravel_Accommodation_Helper::build_accommodations_search_fields() expected to be a reference, value given in /var/www/vhosts/41/217272/webspace/siteapps/WordPress-240446/htdocs/wp-includes/class-wp-hook.php on line 286

Error en la base de datos de WordPress: [Unknown column 't.trid' in 'on clause']
SELECT SQL_CALC_FOUND_ROWS wp_posts.*, 1 rooms_available, 0 rooms_booked , ( SELECT MIN(vacancies.price_per_day) min_price_per_day FROM wp_byt_accommodation_vacancies vacancies WHERE 1=1 AND vacancies.accommodation_id = translations_default.element_id AND vacancies.end_date >= '2019-01-13' ORDER BY min_price_per_day ASC LIMIT 1 ) accommodation_price FROM wp_posts JOIN wp_icl_translations wpml_translations ON wp_posts.ID = wpml_translations.element_id AND wpml_translations.element_type = CONCAT('post_', wp_posts.post_type) INNER JOIN wp_icl_translations translations_default ON translations_default.element_type = 'post_accommodation' AND translations_default.language_code='es' AND translations_default.trid = t.trid WHERE 1=1 AND wp_posts.post_type = 'accommodation' AND ((wp_posts.post_status = 'publish')) AND ( ( ( wpml_translations.language_code = 'es' OR 0 ) AND wp_posts.post_type IN ('post','page','attachment','product','product_variation','hb_accommodation','review','location','room_type','accommodation','sidebar' ) ) OR wp_posts.post_type NOT IN ('post','page','attachment','product','product_variation','hb_accommodation','review','location','room_type','accommodation','sidebar' ) ) GROUP BY wp_posts.ID HAVING 1=1 ORDER BY RAND() LIMIT 0, 4

January 13, 2019 at 7:53 pm #3085158

José Luis Aránegas Soto

The first block of error I solved changing the PHP version from 7.0.1 to 7.0.0

January 14, 2019 at 2:12 pm #3087987

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello, after a colleague had a very similar issue, we found out the problem is an incompatibility with the theme, whom we're going to contact and try to sort it with them (but it would be very helpful if you tell the author about this issue as well so maybe we can speed things up with him.)

In the meantime please do the following:

Go to wp-content/themes/includes/post_types/ find and change all ocurrences of = "t.trid" into = "wpml-translations.trid" within the following files calling it:

- class-accomodation-helper.php
- class-car-rental-helper.php
- class-cruise-helper.php
- class-location-helper.php
- class-tour-helper.php

Then try again and see if the problem goes away (the theme is using old information we used to work with, that's why it's creating issues in the database)

Regards,
Alejandro