It is perfectly legitimate to create and/or use a method named `define`
in JS outside of RequireJS.
Unfortunately our requirejs.php wrapper is dumb and does not understand
this.
In the long term we need to stop doing this at all. We really should be
able to already, but every time I try to something prevents it.
In the interim, this change adds a secondary check to see if there is an
existing define which _does_ have the right name in it already.
Previously, a set of calculated quiz statistics would only 'last' for
15 minutes. Then they would be considered invalid and not used.
Now, computed statistics are kept indefinitely. Instead, when a new
batch of values are computed for a particular set of settings, older numbers
for the same settings are deleted first. Therefore,
question_stats_cleanup_task is no more.
Recent additions to timezones from the IANA TZDB are not necessarily
reflected in those used by the intl extension and/or ICU zones:
* America/Ciudad_Juarez
* America/Nuuk
* Europe/Kyiv
* Pacific/Kanton
Create mapping to allow these zones to be used without errors.
The apiBase in .well-known/badgeconnect.json was ignored and it was
causing some failures when connecting or sending badges to an
external backpack.
For OBv2.1, it has been changed to always use the apiBase defined
in the badgeconnect.json backpack provider.
Backport of MDL-76722.
Co-authored by: Andrew Lyons <andrew@nicols.co.uk>
The 'enable' field doesn't exist, and this is causing some failures
with MariaDB (and probably with MySQL too).
When the two restore forms for searching courses and categories were
converted to core templates in eb9935c9 they lost the named submit
button, which broke searching.
When an editor is renderer initially invisible to the browser, e.g.
the forum "Add discussion" form, it has a `clientHeight` value of
zero. We can approximate an alternative value based on the number
of rows in the textarea.
Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
It's possible to have some Moodle components soft linked instead
of being real directories within codebase (within dirroot).
For example, Composer's "vendor" directory can be soft linked
(from elsewhere), or also plugins can be installed using soft
links.
In those cases, Moodle calculates the $SCRIPT global as null. And,
then, string operations on it are emitting a PHP deprecation message
with PHP 8.1 and up.
This fix just ensures that the behaviour is the same than before
PHP 8.1, aka: ltrim(null) = '' (empty string), without any PHP warning.
Ensure the same heading tags are available as those defined in the
editor block formats configuration (c51b7e2c).
Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>