This hack was introduced to work around a bug in MySQL 5.6.14 and
MariaDB at the time.
https://bugs.mysql.com/bug.php?id=69882
It was addressed a few months later in 5.6.16, and 5.7.4.
MariaDB merged version 5.6.16 of MySQL's InnoDB engine in MariaDB
10.0.11 and got hte patch from there.
Moodle has required MySQL 8.0, and MariaDB 10.6.7 since Moodle 4.2 and
it is therefore safe to remove these hacks.
Basically the changes imply that:
- For some tests that are using reflection, we need to ensure
that the backup controller is passed.
- And, whenever used explicitly in tests, it has to be destroyed.
(note that this leaves out tests running get_package(), because
that method now instantiates and destroys the controller by itself.
only tests that get a controller need to destroy it).
- Move from some old functions to the new ones introduced in the issue.
Including in this commit:
- Moved the backup controller instantiation out of the constructor
- Created a new get_backup_controller() method to retreive the controller when needed
- Removed some constructor-promoted properties
- Added resourcefilename to resource_packager constructor
- Made resource_packager to abstract class (cannot be instantiated)
- Removed constructor-promoted properties and declare them "normally"
- Backup controller is called and destroyed in get_package() method.
Only PHPUnit tests will need to play with the destroy method because
they use the reflection method
- Made course_partial_packager extend course_packager and removed constructor-promoted properties
- Removed the get_all_task_settings() method and replaced it with get_all_activity_tasks() method
- Fixed bugs related to Partial course sharing
The API was incorrectly assuming that all uses of the API were for a
course, and that the instanceid of the communication instance was a
course id. These assumptions are both entirely wrong.
The API is intended to support a range of uses including use at the
site, user, and activity levels.
Furthermore, if a group were to be used, then the instanceid should be
of that group's id, and therefore the contextid would need to be fetched
or that group's course instead.
The only solution here is to add a new contextid field to the table, and
implement it all parts of the API.
Group visibility was not taken into account when
generating SQL for getting enrolled users restricted
to a list of groups. This may have allowed users to
infer membership of groups they were not allowed to
see members of.
In some places we prevented cache poisoning, in others we did not. We
also did not place any restriction on the minimum value for a revision.
This change introduces a new set of functions for configonly endpoints
which validates the revision numbers passed in. If the revision is
either too old, or too new, it is rejected and the file content is not
cached. The content is still served, but caching headers are not sent,
and any local storage caching is prevented.
The current time is used as the maximum version, with 60 seconds added
to allow for any clock skew between cluster nodes. Previously some
locations used one hour, but there should never be such a large clock
skew on a correctly configured system.
Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
Render the output in shutdown handler was causing
issues in phpunit test_psr_classloader
This is an small fix to check that the output has been started.
Previously, the type of share (course/activity) was being injected into
the string, but not from a translation, so did not fully translate. The
MoodleNet type (resource) was working, but has also been replaced here
to avoid inserting one string into another (this was also unnecessary
while resource is the only possible option). This also meant the latter
string could be deprecated.
The Binary datafilter was returning a single value where all parts of
the API expect an array of values. This was working in most places by
fluke as this value was a single-character string, so doing $value[0]
returned the value. However, it was not working when deciding which
option to mark as selected when re-displaying the filter.
This change makes the filter return an array containing a single integer
value to match the rest of the API, then internally selects that single
value for comparison when deciding if an option should be selected.
when `log_out` is called from `\core\oauth2\client` it will delete the refresh token,
what it actually needs to use it to get a new access token
actually logging out is not needed here, the only thing we need to make sure is,
the invalid access token is removed from the session
that is done by storing `null`
- Switch use PARAM_TEXT instead of PARAM_URL for resource URL
- Added noreferrer to the Go to MoodleNet drafts button, to avoid the risks associated with opening in
_blank without removing access to the referrer and opener