* If a plugin defines a `filtericon` custom data or uses its monologo
version of the icon, a `filtericon` parameter is being added to the
icon's URL. This information can help plugins determine whether to
render the activity icon as is or with CSS filtering.
This change puts back the behaviour that get_fast_modinfo will accept
a cached version of modinfo that is newer than expected (according to
the course cacherev).
Not accepting newer versions can lead to poor performance in cases
where multiple requests take place at once, or using a clustered
database.
For a long time, Moodle has had the feature to force the language
for a whole course. This change adds the same feature at activity
level.
The course-level feature was controlled by a capability
moodle/course:setforcedlanguage, and I decided to use the same
capability to control this feature. I think a new capability would be
overkill.
This fixes lots of stuff like outdated or incomplete PHPdoc comments
or test heler functions where the arguments don't have their types
declared.
A few more significant fixes, like places were a silly method
was used to get a context which was readily available.
When updating/deleting a section/module, the system now only
invalidate of the element (section/module), not the whole course cache
Also, the system now only recalculate the cache for element (section/module)
if necessary, not the whole course cache
Move module/section purging to course_modinfo:
+ course_modinfo::purge_course_section_cache_by_id was created to purge section by id
+ course_modinfo::purge_course_section_cache_by_number was created to purge section by number
+ course_modinfo::purge_course_module_cache was created to purge module
These recursive calls didn't work in PHP 7.3 and below, but in PHP
7.4 they also cause a fatal error which means if you have invalid
availability data, the whole page might die.
Allow modules to apply format_text() on user input before calling cm_info::set_content(). This is useful for
modules that add interactive content (for example, JS enhanced folder tree). Otherwise all javascript would
be removed if $CFG->forceclean is enabled.
In a busy site it is possible that one user will access the site
while another is building modinfo cache. This can result in the
cache being built several times at once, potentially causing a
performance issue.
Add field 'visibleoncoursepage' to the course_modules table
Add site-wide setting for turning on stealth mode availability
Add callback for "stealth" mode support in the course formats
Change display of modules/sections availability on the course page
Created a flag, 'deletioninprogress' on the course_modules table to be
used when deleting course modules and course sections. Modified
modinfolib caches such that, when rebuilt, these caches hide the
relevant modules based on the value of the flag.
Final deprecation of the following methods:
- course_modinfo::build_section_cache()
- cm_info::get_deprecated_group_members_only()
- cm_info::is_user_access_restricted_by_group()
Plus throw coding exception for direct calls of the following:
- cm_info::get_url()
- cm_info::get_content()
- cm_info::get_extra_classes()
- cm_info::get_on_click()
- cm_info::get_custom_data()
- cm_info::get_after_link()
- cm_info::get_after_edit_icons()
- cm_info::obtain_dynamic_data()