This class would belong more appropriately within the 'user' API
(core_user) instead of within the 'core' API, since it is
directly related to user data.
Since the class has only just been added to Moodle, now is a good
time to move it.
In all cases changes have been kept to a minimum while not making
the code completely horrible. For example, there are many instances
where it would probably be better to rewrite a query entirely, but
I have not done that (in order to reduce the risk of changes).
This change rewrites the way in which expiry is calculated and addresses
a number of closely related issues:
Users can customise, and add blocks with data to, their dashboard. When
a user had done so, the user could be flagged for deletion, but the
blocks in their Dashboard were subject to the default block retention
policy. In addition there is no way to override the retention policy for
user blocks.
This change modifies the structure of the expiry mechanism:
- to consider any subcontext of the user context to be a part of the user
context during calculation. User child contexts are not the property
of the system, and should not be treated separately.
- the way in which the context expiry mechanism worked was to select
use a multiple different managers based solely on the context level.
Because of the use of user blocks, this proved to be unreliable as
blocks has been attributed purely to courses.
This has been changed to a single manager which is aware of hierarchy
and deletions as a whole.
- to prepare for upcoming work relating to more detailed expiry
mechanisms, a new expiry_info class is introduced and used to
merge the expiry of child contexts into a working in-memory view.
This changeset includes extensive unit tests.
* Allow the setting of data registry defaults for activity modules.
* Rewrite the defaults page so that it uses templates.
* Use a tabbed layout for the defaults page that shows the default
category and purpose per context level.
* New API and web service functions that enables the setting of the
defaults.
This commit is composed of different issues, most of them under
MDL-61306:
- MDL-61888, MDL-61785, MDL-61830, MDL-61874, MDL-59720,
MDL-61486, MDL-61697, MDL-61798, MDL-61685, MDL-61682,
MDL-61684, MDL-61618, MDL-61681, MDL-61680, MDL-61487,
MDL-61499, MDL-61500, MDL-61362 and MDL-59718
Contributions to this patch by:
- Jun Pataleta
- David Monllao
- Andrew Nicols
- Adrian B. Greeve
- Jake Dallimore
- Sara Arjona