Skip Navigation

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

Last updated by Subash Chandra Poudel 1 year, 7 months ago.

Assisted by: Subash Chandra Poudel.

Author Posts
September 10, 2023 at 10:09 am #14370879

jeroenL-11

I am trying to: edit Products>Attributes>configure terms>edit for example "Antraciet"

I got: You need a higher level of permission. Sorry, you are not allowed to edit this item.

It is not with all attributes that it does not work. But if I go to another attribute, where Anthracite is also used, I see the same error.

I also see that this is stated in the Woocommerce logging, it seems as if these values are connected incorrectly in the database.

2023-09-09T08:06:51+00:00 CRITICAL Uncaught InvalidArgumentException: element_id and type do not match for element_id:732 the database contains tax_pa_kleur-frame while this function was called with tax_pa_maat in /home/u132030p145415/domains/jene.nl/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php:34
Stack trace:
#0 /home/u132030p145415/domains/jene.nl/public_html/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(1529): WPML_Set_Language->set()
#1 /home/u132030p145415/domains/jene.nl/public_html/wp-content/plugins/sitepress-multilingual-cms/inc/translation-management/translation-management.class.php(2242): SitePress->set_element_language_details()
#2 /home/u132030p145415/domains/jene.nl/public_html/wp-content/plugins/sitepress-multilingual-cms/inc/translation-management/translation-management.class.php(2227): TranslationManagement->add_missing_language_to_taxonomy()
#3 /home/u132030p145415/domains/jene.nl/public_html/wp-content/plugins/sitepress-multilingual-cms/inc/translation-management/translation-management.class.php(2255): TranslationManagement->add_missing_language_to_taxonomies()
#4 /home/u132030p145415/domains/jene.nl/public_html/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(633): TranslationManagement->add_missing_language_information()
#5 /home/u132030p145415/domains/jene.nl/public_html/wp-includes/class-wp-hook.php(310): SitePress->rebuild_language_information()
#6 /home/u132030p145415/domains/jene.nl/public_html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
#7 /home/u132030p145415/domains/jene.nl/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()
#8 /home/u132030p145415/domains/jene.nl/public_html/wp-settings.php(632): do_action()
#9 /home/u132030p145415/domains/jene.nl/public_html/wp-config.php(114): require_once('/home/u132030p1...')
#10 /home/u132030p145415/domains/jene.nl/public_html/wp-load.php(50): require_once('/home/u132030p1...')
#11 /home/u132030p145415/domains/jene.nl/public_html/wp-blog-header.php(13): require_once('/home/u132030p1...')
#12 /home/u132030p145415/domains/jene.nl/public_html/index.php(17): require('/home/u132030p1...')
#13 {main}
thrown in /home/u132030p145415/domains/jene.nl/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php op de lijn 34

2023-09-10 12_03_48-Instellingen.png
2023-09-10 12_03_24-WordPress › Error.png
September 11, 2023 at 5:18 pm #14378727

Subash Chandra Poudel

Hi there,

The PHP error message you shared seems related to a known issue as explained in the erratum linked next:

https://wpml.org/errata/fatal-error-invalidargumentexception-element_id-and-type-do-not-match/

Can you please try the workaround explained in the erratum and see if it helps with the PHP error?

Now, the permission warning you get when trying might or might not be related to the PHP error, but please check if it works after applying the workaround above. Also please check if the issue is only with one user or is it with all/new user on the site.

Regards,
Subash

September 12, 2023 at 5:40 pm #14385695

jeroenL-11

Hi, thanks for your response and help, I appreciate it.

I was able to go through the first steps, but unfortunately that had no effect.

I have tried the next steps, but I cannot find the type_id in the table.

The nice thing is. That we have a test environment where the same problem occurs. Would it be an idea for me to give you access? If so, how can I best send it to you? We can try everything we need in that environment. I'll make a backup. So that we can also return easily. If we find the solution, we can implement it in the production environment.

September 13, 2023 at 3:25 pm #14391259

Subash Chandra Poudel

Hi there,

Sure, I can look into the issue for you in a clone test copy site. Would you please mind sharing temporary access (WP-Admin and FTP) to your test site where the same issue is replicated?

I have enabled a private reply for you to share the credentials securely, which means only you and I have access to it.

IMPORTANT: Please take a complete backup of the site first to avoid data loss.

✙ I would additionally need your permission to make a copy of the site with plugins like Duplicator and deploy it on my local machine to test the issue further.

Regards,
Subash

September 14, 2023 at 4:33 pm #14398253

Subash Chandra Poudel

Thank you for the details.

Upon further troubleshooting, I see that the issue is still there when WPML plugins are deactivated. In fact, the issue is still there when all plugins are deactivated and a default theme is activated as you can see currently in the site.

So the issue seems to be with the user permission of the user you are trying to edit the attribute as. In this case, I recommend you create a new admin user and test if it works with the new user. You can also use plugins like User Role Editor ( https://wordpress.org/plugins/user-role-editor/ ) to make sure the user has all the permissions/capabilities required to edit the attribute term. Also it might help contacting the WooCommerce support in this case to see if this is an issue with WooCommerce in your site.

Regards,
Subash

September 14, 2023 at 4:57 pm #14398681

jeroenL-11

Hi, very special. Created a new administrator, same error, created a new user as editor, and gave all rights with User Role Editor. Still same error. Thanks for your help. I will indeed contact Woocommerce. Do you still want to know what the problem is, or would you rather close the ticket? Greetings, Jeroen

September 14, 2023 at 5:13 pm #14398927

Subash Chandra Poudel

Hi Jeroen,

The ticket will stay open for a few weeks, you can keep us posted here regarding the fix, or feel free to mark the ticket as resolved if you like.

Feel free to contact us again in the future if you need help with WPML.

Regards,
Subash

September 21, 2023 at 6:09 am #14434607

jeroenL-11

Unfortunately I was not able to get good support from Woocommerce. Or it took too long. What I did was created new attributes, set them to the products and removed the broken ones from the database. Not the prettiest solution, but it worked. Thanks for your help anyway. Greeting.