Problem/Motivation
It has been identified that when two courses share the same lesson, the lesson ID of the most recently registered course prevails. As a result, when accessing either of the courses and clicking on the shared lesson, the user is always redirected to the lesson in the most recently updated course, causing incorrect behavior in cases where lessons are shared between courses.
Steps to reproduce
1. Create two courses in the system.
2. Add the same shared lesson to both courses.
3. Try accessing the lesson in both courses.
4. Notice that when you access the lesson in either course, the user is redirected to the lesson from the most recently registered course.
Proposed resolution
The issue was identified in the file `docroot/modules/contrib/anu_lms/src/Lesson.php`, within the `getLessonModule()` method. The proposed solution is to adjust the logic to allow more than one `$module_ids` to be associated, preventing only the most recently registered course ID from prevailing.
Remaining tasks
- Adjust the code in the `getLessonModule()` method to support multiple `$module_ids`.
- Test the solution to ensure that shared lessons between courses correctly redirect to the appropriate course.
- Update documentation if needed.
User interface changes
No user interface changes are required.
API changes
No API changes are required.
Data model changes
No data model changes are required.