Created the participants_search unit testing file, including
tests for role, keywords, status and enroment method filtering.
Co-authored-by: Michael Hawkins <michaelh@moodle.com>
These function updates are in preparation for the participants_search
class, which will be used to support multiple values per filter when
filtering the participants page.
With the templaterev issue resolved we should enable the prefetch module
when cachejs is enabled to avoid a different experience when cachejs is
enabled vs. disabled.
Previously there was little point in doing this due to a range of other
bugs (string normalisation, and misuse of templaterev).
With these issues resolved we should enabel the caching.
The M.cfg.templaterev variable should only be used to present persistent
caching, not caching of content within the same page load.
Preventing caching of same-page content makes it difficult to develop
for real user experiences as content is slow to load and does not give a
realistic and consistent loading experience.
This change affects the loading of partials specifically which notably
includes the loading spinner. Without this patch the loading icon is
often not seen at all because it does not load in a timely fashion and
the content being loaded is loaded first.
Identically to what we've added to the module generators, let's raise a
coding exception if generating a block or a repository triggers the
theme and output initialisation.
Applying filters on an activity module description when using it as a
new calendar event's description is bad m'kay? We need to store the raw
text and apply the filters only when we actually display the text. That
way, filters (such as multi-language content) may actually fully work
and we do not initialise the theme and output machinery.
Additionally, we need to explicitly set the format of the description
text to HTML (because we have converted it to it already). Otherwise it
defaults to the current user's preferred editor format.
This is still a pragmatic hot-fix solution. The proper solution would be
to pass the raw text, format and embedded files.
The coding exception hint should say it all. Creating an activity module
should not need any output function call. It turned out it can lead to
hard-to-debug bugs and unexpected behaviour. So better to explicitly
fail and let the developer fix the code.