-
Bug
-
Resolution: Fixed
-
Minor
-
4.3.4, 4.4
-
5
When on a course, the $PAGE->user_is_editing is called in various places and the way the capabilities are checked are different if it is a full page refresh or a single item refresh (for example a section) leading in a different layout (menu absent) when doing a partial refresh.
This is working fine for teacher who have by default the following capabilities:
- moodle/site:manageblocks
- moodle/course:setcurrentsection
This was revealed by the test created for MDL-81335.
To reproduce:
As admin create new role specialteacher with archetype teacher on course context and remove the following capabilities from the role:
- moodle/site:manageblocks
- moodle/course:setcurrentsection
Then:
- Create a new course with at least two sections and one activity
- Enrol a user with role specialteacher
- Log in as this user and open the course.
- Enable Edit mode.
- Hide a section
- Show a section again
- You will notice that the hamburger menu is missing in the section card
- Reload the page
- You will see that the hamburger menu is back
This is, I believe because in the course/view.php we set the other capabilities and we do not do it in the AJAX/reactive routine.