Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lesson: Resetting Multilingual Lesson Versions Causes Data Loss #7563

Open
LluisR opened this issue Mar 26, 2024 · 2 comments
Open

Lesson: Resetting Multilingual Lesson Versions Causes Data Loss #7563

LluisR opened this issue Mar 26, 2024 · 2 comments
Labels
[Status] Needs Triage Issue needs to be triaged [Type] Bug

Comments

@LluisR
Copy link

LluisR commented Mar 26, 2024

Steps to Reproduce

  1. Install Sensei LMS version 4.20.2 or higher.
  2. Create a course with at least one lesson.
  3. Set up PolyLang to manage multiple languages.
  4. Create different pages in multiple languages for a lesson using PolyLang.
  5. Attempt to save or modify a lesson in a language other than the default one.

What I Expected

The other language versions of the lesson should remain intact after saving or modifying the lesson in a specific language.

What Happened Instead

The other language versions of the lesson are reset, and the records of COURSE, MODULE, and PREREQUISITE corresponding to them are deleted from the database when saving or modifying the lesson in a specific language.

PHP / WordPress / Sensei LMS version

PHP version: 7.2
WordPress version: 6.4.3
Sensei LMS version tested: 4.22.0 (NOT WORKING) - 4.20.2 (WORKING)

@LluisR LluisR added [Status] Needs Triage Issue needs to be triaged [Type] Bug labels Mar 26, 2024
@mglucero
Copy link

mglucero commented May 9, 2024

I have the same problem!

PHP version: 8.2.11
WordPress version: 6.5.3
Sensei LMS version: 4.24.0
Polylang version: 3.6.1
Also I'm using the Classic Editor plugin

We had to downgrade to version 4.20.2 of Sensei LMS to avoid this bug.

@merkushin
Copy link
Member

merkushin commented May 20, 2024

Hi @LluisR @mglucero 👋

I tried to test it with WordPress 6.5.3, Sensei LMS 4.24.0, Course 1.3.7, Polylang 3.6.1.

I couldn't reproduce the issue as it is described above.

For me content wasn't deleted, however I noticed a lot of weird behaviour. For example, it tries to assign all lessons to the same course which leads to a mix of lessons from different languages in the Course Outline in the editor (on the frontend I still see only lessons for the default language): #7604

I noticed that the Polylang doesn't allow us to add the language switcher is we use a block theme. There is no Menus under the Appearance.

Could you provide more detailed instructions on how to reproduce the issue? Please consider including additional information if it might affect the result: your theme, whether you use Learning mode or not, how you configured languages and menu, etc.

As a sidenote:

The behaviour could be affected by the changes for better compatibility with WPML (first of them was introduced in 4.21.0). As I noticed in Polylang documentation, they support some WPML APIs, so that might result in undesired behaviour for them.

Next time, when we get more detailed instructions on how to reproduce the issue, it is worth to follow the instructions with the commented out body of the init method in includes/wpml/class-wpml.php to make sure our compatibility code is the source of the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs Triage Issue needs to be triaged [Type] Bug
Projects
None yet
Development

No branches or pull requests

3 participants