Skip Navigation

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

Problem:
Learndash courses disappeared from the frontend after updating to WordPress 5.8

Solution:
The debug log file showed the following error:

PHP Fatal error:  Uncaught InvalidArgumentException: element_id and type do not match for element_id:42 the database contains post_attachment while this function was called with post_post in xxxx/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php:34

And it was fixed with the following steps:

Go to WPML > Support > Troubleshooting page, then click these options:

- Clear the Cache in WPML
- Remove ghost entries from the translation tables
- Fix element_type collation
- Fix WPML table collation
- Set language information

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 arnaudS-4 3 years, 10 months ago.

Assisted by: Mohamed Sayed.

Author Posts
August 2, 2021 at 2:15 am #9323809

arnaudS-4

Hi,
My website for running perfectly until few days ago.

My courses are no longer showing in the frontend in both languages of the site (hidden link).

There are still in the backend but no longer accessible (see screenshot).

I have update from WPML Multilanguage 4.4.10 to 4.4.11 but nothing changed.

Can you help?

2021-08-01.png
August 2, 2021 at 10:42 am #9326643

Mohamed Sayed

Hi Arnaud,
Thanks for contacting WPML support, I will be happy to help you today.

In order to investigate this issue I need more details about the following:

1- What changes were made to the site right before the issue starts? Those changes could be anything like (WPML update, other plugins and WordPress core update, or installing new plugins).

2- Please create a full backup and disable the WPML plugin then check if you can see the courses on the front end.

Let me know please how it goes.

Regards,
Mohamed

August 2, 2021 at 10:51 am #9326693

arnaudS-4

Hi,
I did no change myself but I think that the site updated automatically to WordPress 5.8
I have desactivated the plugin WPML Multilanguage and the course reappeared (see screenshot).
Now when I reactivated WPML the course disapeared again (hidden link)

2021-08-02.png
August 2, 2021 at 12:57 pm #9327727

Mohamed Sayed

Hi Arnaud,

1- I couldn't find any similar reported issues or known issues with the LearnDash plugin, it might be a conflict issue between WPML and another plugin. So please check if the issue persists in a minimal environment by following these steps:

- Keep only the WPML plugins and LearnDash and deactivate all the other plugins.
- Switch for a moment to a WordPress default theme like Twenty Twenty-one.
- If the issue is gone, activate one by one to see which one there is causing an interaction issue.

❌ Please backup your database and website before performing the above test ❌

2- Please provide me with the WordPress debug.log, this will allow us to see if any PHP errors are being produced. More Info: https://wordpress.org/support/article/debugging-in-wordpress/

To enable it, open your wp-config.php file and look for:

define('WP_DEBUG', false);

And change it to:

define('WP_DEBUG', true);
// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);
// Disable display of errors and warnings which is recommended on a live site.
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);

Then try to reproduce the issue and check if any errors were saved to the debug.log log file inside the /wp-content/ directory
If you can paste your debug.log to https://pastebin.com/ and provide me that link, it would be great!

Regards,
Mohamed

August 2, 2021 at 1:33 pm #9328141

arnaudS-4

Here the link:
https://pastebin.com/b9yPq8sf

August 2, 2021 at 4:06 pm #9329241

Mohamed Sayed

I checked the debug.log file and I can see the following 2 fatal errors:

This first error is coming from the Jetpack plugin:

[02-Aug-2021 13:25:08 UTC] PHP Fatal error:  Uncaught Error: Class 'Automattic\Jetpack\Sync\WP_Error' not found in xxxxx/wp-content/plugins/jetpack/vendor/automattic/jetpack-sync/src/class-rest-sender.php:37

So please check that error with their support team. The other one is coming from WPML:

[02-Aug-2021 13:26:59 UTC] PHP Fatal error:  Uncaught InvalidArgumentException: element_id and type do not match for element_id:42 the database contains post_attachment while this function was called with post_post in xxxx/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php:34

This is a common error that can happen when some entries in the database are corrupted, this could be due to a different number of factors like updating or installing new plugins or doing operations on the database.

So please try the following and let me know if it helps:

Go to WPML > Support > Troubleshooting page, then click these options:

- Clear the Cache in WPML
- Remove ghost entries from the translation tables
- Fix element_type collation
- Fix WPML table collation
- Set language information

❌ Please make sure that you have a full database and website backup before trying the above ❌

Regards,
Mohamed