Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem: There is an error when activating WPML InvalidArgumentException: element_id and type do not match for element_id:62369 the database contains post_product_variation while this function was called with post_product in /wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php:32

Solution: see Relevant Documentation

Relevant Documentation: https://wpml.org/forums/topic/invalidargumentexception-element_id-and-type-do-not-match-for-element_id/#post-4032419

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

Last updated by karolyS 4 years, 9 months ago.

Assisted by: Laura.

Author Posts
June 17, 2019 at 6:28 am #4032375

karolyS

Hi Laura, thanks for the suggestions.

I corrected the Attribute slug character limitation problem manually on all slug where the string was too long. It was a very long process.
After that I'm tried to activate the wpml main addon (WPML Multilingual CMS) but the WP crashed with details:

2019-06-16T18:02:46+00:00 CRITICAL Uncaught InvalidArgumentException: element_id and type do not match for element_id:62369 the database contains post_product_variation while this function was called with post_product in /var/www/vhosts/koukosmarine.gr/httpdocs/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php:32
Stack trace:
#0 /var/www/vhosts/koukosmarine.gr/httpdocs/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(1484): WPML_Set_Language->set('62369', 'post_product', NULL, 'el', NULL, true)
#1 /var/www/vhosts/koukosmarine.gr/httpdocs/wp-content/plugins/sitepress-multilingual-cms/inc/translation-management/translation-management.class.php(1888): SitePress->set_element_language_details('62369', 'post_product', NULL, 'el')
#2 /var/www/vhosts/koukosmarine.gr/httpdocs/wp-content/plugins/sitepress-multilingual-cms/inc/translation-management/translation-management.class.php(1858): TranslationManagement->add_missing_language_to_post(Object(stdClass))
#3 /var/www/vhosts/koukosma in /var/www/vhosts/koukosmarine.gr/httpdocs/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php on line 32

After that I entered to the backend in recovery mode and disbaled the wpml plugins again.

Can you please check what this is about?

June 17, 2019 at 6:39 am #4032419

Laura
Supporter

Languages: English (English ) Italian (Italiano )

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

Hi,

this is a relatively common error that happens when some entries in the database are corrupted. This may be caused by a different number of factors, like updating or installing new plugins or doing operations on the database. Since you went through heavy changes in your site, it can be related to that.

You can try the troubleshooting options in WPML -> Support -> troubleshooting and see if they fix the issue (please do a backup before).

If they don't help, you'll need to operate on your database:
- do a backup
- with PHPMyAdmin or another database manager open the table wp_icl_translations
- search for element_id:62369
- verify what it is (should be a product, but maybe a copy)
- delete it

This should fix the issue.
Let me know if this helps you or if you need further assistance.

June 17, 2019 at 7:14 am #4032615

karolyS

Hi,
The record with element_id:62369 is "post_product_variation" and is probably related with the corrections that I made in the database.
In the WPML Troubleshooting page I can see that slugs (many of my corrections) in "Translatable taxonomies linking" is not linked with the Attribute that should be connected.
Is there any way to mass re-link these or fix the translation table for all the problematic translation?
PS: with all the errors, the whole WP is crashing or very slow. It is not an ideal environment to make editing or corrections from it.

June 17, 2019 at 2:51 pm #4036345

Laura
Supporter

Languages: English (English ) Italian (Italiano )

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

Hi,

I'm not sure which settings are you referring to, could you please send me a screenshot?

June 17, 2019 at 3:14 pm #4036507

karolyS

here it is

capture.png
June 17, 2019 at 3:22 pm #4036647

karolyS

If I starting to remove the records (by element_id) that i'm getting in the error message, can I recreate the translations later?

June 17, 2019 at 4:54 pm #4037343

Laura
Supporter

Languages: English (English ) Italian (Italiano )

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

Hi,

yes, you can create translations later if needed.

What happens if you link again the attribute with its proper taxonomy? Please remember to always backup before doing this kind of operations.

July 6, 2019 at 8:18 am #4155327

karolyS

Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.