-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.5.6
-
None
-
MOODLE_405_STABLE
We're upgrading one of our custom plugins to 4.5 and noticed that sectionRefreshed custom JS event (core_course:sectionRefreshed) is not triggered anymore when the section visibility is changed on the course page.
Looks like dispatching sectionRefreshed event is missing in _reloadSection
https://github.com/moodle/moodle/blob/main/course/format/amd/src/local/content.js#L662
In our case our custom plugin adds extra HTML bits to the section. JS code looks like following
document.querySelector(SELECTORS.PAGE).addEventListener(CourseEvents.sectionRefreshed, (event) => {
|
if (event.detail.newSectionElement !== undefined) { |
event.detail.newSectionElement.querySelectorAll(SELECTORS.ACTIVITY_CHOOSER).forEach(element => {
|
initAddBentoBoxLink(element);
|
});
|
}
|
});
|
This works ok in Moodle 4.1