sensei
sensei copied to clipboard
Admin user adding modules to a teacher course through the "legacy ways" don't fix the module slug
If an admin user tries to add modules through legacy ways (course meta box, or wp-admin/edit-tags.php?taxonomy=module) to a teacher course, it doesn't add the teacher prefix to the slug, which can cause some future issues.
Steps to Reproduce
- Log-in as admin.
- Create a teacher.
- Create a course and remove the blocks.
- Add the teacher to the course.
- Save, and refresh the page.
- Add some new modules through the meta box.
- Save the course.
- Notice that the modules don't appear with the teacher name (it means it doesn't have the correct slug - with the teacher ID as prefix).
What I Expected
To have the correct slug.
What Happened Instead
The slug is as an admin module.
Sensei LMS version
3.8.1
Context / Source
p1614946201006700-slack-C6GGX896G
Issue related to https://github.com/Automattic/sensei/issues/3813
Some methods for reference:
Sensei_Core_Modules::add_new_module_termSensei_Course_Structure::save_module
I created it as Low priority since it has not a clear bug that can be caused through this. And if we refactor the architecture of the modules, we can close this.