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()
Currently cm_info::create allows the 'null' parameter, and
returns null (as a null $cm should still be null when treated
as a cm_info object).
Some unit tests relied on the value 'false' being treated
the same as null in this regard. This seems like a generally
safe assumption (given this is a function about changing
weakly typed data into a stronger type) so I modified the
function to accept anything PHP false, returning null.
* Upgrades existing data so that the groupmembersonly option is
replaced with equivalent data for the new availability API.
* Removes the database field and admin setting used for
groupmembersonly.
* Changes core modinfo library to remove/deprecate groupmembersonly
data and functions.
* Changes other core library files to remove groupmembersonly
references.
Includes deprecation of several functions, listed in lib/upgrade.txt.
Creates two new functions that make it easier to get cm_info
objects (both in modinfolib.php):
get_course_and_cm($cmid) - intended for use e.g. in modules;
efficiently loads $course and $cm (normally saves 1 query).
cm_info::from_mixed($cm) - for use in back-end API where we
are not sure whether a $cm is a real cm_info or a stdClass.
Changes core code to use new API instead of the old one when
checking user access to activities and sections.
Includes changes to other libraries that are necessary after
adding the availability system and removing old conditional tables
etc.