Please make sure to update to WPML 4.3.5 and check our list of Known Issues before reporting

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

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 seanS-21 1 month, 2 weeks ago.

Assigned support staff: Yvette.

Author Posts
October 2, 2019 at 6:37 pm #4682765

seanS-21

I am trying to:

See all of the Pages, Posts, and Media that are on the site.

Link to a page where the issue can be seen:

hidden link

I expected to see:

5,583 items in the Media library

Instead, I got:

5,063 items in the Media library.

And if I disable and reenable WPML, then WPML throws this PHP error:

Fatal error: Uncaught InvalidArgumentException: element_id and type do not match for element_id:851 the database contains post_attachment while this function was called with post_post in /app/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php:32 Stack trace: #0 /app/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(1489): WPML_Set_Language->set('851', 'post_post', NULL, 'en', NULL, true) #1 /app/wp-content/plugins/sitepress-multilingual-cms/inc/translation-management/translation-management.class.php(1941): SitePress->set_element_language_details('851', 'post_post', NULL, 'en') #2 /app/wp-content/plugins/sitepress-multilingual-cms/inc/translation-management/translation-management.class.php(1911): TranslationManagement->add_missing_language_to_post(Object(stdClass)) #3 /app/wp-content/plugins/sitepress-multilingual-cms/inc/translation-management/translation-management.class.php(2007): TranslationManagement->add_missing_language_to_posts(Array) #4 /app/wp-c in /app/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php on line 32
The site is experiencing technical difficulties. Please check your site admin email inbox for instructions.

October 3, 2019 at 4:26 pm #4689807

Yvette
Supporter

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

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

Hello

I will be helping you resolve this database inconsistency.

1, Temporary Access to your system
Please provide access to your system (wp-admin and ftp) so that I can further investigate this particular problem. The fields to provide this data are included in a private section that I will open for your next response. You can find it above the comments area. The information in this private section is only visible between WPML Support and you.

2. Database backup
Please ensure that you have a database backup that you are confident in restoring since we are touching the database and it is good practice to have one on hand in case something goes wrong,

Thanks

October 4, 2019 at 9:14 am #4694371

Yvette
Supporter

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

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

Hello

I´m not able to use the normal database tool on your server to resolve this issue . Do you have a Cpanel access that you could provide?

I need to be able to remove some erroneous entries from the icl_translations table.

I am opening the private area for this.

October 4, 2019 at 7:22 pm #4698337

seanS-21

Err, I thought that was supposed to be private, but it looks like it's not. Can you remove/hide this info?

If not, I can delete this test server and spin up a new instance.

October 7, 2019 at 1:42 pm #4707909

Yvette
Supporter

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

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

I´m not having much luck using the SQL tool.

Perhaps we can try something else. Please send me a copy of your site as per this documentation:
https://wpml.org/faq/provide-supporters-copy-site/

I will fix the local copy and then we can decide if it makes sense to import the one table that had to be fixed.

Thankss

October 8, 2019 at 10:41 am #4714369

Yvette
Supporter

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

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

Alright. I can explain what you are seeing.

1. Error.
This is not occurring anymore on the server you provided for me. There was an extraneous/erroneous entry in our icl_translations table that I was able to remove by running the following

WPML > Support > Troubleshooting > Remove ghost entries from the translation tables

2. Different number of Media when WPML activated

This has to do with the view of translated media entries visible when WPML CMS IS activated or not. When CMS is deactivated, you will see ALL media entries in the wp-posts table. This is equivalent to the query #6 in the attached image.

When CMS is activate, then the media is separated into language spaces. You can see that the number of unique media is 5065 and translated dmedia is 520. These are queries #14 and #15.

This may not match EXACTLY what you see in your Media Library because some of your unique media is tagged as having the language code of "es" and others are tagged with "en".

I would have expected, for a new installation, to have all unique media to be tagged with similar language code. But if people are working in different languages and creating content/uploading media in different language spaces, then this is not entirely unexpected.

In summary, the database looks consistent for the state it is currently in.

If you were to execute the WPML Settings > Media Translation > Start (with all options selected), this would then put the number of media in your various libraries to be the same in all languages. And if you then deactivated CMS, you would see the total number of media multiply by the number of languages you had activated.

I hope I was able to explain what is happening.

October 18, 2019 at 5:50 pm #4784807

seanS-21

My issue is resolved now. Thank you! The tools > repair option solved both issues. (The number of posts was related to the database problem, because the “total” number was wrong until we ran the repair tool.)