Home›Support›English Support›[Resolved] I'm using Learndash plugin on my website but the courses are no longer showing
[Resolved] I'm using Learndash plugin on my website but the courses are no longer showing
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.
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.
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)
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 ❌
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!
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
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.