31988 Commits

Author SHA1 Message Date
Andrew Nicols
e6b32722ac
MDL-79638 phpunit: Add unit test for increment resets 2023-10-11 00:10:33 +08:00
Andrew Nicols
9741db47f7
MDL-79638 phpunit: Remove mysql/mariadb hack
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.
2023-10-10 23:35:26 +08:00
Sara Arjona
89d3f66c2f
MDL-79581 communication: Adding missing index to install 2023-10-06 12:18:03 +02:00
Ilya Tregubov
2b4041f93c
Merge branch 'MDL-79586-master' of https://github.com/safatshahin/moodle 2023-10-06 10:25:39 +08:00
Sara Arjona
1bb937140f
Merge branch 'MDL-79600-master' of https://github.com/roland04/moodle 2023-10-05 14:05:22 +02:00
Sara Arjona
563851857f
Merge branch 'MDL-79602-master' of https://github.com/HuongNV13/moodle 2023-10-05 13:03:46 +02:00
Jun Pataleta
9071c03b41
Merge branch 'MDL-79381-master' of https://github.com/HuongNV13/moodle 2023-10-05 18:18:33 +08:00
Mikel Martín
7e3c732d17 MDL-79600 course: Fix courseindex collapseall icon in RTL
- Add new fa-angles-{left|right|down|up} icons to the icon system
- Fix course index collapseall icon in RTL
2023-10-05 11:29:50 +02:00
Andrew Nicols
46f5547308
MDL-79581 communication: Work around inconsistency in DB SET FROM upgrade 2023-10-05 14:05:38 +07:00
Safat
73f342233a MDL-79586 core: Resolve regression of disabled matrix plugin 2023-10-05 16:22:02 +11:00
Huong Nguyen
d0294388d7
MDL-79602 core: Handle empty selection for MoodleNet 2023-10-05 12:10:11 +07:00
Huong Nguyen
0d6204d29c
Merge branch 'MDL-79581-master' of https://github.com/andrewnicols/moodle 2023-10-05 11:37:09 +07:00
Eloy Lafuente (stronk7)
a48504f8fb
MDL-79381 core: MoodleNet PHPUnit with the new controllers
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.
2023-10-05 10:40:33 +07:00
Eloy Lafuente (stronk7)
ace315370f
MDL-79381 core: Refactor MoodleNet controller
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
2023-10-05 10:40:32 +07:00
Andrew Nicols
805ebbb434
Merge branch 'MDL-79276-master' of https://github.com/raortegar/moodle 2023-10-05 08:55:14 +08:00
Andrew Nicols
99c1543aa8
MDL-79581 communication: Context is a mandatory field
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.
2023-10-04 20:37:57 +08:00
Ilya Tregubov
f2ba761bef
Merge branch 'MDL-79157-master' of https://github.com/ferranrecio/moodle 2023-10-04 18:49:19 +08:00
Sara Arjona
9877a06246
Merge branch 'MDL-79551-master-rc' of https://github.com/junpataleta/moodle 2023-10-04 12:28:14 +02:00
Sara Arjona
396fef601b
Merge branch 'MDL-79565' of https://github.com/paulholden/moodle 2023-10-04 11:55:41 +02:00
Ferran Recio
0c6a581f1e MDL-79157 output: fix menu subpanels keyboard navigation 2023-10-04 11:07:45 +02:00
Paul Holden
894b7ef422
MDL-79565 dml: replace hardcoded length SQL with appropriate API.
SQL Server uses `LEN(..)`, meaning we cause a DML exception when
trying to call invalid method.
2023-10-04 09:13:51 +01:00
Jun Pataleta
3d55b4a865
MDL-79551 tiny_html: Remove unnecessary $plugin->release 2023-10-04 14:01:27 +08:00
Jun Pataleta
94bc2cd38b
MDL-79551 versions: bump all versions and requires near release 2023-10-04 13:57:17 +08:00
Huong Nguyen
7ac2a960e9
Merge branch 'MDL-79539-master' of https://github.com/meirzamoodle/moodle 2023-10-04 10:53:57 +07:00
Huong Nguyen
5602cc2488
Merge branch 'MDL-79548-master' of https://github.com/mickhawkins/moodle 2023-10-04 10:21:41 +07:00
Mark Johnson
b0bb97ee3b MDL-79213 groups: Add visibility checks in groups_get_members_join()
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.
2023-10-04 01:24:20 +00:00
David Woloszyn
7679452caf MDL-77846 core: Make endpoint revision number checks stricter
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>
2023-10-04 01:24:19 +00:00
raortegar
789c7c207b MDL-79276 core: Fix output renderer error in the shutdown handler.
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.
2023-10-03 14:14:32 +02:00
Ferran Recio
3f985bf3cf
MDL-79458 output: fix subpanels in classic 2023-10-03 13:32:27 +02:00
Michael Hawkins
83998b9ba9
MDL-79548 core: Update MoodleNet modal strings so they can be translated
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.
2023-10-03 18:52:38 +08:00
Andrew Nicols
be8093e2c7
Merge branch 'MDL-78580_master' of https://github.com/marxjohnson/moodle 2023-10-03 11:05:42 +08:00
Huong Nguyen
4a7259f236
Merge branch 'MDL-79224_master' of https://github.com/marxjohnson/moodle 2023-10-03 09:38:53 +07:00
meirzamoodle
66e8bde8b3 MDL-79539 core: handling negative input to get the upper value
Co-authored-by: Alain Corbière <alain.corbiere@univ-lemans.fr>
2023-10-02 20:51:02 +07:00
Brendan Heywood
08780b449f MDL-79276 core: Auto close streaming elements in shutdown handler 2023-10-02 21:11:44 +10:00
Brendan Heywood
21b5ad1555 MDL-79276 core: Fix perfdebug footer bug in non html pages 2023-10-02 21:11:44 +10:00
Brendan Heywood
79c2e4bdae MDL-79276 core: Fix html validation with streaming api 2023-10-02 21:11:44 +10:00
Mark Johnson
6401ca4959 MDL-79224 core: Make Binary datafilter redisplay selected value
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.
2023-10-02 11:50:44 +01:00
Ilya Tregubov
c80e366051
Merge branch 'MDL-79458-master' of https://github.com/ferranrecio/moodle 2023-10-02 13:30:07 +08:00
Jun Pataleta
7cf8ef39ad
Merge branch 'MDL-79487-do-not-delete-refresh-token-master' of https://github.com/individual-it/moodle 2023-09-29 12:14:25 +08:00
Jun Pataleta
336ec5580a
Merge branch 'MDL-79041-master-2' of https://github.com/HuongNV13/moodle 2023-09-29 11:59:39 +08:00
Sara Arjona
458172696f
Merge branch 'MDL-79511-master' of https://github.com/meirzamoodle/moodle 2023-09-28 16:15:47 +02:00
Artur Neumann
d4709d817e
MDL-79487 oauth2: do not delete refresh token
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`
2023-09-28 15:57:12 +05:45
Ilya Tregubov
12b5c2e952
Merge branch 'MDL-79463' of https://github.com/paulholden/moodle 2023-09-28 16:40:35 +08:00
Stevani Andolo
369fee885f
MDL-78750 communication_matrix: Fixed available providers 2023-09-28 09:13:22 +02:00
Sara Arjona
89eae3a811
Merge branch 'MDL-79350-master' of https://github.com/daledavies/moodle 2023-09-28 07:47:55 +02:00
Huong Nguyen
f61b060182
Merge branch 'MDL-78813-master' of https://github.com/mihailges/moodle 2023-09-28 12:01:25 +07:00
Huong Nguyen
5c131030fd
MDL-79041 core: Fix typo for MoodleNet resource URL 2023-09-28 11:33:00 +07:00
Huong Nguyen
202d57eef7
MDL-79041 core: Fix PHPDoc for prepare_file_share_request_data() 2023-09-28 11:33:00 +07:00
Huong Nguyen
1dda6c86b8
MDL-79041 core: Better handling of the MoodleNet resource URL
- 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
2023-09-28 11:32:59 +07:00
Meirza
0e8cb9c10b MDL-79511 lib: Allow dynamic properties for ADOFieldObject class 2023-09-28 10:15:48 +07:00