This is commented out because auto-hidden toasts currently call `hide()`
and trigger the `bs.toast.hide` event immediately, and _then_ apply the
autohide delay.
Since we automatically add M.util.pending_js calls when we _start_ to
hide, and resolve them when the hide _finishes_, this means that we do:
- addToast called
- trigger `bs.toast.show` event
- add to pending_js
- [pending_js queue not empty - behat waits]
- message is shown in UI
- `hide()` called
- trigger `bs.toast.hide` event
- add to pending_js
- [pending_js queue not empty - behat waits]
- start autohide delay
- [pending_js queue not empty - behat waits]
- [pending_js queue not empty - behat waits]
- [pending_js queue not empty - behat waits]
- [pending_js queue not empty - behat waits]
- end autohide delay
- remove message (no longer present in DOM)
- trigger `bs.toast.hidden` event
- resolve pending_js
- [pending_js queue empty - behat stops waiting]
- Behat runs next step: And I should see "1 enrolled users"
-- Step fails beacuse the message has been shown, and has then been removed
The conversation should have been:
- addToast called
- trigger `bs.toast.show` event
- add to pending_js
- [pending_js queue not empty - behat waits]
- message is shown in UI
- start autohide delay
- trigger `bs.toast.shown` event
- resolve pending_js
- [pending_js queue empty - behat stops waiting]
- Behat runs next step: And I should see "1 enrolled users"
-- Step passes
- autohide delay ends and calls `hide()`
- trigger bs.toast.hide event
- add to pending_js
- [behat waits]
- end autohide delay
- remove message (no longer present in DOM)
- trigger `bs.toast.hidden` event
- resolve pending_js
- [pending_js queue empty - behat stops waiting]
- Behat run continues
See MDL-67386 for futher information.
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.
Some blocks (e.g. Calendar) load additional JS modules when returning
content. We need to make sure they aren't asked to generate content
unless the user can actually view the block, or the expected content
required by the JS will not exist in the DOM and can cause exceptions.
- Add MDL codes to @deprecated.
- Add @todo tag for future 4.3 phase 2 deprecation.
- Deprecate global scope functions:
- cron_execute_plugin_type().
- cron_bc_hack_plugin_functions().
(moving them to deprecatelib).
- Document it in main upgrade.txt