There were basically two problems, which are demostrated by
the new test users u7 and u8 in the unit test.
1. There was a problem if a role was overridden in a context above the
one where it was assigned. E.g. User has teacher role in a course, and
there is a role override in the course-category context. That was being
ignored.
2. Problems with the handling of PROHIBITs. It should be the case that
if there is a PROHIBIT in force, then it cannot be overridden by another
role, or by a role override. However, this was not working in all cases.
Also, I had to add comments to the unit test so that I could understand
it. Hopefully these will be hepful to other developers too.
Now when enrol_get_my_courses(), enrol_get_users_courses() and
enrol_get_all_users_courses() methods automatically reflect the
navsortmycoursessort setting by default, we do not need to manually
compose the sorting any more.
Similarly to what the previous patch does, we now change the default
sorting in functions enrol_get_users_courses() and
enrol_get_all_users_courses() too.
The patch also adds missing phpDocs for the functions, improves the
readability of some existing bits and mentions the changes in the
enrol/upgrade.txt file.
The new default value (null) now respects the navsortmycoursessort
behaviour and should be consistently used whenever we are displaying the
courses in the UI.
Only course tools are backed up, site tools and registrations
can be matched by id if they are restored to the same site only.
For predefined course tools the secret is backed up encrypted
and can be restored on the same site only.
All these functions were used only by deleted upgrade steps
so it's safe to proceed with straight deletion, considering
them internal. Deletion has been documented in corresponding
upgrade.txt files:
- mod_feedback_upgrade_delete_duplicate_values()
- mod_feedback_upgrade_courseid()
These have been kept because they continue being used:
- @ install: make_competence_scale()
- @ restore: upgrade_course_letter_boundary()
LTS (3.5) requires previous LTS (3.1)
This just deletes all the upgrade steps previous to 3.1.0. Some
small adjustments, like adding missing MOODLE_INTERNAL or tweaking
globals can also be applied when needed.
Also includes an upgrade step to prevent upgrading from any
version < 2016052300 (v3.1.0) as anti-cheating measure.
Next commit will get rid of/deprecate all the upgradelib functions
not used anymore in codebase.