Commit graph

3738 commits

Author SHA1 Message Date
Andrew Nicols
e734858e55
MDL-79890 core: Session handlers must implement SessionHandlerInterface 2023-11-15 09:14:40 +08:00
Andrew Nicols
898ac0ab6d
MDL-79890 core: ReflectionProperties::setValue() should take 2 args
Since PHP 8.3 setValue() must be called with null as the first arg if
called statically.
2023-11-15 09:14:34 +08:00
Andrew Nicols
dde3333eaa
MDL-80079 core: Correct incorrect arg to format_text::$options 2023-11-14 22:28:55 +08:00
Andrew Nicols
dab4a2b66f
MDL-80079 core: Correct incorrect arg to format_string::$options 2023-11-14 22:28:55 +08:00
Paul Holden
58d9babe56
MDL-79629 javascript: native promises enhancing autocomplete module.
Preserve existing `enhance` method return of jQuery style promises to
allow calling code to continue relying on that (e.g. when calling old
style `.done` and `.fail`).

Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2023-11-08 20:05:35 +00:00
Ilya Tregubov
4df21a5ad8
Merge branch 'MDL-79615_master' of https://github.com/marxjohnson/moodle 2023-11-08 10:42:10 +08:00
Huong Nguyen
36677cd883 Merge branch 'MDL-79739-master' of https://github.com/andrewnicols/moodle 2023-11-08 09:23:37 +07:00
Laurent David
bef0cb7a34 MDL-77274 core_renderer: Respect full name format in letter avatars
* Make sure that we respect the fullnamedisplay and alternativefullnameformat
parameters to decide on the initials for a given user
* Add further tests

Co-authored-by: Tatsunori Uchino <tats.u@live.jp>
2023-10-30 06:14:18 +01:00
Mark Johnson
f3fc03e90c MDL-79615 course: Improve efficency of cache rebuilds
When bulk-updating course module visibility, set_coursemodule_visibily
was triggering a partial cache purge and rebuild for each course module.
This potentially led to 2 cache sets each requiring a lock to be
acquired and released per course module, plus any other cache updates
for other changes to the course in the same request.

This adds a new $rebuildcache paramter to the
set_coursemodule_visibilty, which is true by default to retain the
existing behaviour. If set false, it will skip doing the partial purge
and rebuild for that course module, and it is up to the calling code to
ensure the cache is updated as requried.

To assist with this, there is a new
course_modinfo::purge_course_module_cache_multiple() method, which
allows multiple course modules to be purged from the cache in a single
cache set.
2023-10-27 10:50:40 +01:00
Andrew Nicols
06965b823e
MDL-79739 core: Only run some tests in separate processes 2023-10-17 12:18:37 +08:00
Huong Nguyen
5209baef9e Merge branch 'MDL-79698-master' of https://github.com/andrewnicols/moodle 2023-10-16 11:39:39 +07:00
Andrew Nicols
9942c14856
MDL-79698 core: Correct duplicate array key in test provider 2023-10-13 15:43:47 +08:00
Paul Holden
dc01be8c54
MDL-79611 group: early exit getting members of non-existing group. 2023-10-09 15:00:14 +01: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
Huong Nguyen
d0294388d7
MDL-79602 core: Handle empty selection for MoodleNet 2023-10-05 12:10:11 +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
Ilya Tregubov
f2ba761bef
Merge branch 'MDL-79157-master' of https://github.com/ferranrecio/moodle 2023-10-04 18:49:19 +08:00
Ferran Recio
0c6a581f1e MDL-79157 output: fix menu subpanels keyboard navigation 2023-10-04 11:07:45 +02: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
Jun Pataleta
336ec5580a
Merge branch 'MDL-79041-master-2' of https://github.com/HuongNV13/moodle 2023-09-29 11:59:39 +08: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
Ilya Tregubov
98d07e8514
Merge branch 'MDL-79285' of https://github.com/stronk7/moodle 2023-09-28 10:20:12 +08:00
Ilya Tregubov
78cbb2204d
Merge branch 'MDL-79360/403' of https://github.com/skodak/moodle 2023-09-28 09:37:34 +08:00
Eloy Lafuente (stronk7)
8ef2974af1
MDL-79285 xhprof: Cover the new functions with unit tests
This covers the 2 new functions with unit tests:
- xhprof_topo_sort()
- reduce_run_data()

Note that the example graph used in the provider is the
one shown in the issue to explain the reduction procedure.
2023-09-26 19:39:47 +02:00
Sara Arjona
cc9430929d
MDL-77708 docs: Update references from docs.moodle.org/dev 2023-09-26 10:30:19 +02:00
Jun Pataleta
e2f900b2ad
Merge branch 'MDL-79323-master-enfix' of https://github.com/vmdef/moodle 2023-09-21 15:29:40 +02:00
Ilya Tregubov
e25dd12c5c
Merge branch 'MDL-79341' of https://github.com/paulholden/moodle 2023-09-21 14:50:28 +08:00
Víctor Déniz
0b838f6977 MDL-79323 lang: Fix Behat tests regressions after merging en_fix strings 2023-09-19 13:42:10 +01:00
Jake Dallimore
1b768a1f64
Merge branch 'MDL-79186' of https://github.com/paulholden/moodle 2023-09-19 11:12:24 +08:00
Ilya Tregubov
7d6129be45
Merge branch 'MDL-79338' of https://github.com/skodak/moodle 2023-09-19 10:40:54 +08:00
Ilya Tregubov
553567e16c
MDL-78955 lib: Fix unit test. 2023-09-18 14:47:24 +08:00
Ilya Tregubov
826ef1f915
Merge branch 'MDL-79336' of https://github.com/skodak/moodle 2023-09-18 11:12:22 +08:00
Petr Skoda
f35b2d1cb3 MDL-79360 filter: fix nolink tag regression from MDL-77525 2023-09-15 12:44:09 +02:00
Huong Nguyen
632e603304
Merge branch 'MDL-78728' of https://github.com/paulholden/moodle 2023-09-15 16:19:27 +08:00
Jun Pataleta
62a91c861c
Merge branch 'MDL-78467-master' of https://github.com/sammarshallou/moodle 2023-09-15 16:19:26 +08:00
Ilya Tregubov
8f8ea5a4d1
Merge branch 'MDL-78312-master' of https://github.com/NashTechOpenUniversity/moodle 2023-09-15 16:19:04 +08:00
Petr Skoda
f94ad6f65f MDL-79338 core: add primary navigation hook tests 2023-09-14 11:51:21 +02:00
Petr Skoda
f42cc76a78 MDL-79336 core: add core\hook\stoppable_trait 2023-09-14 11:33:01 +02:00
sam marshall
0f8577784d MDL-78467 core_cache: Improve cache locking API
* Makes it possible to safely call acquire_lock so that it throws an
  exception instead of returning false if it can't get a lock (which
  most existing uses assumed it already does).
* Fix some omissions from the requirelockingbeforewrite option (it
  now checks on delete).
* Modinfo uses a versioned cache, so it is not necessary to delete
  items, only increase the version. (Provided we keep track of
  cacherev carefully...)
2023-09-14 09:28:10 +01:00
Huong Nguyen
4ead50e696
MDL-78267 core: Partial course sharing for MoodleNet 2023-09-14 14:59:50 +07:00
Huong Nguyen
514df5a775
MDL-78267 core: Services for partial sharing course to MoodleNet 2023-09-14 14:59:49 +07:00
Huong Nguyen
c6bf02a3b5
MDL-78267 core: Backend API for partial sharing course for MoodleNet 2023-09-14 14:59:49 +07:00
hieuvu
a3da58a9cb MDL-78312 core_user: add an 'exact match only' option 2023-09-13 20:22:22 +07:00
Paul Holden
40776c8956
MDL-79341 core: more robust testing of user-agent curl response.
The external test file URL concerns itself only with HTTP_USER_AGENT
matching, not sending response headers, which can differ according to
HTTP protocol in use by the endpoint (1.1 vs 2).

Given the returned response code itself is irrelevant to the testcase,
there's not much benefit to asserting it and risking random failures.
2023-09-13 13:30:52 +01:00
Jun Pataleta
f8b16ea91f
Merge branch 'MDL-78826-master' of https://github.com/roland04/moodle 2023-09-13 19:28:25 +08:00
Huong Nguyen
d3efd69dc1
Merge branch 'MDL-78993-master' of https://github.com/sarjona/moodle 2023-09-13 11:21:36 +07:00
Huong Nguyen
50a74f6a2d
Merge branch 'MDL-67271-master' of https://github.com/sarjona/moodle 2023-09-13 11:15:22 +07:00
Huong Nguyen
8527d6e8c9
Merge branch 'MDL-75502-master' of https://github.com/davewoloszyn/moodle 2023-09-13 10:52:36 +07:00