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 thread is resolved. Here is a description of the problem and solution.

Problem:
element_id and type do not match for...
Solution:

PHP Fatal error: Uncaught InvalidArgumentException: element_id and type do not match for element_id:501 the database contains post_attachment while this function was called with post_nav_menu_item in /home3/intialpa/public_html/wp-content/plugins/sitepress-multilingual-cms-temp/classes/core-abstract-classes/class-wpml-set-language.php:32

However, this is linked to some of the menu items that are corrupted in database. Therefore, can you try the solution as explained on this answer?

https://wpml.org/forums/topic/i-am-getting-this-error-from-one-of-the-plugin/#post-4232725

If that doesn't work, there is also an option to delete menus:
https://wpml.org/forums/topic/admin-panel-goes-blank-when-i-activate-wpml-multilingual-cms/#post-3485163
Relevant Documentation:

This topic contains 6 replies, has 2 voices.

Last updated by rosemaryS 2 months, 1 week ago.

Assigned support staff: Bruno Kos.

Author Posts
August 11, 2019 at 11:07 pm

rosemaryS

I am trying to: Activate WPML in my website but when I finish ht setting say me The site is experiencing technical difficulties. Please check your site admin email inbox for instructions.

Link to a page where the issue can be seen:hidden link

I expected to see: Activate the account and continue with process

Instead, I got:to deactivated the plugin from FTP changing the name of the plugin, I review many times the support, I increased the WP memory and try any solution that I can find in the web, I restored a backup of my webpage, I Use WordPress 5.2.2 also I received the email as follow

Howdy!

Since WordPress 5.2 there is a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.

In this case, WordPress caught an error with one of your plugins, WPML Multilingual CMS.

First, visit your website (hidden link) and check for any visible issues. Next, visit the page where the error was caught (hidden link) and check for any visible issues.

Please contact your host for assistance with investigating this issue further.

If your site appears broken and you can't access your dashboard normally, WordPress now has a special "recovery mode". This lets you safely login to your dashboard and investigate further.

hidden link

Please Help me with the correct installation,

If you need access to my website please contact me,

regards,

Rosemary

August 12, 2019 at 12:37 pm #4380757

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

Thank you for contacting WPML support!

May I ask the following?

1. Edit wp-config.php and insert the following lines:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

2. Reproduce the issue - try activating WPML.

3. Locate the debug log in: /wp-content/debug.log

4. Paste the latest lines here. No need to paste the entire log file, just 20 lines or so will do. Please censor any sensitive information.

https://codex.wordpress.org/Debugging_in_WordPress

Regards,
Bruno Kos

August 12, 2019 at 1:43 pm #4381363

rosemaryS

Hi Bruno, thanks for your answer.

[12-Aug-2019 13:35:46 UTC] PHP Notice: Constant WP_CRON_LOCK_TIMEOUT already defined in /home3/intialpa/public_html/wp-config.php on line 98
[12-Aug-2019 13:35:46 UTC] PHP Notice: Constant AUTOSAVE_INTERVAL already defined in /home3/intialpa/public_html/wp-config.php on line 99
[12-Aug-2019 13:35:46 UTC] PHP Notice: Constant WP_POST_REVISIONS already defined in /home3/intialpa/public_html/wp-config.php on line 100
[12-Aug-2019 13:35:46 UTC] PHP Notice: Constant EMPTY_TRASH_DAYS already defined in /home3/intialpa/public_html/wp-config.php on line 101
[12-Aug-2019 13:35:51 UTC] PHP Warning: Unterminated comment starting line 10 in /home3/intialpa/public_html/wp-content/themes/flatsome/functions.php on line 10
[12-Aug-2019 13:35:51 UTC] PHP Fatal error: Uncaught InvalidArgumentException: element_id and type do not match for element_id:501 the database contains post_attachment while this function was called with post_nav_menu_item in /home3/intialpa/public_html/wp-content/plugins/sitepress-multilingual-cms-temp/classes/core-abstract-classes/class-wpml-set-language.php:32
Stack trace:
#0 /home3/intialpa/public_html/wp-content/plugins/sitepress-multilingual-cms-temp/sitepress.class.php(1489): WPML_Set_Language->set('501', 'post_nav_menu_i...', NULL, 'en', NULL, true)
#1 /home3/intialpa/public_html/wp-content/plugins/sitepress-multilingual-cms-temp/inc/wp-nav-menus/class-wpml-nav-menu.php(211): SitePress->set_element_language_details('501', 'post_nav_menu_i...', NULL, 'en')
#2 /home3/intialpa/public_html/wp-content/plugins/sitepress-multilingual-cms-temp/inc/wp-nav-menus/class-wpml-nav-menu.php(78): WPML_Nav_Menu->_set_menus_language()
#3 /home3/intialpa/public_html/wp-includes/class-wp-hook.php(286): WPML_Nav_Menu->init('')
#4 /home3/intialpa/public_html/wp-inc in /home3/intialpa/public_html/wp-content/plugins/sitepress-multilingual-cms-temp/classes/core-abstract-classes/class-wpml-set-language.php on line 3

Thanks,

Rosemary

August 13, 2019 at 6:06 am #4385161

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

Thank you for this - now we know what is behind the scenes. This does happen sometimes and it can have several causes:

PHP Fatal error: Uncaught InvalidArgumentException: element_id and type do not match for element_id:501 the database contains post_attachment while this function was called with post_nav_menu_item in /home3/intialpa/public_html/wp-content/plugins/sitepress-multilingual-cms-temp/classes/core-abstract-classes/class-wpml-set-language.php:32

However, this is linked to some of the menu items that are corrupted in database. Therefore, can you try the solution as explained on this answer?

https://wpml.org/forums/topic/i-am-getting-this-error-from-one-of-the-plugin/#post-4232725

If that doesn't work, there is also an option to delete menus:
https://wpml.org/forums/topic/admin-panel-goes-blank-when-i-activate-wpml-multilingual-cms/#post-3485163

However I see that you have quite a lot of menu items in the main menu and that may not be the best solution, because it would take a while for you to re-create all these items. However, that approach should fix the corrupted entry.

Regards,
Bruno Kos

August 14, 2019 at 3:21 am #4391823

rosemaryS

thanks Bruno,

I´ve deleted the menu and I can activate the WPML plugin, but now I have a problem When I activated the Woocommerce multilingual plugin again my web site say "The site is experiencing technical difficulties"

The debug log show me

Stack trace:
#0 /home3/intialpa/public_html/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(1489): WPML_Set_Language->set('113', 'tax_product_cat', false, 'en', NULL, true)
#1 /home3/intialpa/public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-install.php(122): SitePress->set_element_language_details('113', 'tax_product_cat', false, 'en')
#2 /home3/intialpa/public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-install.php(52): WCML_Install::set_language_information(Object(SitePress))
#3 /home3/intialpa/public_html/wp-content/plugins/woocommerce-multilingual/classes/class-woocommerce-wpml.php(248): WCML_Install::initialize(Object(woocommerce_wpml), in /home3/intialpa/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php on line 32
[14-Aug-2019 03:01:05 UTC] PHP Fatal error: Uncaught InvalidArgumentException: element_id and type do not match for element_id:113 the database contains tax_product_tag while this function was called with tax_product_cat in /home3/intialpa/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php:32
Stack trace:
#0 /home3/intialpa/public_html/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(1489): WPML_Set_Language->set('113', 'tax_product_cat', false, 'en', NULL, true)
#1 /home3/intialpa/public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-install.php(122): SitePress->set_element_language_details('113', 'tax_product_cat', false, 'en')
#2 /home3/intialpa/public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-install.php(52): WCML_Install::set_language_information(Object(SitePress))
#3 /home3/intialpa/public_html/wp-content/plugins/woocommerce-multilingual/classes/class-woocommerce-wpml.php(248): WCML_Install::initialize(Object(woocommerce_wpml), in /home3/intialpa/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php on line 32
[14-Aug-2019 03:01:06 UTC] PHP Warning: Unterminated comment starting line 10 in /home3/intialpa/public_html/wp-content/themes/flatsome/functions.php on line 10
[14-Aug-2019 03:01:07 UTC] PHP Fatal error: Uncaught InvalidArgumentException: element_id and type do not match for element_id:113 the database contains tax_product_tag while this function was called with tax_product_cat in /home3/intialpa/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php:32
Stack trace:
#0 /home3/intialpa/public_html/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(1489): WPML_Set_Language->set('113', 'tax_product_cat', false, 'en', NULL, true)
#1 /home3/intialpa/public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-install.php(122): SitePress->set_element_language_details('113', 'tax_product_cat', false, 'en')
#2 /home3/intialpa/public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-install.php(52): WCML_Install::set_language_information(Object(SitePress))
#3 /home3/intialpa/public_html/wp-content/plugins/woocommerce-multilingual/classes/class-woocommerce-wpml.php(248): WCML_Install::initialize(Object(woocommerce_wpml), in /home3/intialpa/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php on line 32

Thanks,

Rosemary

August 14, 2019 at 6:06 am #4392541

Bruno Kos
Supporter

Languages: English (English )

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

Hi Rosemary,

Now that WPML is active, I ran some troubleshooting functions and activated WooCommerce multilingual. Can you check now?

You can run the setup wizard.

Regards,
Bruno Kos

August 14, 2019 at 2:58 pm #4396229

rosemaryS

My issue is resolved now. Thank you!