Skip to content

1.5

Choose a tag to compare

@brettvac brettvac released this 17 Jul 18:48
· 2 commits to main since this release
df86a74

-Completely refactored the class usage within the Helper file to resolve fatal application errors. The previous version incorrectly attempted to statically call methods on CourseHelper and LessonHelper classes that did not exist in the TF Learn component's backend structure. This was corrected by properly importing the actual Course and Lesson classes.
-Updated the module's core logic in the Helper file to properly instantiate the Course and Lesson objects. Instead of calling static methods, the code now correctly initializes these objects by passing the necessary configuration arrays (such as the course ID, user ID, and module ID) into their constructors before successfully calling the is_enrolled() and get_lessons() instance methods.
-Overhauled the frontend template file to fix multiple fatal crashes occurring during page rendering. Removed outdated Helper suffixes from the Completion, Course, and Lesson class namespace imports, and newly imported the Restriction class, which is the actual class responsible for handling content access rules in the parent component.
-Replaced all improper static method calls within the template's HTML output loops. The code now dynamically instantiates the Restriction, Lesson, and Completion objects with the correct contextual data (user ID, course ID, and lesson ID) on each iteration. This allows the template to accurately check module restrictions, retrieve lesson content pages, and display the user's lesson completion status icons without triggering undefined method errors.
-Added a corrected French language translation string fixing a previous translation error and improving the frontend experience for French-speaking users.