Compare commits

..

300 Commits

Author SHA1 Message Date
Mihail Geshoski 8445cad014 Moodle release 4.4.10 2025-08-08 10:48:40 +08:00
Sara Arjona 0dc00ed6e9 weekly release 4.4.9+ 2025-08-07 16:45:21 +02:00
Sara Arjona 53a794538a Merge branch 'install_404_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_404_STABLE 2025-08-07 16:45:19 +02:00
Ilya Tregubov 36ded6f300 MDL-63395 user: Fix profile visibility check.
It needs to be done in user_get_user_details as well.
2025-08-07 10:30:45 +07:00
Jun Pataleta 2be167a172 Merge branch 'MDL-85674-404' of https://github.com/lameze/moodle into MOODLE_404_STABLE 2025-08-07 10:44:03 +08:00
AMOS bot 065b6436c2 Automatically generated installer lang files 2025-08-07 00:07:52 +00:00
ferran 1d914c1937 Merge branch 'MDL-86176-404' of https://github.com/sarjona/moodle into MOODLE_404_STABLE 2025-08-06 16:22:01 +02:00
Sara Arjona c5a878de43 MDL-86176 badges: Adjust badges due to Canvas Credentials changes
This change addresses necessary adjustments to how OBV2.0 badges are
sent to backpacks, specifically to ensure compatibility and correct
functionality following recent updates to Canvas Credentials' conditions.

It ensures our badge integration continues to operate smoothly despite
these external changes.
2025-08-06 15:08:00 +02:00
Simey Lameze 292a559fd7 MDL-85674 behat: replace multiple steps by a single table step 2025-08-06 18:37:23 +08:00
andelacruz 3569920982 MDL-85674 mod_grade: Behat test for multiple questions manual grading 2025-08-06 17:42:21 +08:00
Huong Nguyen 2217677c96 MDL-84464 report_log: Fix EOF 2025-08-06 10:39:19 +07:00
Laurent David 0a75e8e4cf MDL-84464 report_loglive: Hide report for teacher without groups 2025-08-06 10:22:44 +07:00
Laurent David 7a6315e676 MDL-84464 report_log: Hide report for teachers without groups
* Teachers without groups in SEPARATEGROUP mode should not see the report log page nor access it
2025-08-06 10:22:44 +07:00
Laurent David 27b30703b4 MDL-84463 mod_feedback: Fix behat test
* Fix typo in test description
* Use the right step to edit questions
2025-08-05 03:41:17 +00:00
Laurent David cfc476a722 MDL-84463 mod_feedback: Fix users in no group and email
* Non editing teachers in no group should not receive feedback emails
from students in no group
2025-08-05 03:41:17 +00:00
Laurent David 093512285f MDL-84463 mod_feedback: Fix show entries and nonrespondents
* Non editing teachers not in a groups should not see entries
from other users
2025-08-05 03:41:17 +00:00
raortegar 424f20e225 MDL-85704 mod_bigbluebuttonbn: Update sesskey handling for compatibility 2025-08-05 03:41:17 +00:00
Mihail Geshoski 8e2a748167 Merge branch 'MDL-85565_404' of https://github.com/PhilippImhof/moodle into MOODLE_404_STABLE 2025-08-05 11:34:21 +08:00
Sara Arjona 8ce2a2fe73 weekly release 4.4.9+ 2025-07-31 16:08:47 +02:00
Sara Arjona 753335e5fe Merge branch 'install_404_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_404_STABLE 2025-07-31 16:08:43 +02:00
Michael Hawkins cb36a45ce2 Merge branch 'MDL-85362-404' of https://github.com/HuongNV13/moodle into MOODLE_404_STABLE 2025-07-31 14:39:58 +08:00
Huong Nguyen e8870b1975 Merge branch 'MDL-84485-Select-webservice-in-wstoken-behat-breadcrumb-404' of https://github.com/farhan6318/moodle into MOODLE_404_STABLE 2025-07-31 10:17:58 +07:00
AMOS bot af12e1f3c6 Automatically generated installer lang files 2025-07-31 00:07:58 +00:00
Mihail Geshoski cbc91748b4 Merge branch 'MDL-86113-404' of https://github.com/snake/moodle into MOODLE_404_STABLE 2025-07-30 23:28:53 +08:00
Farhan Karmali 3a6e2c8f26 MDL-84485 webservice: Add Behat step for mobile web service selection 2025-07-29 16:07:05 +05:30
AMOS bot d8e559dcbe Automatically generated installer lang files 2025-07-28 13:16:54 +00:00
Philipp Imhof e4c6d0b498 MDL-85565 phpunit: check for <select> before <option>
Make sure that assert_select_options() will fail when the output does
not contain a <select> and therefore does not have the given options.
2025-07-25 13:13:52 +02:00
Jake Dallimore cfe8f40e94 MDL-86113 mod_lti: skip slow network calls during tests
This check exists to determine whether a given tool URL is a cartridge,
specifically when the URL does not end in .xml. It hits the URL to
determine this. In tests, we have many mock tool URLs, which won't
resolve, and running this code causes large hangs and random failures.
Any tests covering cartridge support still work fine, provided they
continue to use URLs ending in .xml; this change only skips the check
during tests for other non-xml URLs.
2025-07-25 16:50:49 +08:00
Michael Hawkins 4ad38cc139 weekly release 4.4.9+ 2025-07-25 12:14:47 +08:00
Huong Nguyen c9978cffbb Merge branch 'MDL-86049-404' of https://github.com/andrewnicols/moodle into MOODLE_404_STABLE 2025-07-24 09:47:59 +07:00
Huong Nguyen 32b8996a09 MDL-85362 core: Define environment requirements for Moodle 5.1 2025-07-22 10:54:24 +07:00
Andrew Nicols 1cfd9eec4f MDL-86049 core: Do not use the component cache before purge
When trying to resolve a corrupt cache where it is not possible to
complete the Moodle setup/bootstrap, it is necessary to ignore the
current cache to load the cache purging infrastructure.
2025-07-21 12:25:26 +08:00
Mihail Geshoski 4f0592f963 weekly release 4.4.9+ 2025-07-18 14:52:58 +08:00
Mihail Geshoski c9336ff7dc Merge branch 'install_404_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_404_STABLE 2025-07-18 14:52:54 +08:00
Mihail Geshoski c66e293747 Merge branch 'MDL-85055-404' of https://github.com/lameze/moodle into MOODLE_404_STABLE 2025-07-17 12:14:24 +08:00
Paul Holden 140ee4b80d MDL-85055 task: correct use of DI provided frozen Clock API.
Fixes some of the usage introduced in tests as part of a35335a9.
2025-07-17 11:57:37 +08:00
Huong Nguyen e3ac7a574c Merge branch 'MDL-86016-404' of https://github.com/andrewnicols/moodle into MOODLE_404_STABLE 2025-07-15 09:56:47 +07:00
Andrew Nicols 1111c96ac0 MDL-86016 core: Remove xmldb test in favour of unit test 2025-07-15 09:33:12 +08:00
Andrew Nicols 44d7ffeb89 MDL-86016 tests: Make install.xml test less restrictive 2025-07-15 09:33:12 +08:00
AMOS bot 3fa85e6828 Automatically generated installer lang files 2025-07-12 00:07:49 +00:00
Michael Hawkins 4ea8645494 weekly release 4.4.9+ 2025-07-11 12:49:36 +08:00
Mihail Geshoski d6b06d0cef Merge branch 'MDL-85689-404' of https://github.com/andelacruz/moodle into MOODLE_404_STABLE 2025-07-10 11:38:16 +08:00
andelacruz efee10f43e MDL-85689 mod_quiz: Behat for adding and deleting page from quiz 2025-07-09 13:36:35 +08:00
Huong Nguyen 1b2f009da2 Merge branch 'MDL-85697-404' of https://github.com/andelacruz/moodle into MOODLE_404_STABLE 2025-07-09 09:11:00 +07:00
Huong Nguyen 51c1ca0248 Merge branch 'MDL-85947-M404_bump-GHA-ubuntu-24-04' of https://github.com/ziegenberg/moodle into MOODLE_404_STABLE 2025-07-08 17:35:18 +07:00
andelacruz 41ee4a6cad MDL-85697 mod_lesson: Behat for lesson group and user overrides 2025-07-08 17:12:43 +08:00
andelacruz 85e642bec1 MDL-85697 mod_assign: Behat for assignment group and user overrides 2025-07-08 17:09:53 +08:00
andelacruz 0a25a24ff6 MDL-85697 mod_quiz: Behat for quiz group and user overrides 2025-07-08 17:09:52 +08:00
Daniel Ziegenberg 5583a50bae MDL-85947 ci: Bump GHA to Ubuntu 24.04
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2025-07-07 16:17:02 +02:00
Mihail Geshoski 82fb415b69 weekly release 4.4.9+ 2025-07-06 09:30:58 +08:00
Mihail Geshoski b7b20e7381 Merge branch 'install_404_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_404_STABLE 2025-07-06 09:30:54 +08:00
Mihail Geshoski 0effcbe6b5 Merge branch 'MDL-85563-m404' of https://github.com/NeillM/moodle into MOODLE_404_STABLE 2025-07-03 11:09:05 +08:00
Mihail Geshoski cffd2be100 Merge branch 'patch/MDL-85666-404' of https://github.com/skodak/moodle into MOODLE_404_STABLE 2025-07-03 09:53:37 +08:00
Petr Skoda 8270a62377 MDL-85666 phpunit: add general plugin tests
This defines new group which can be used
to limit execution of these tests to one plugin only.

For example to execute all tests for Label module use:

phpunit --testsuite=mod_label_testsuite
phpunit --group=plugin_checks --filter=mod_label

or

phpunit --filter=mod_label
2025-07-02 07:11:49 +02:00
AMOS bot ce5a9b2800 Automatically generated installer lang files 2025-07-02 00:09:49 +00:00
Neill Magill 73f101e862 MDL-85563 phpunit: Clock API should always use Moodle system time
When using `clock::now()` the frozen cloxk and incrementing clock will now
always return a `DateTimeImmutable` that uses the configured Moodle system
time. In unit tests this will be Australia/Perth.

Before this change, it would sometimes be UCT.
2025-06-30 11:44:54 +01:00
Huong Nguyen 1761d94638 weekly release 4.4.9+ 2025-06-29 16:18:57 +07:00
Huong Nguyen d7a8c72b8f Merge branch 'install_404_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_404_STABLE 2025-06-29 16:18:55 +07:00
Mihail Geshoski 1ca9ebb3cb Merge branch 'MDL-85665-404' of https://github.com/andelacruz/moodle into MOODLE_404_STABLE 2025-06-26 10:43:04 +08:00
andelacruz af4a6daacc MDL-85665 mod_quiz: Behat to build quiz in single activity format course 2025-06-24 18:06:01 +08:00
AMOS bot 12d7c64dc7 Automatically generated installer lang files 2025-06-15 00:09:48 +00:00
Mihail Geshoski 541f1569af weekly release 4.4.9+ 2025-06-13 14:43:50 +08:00
Huong Nguyen 8bbc166cb4 MDL-85316 dml: Revert DB vendor changes 2025-06-12 17:11:37 +07:00
Huong Nguyen d26badab50 Merge branch 'MDL-85316-404-mysql-version' of https://github.com/meirzamoodle/moodle into MOODLE_404_STABLE 2025-06-11 13:34:00 +07:00
meirzamoodle 823d1b25ea MDL-85316 admin: Add environment check for AWS Aurora database 2025-06-11 10:45:33 +07:00
Mihail Geshoski 662befa64e Moodle release 4.4.9 2025-06-06 12:26:06 +08:00
Sara Arjona ff135b2d86 weekly release 4.4.8+ 2025-06-05 16:43:43 +02:00
Michael Hawkins a7d8f4d1d9 MDL-83762 core_files: Bind resolve IPs and ports to cURL calls 2025-06-05 12:10:09 +07:00
Vincent Schneider 006b2a2642 MDL-84518 course: improved course visibility state handling 2025-06-05 11:23:01 +07:00
Mark Johnson 0c5b52e6ac MDL-85323 core: Don't cache the login page 2025-06-05 11:01:57 +07:00
meirzamoodle 169827cf80 MDL-85375 libraries: Escaping a query parameter on pg_insert_id() 2025-06-02 09:55:42 +07:00
Vincent Schneider f591916893 MDL-84706 bigbluebuttonbn: improved authorization and mitigate CSRF risks 2025-05-30 08:41:27 +00:00
Huong Nguyen 6dcb54ced7 MDL-79993 course: Fix PHPUnit failure 2025-05-30 08:41:27 +00:00
raortegar f105122cef MDL-79993 course: Improve user access to recent courses service 2025-05-30 08:41:27 +00:00
Vincent Schneider 0d4a8ce45d MDL-84497 badges: fix missing action sesskey checks. 2025-05-30 08:41:27 +00:00
Michael Hawkins 000b0c2771 weekly release 4.4.8+ 2025-05-30 16:29:34 +08:00
Michael Hawkins 7afa525ff3 Merge branch 'install_404_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_404_STABLE 2025-05-30 16:29:29 +08:00
Huong Nguyen a29b5364ab Merge branch 'MDL-85525-404' of https://github.com/andelacruz/moodle into MOODLE_404_STABLE 2025-05-29 09:52:00 +07:00
Huong Nguyen fbe62c9538 Merge branch 'MDL-85400-404' of https://github.com/lameze/moodle into MOODLE_404_STABLE 2025-05-29 09:00:03 +07:00
Huong Nguyen 8523e47075 Merge branch 'MDL-85389-404' of https://github.com/andelacruz/moodle into MOODLE_404_STABLE 2025-05-29 08:52:58 +07:00
AMOS bot 575932b2ec Automatically generated installer lang files 2025-05-29 00:07:51 +00:00
andelacruz 627945e854 MDL-85525 mod_quiz: Behat test for quiz attempt page block display 2025-05-28 16:45:02 +08:00
andelacruz 2617f75596 MDL-85389 mod_lesson: Behat for filtering lesson reports/essays by group 2025-05-28 15:21:00 +08:00
sam marshall 730e1d0ae0 MDL-85400 PHPunit: Hard to test code that uses encryption
This change stops the encryption code setting created key files to
read-only during PHPunit runs, which means they will be safely
deleted when the system resets after a test.
2025-05-28 13:04:14 +08:00
ferran 7d02e08ef9 Merge branch 'MDL-84304-404' of https://github.com/laurentdavid/moodle into MOODLE_404_STABLE 2025-05-26 13:50:21 +02:00
Huong Nguyen 2ca0fb4886 weekly release 4.4.8+ 2025-05-23 11:04:00 +07:00
Huong Nguyen 78f545b165 Merge branch 'install_404_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_404_STABLE 2025-05-23 11:03:59 +07:00
Huong Nguyen 9e4cdf9eca Merge branch 'MDL-84793-m404' of https://github.com/sammarshallou/moodle into MOODLE_404_STABLE 2025-05-22 10:48:46 +07:00
Huong Nguyen be65ecd3e1 Merge branch 'MDL-84918-404' of https://github.com/HuongNV13/moodle into MOODLE_404_STABLE 2025-05-22 10:34:51 +07:00
David Woloszyn f597c8bc2d MDL-84918 core: Add zend.exception_ignore_args environment check 2025-05-22 10:11:39 +07:00
Huong Nguyen 2e541fe5b0 MDL-84918 core: Add initial environment requirements for Moodle 5.1 2025-05-22 10:11:39 +07:00
Huong Nguyen 83cc825626 Merge branch 'MDL-85374-404' of https://github.com/andrewnicols/moodle into MOODLE_404_STABLE 2025-05-21 09:56:20 +07:00
AMOS bot cd27ce2970 Automatically generated installer lang files 2025-05-21 00:07:48 +00:00
Andrew Nicols e5bbbe000d MDL-85374 report_competency: Create custom step for setting autocomplete
The autocompletes used in the competency report have been bastardised to
redirect on selection. Unfortunately this also applies when when making
null-op changes like deleting the initial "Please select a value"
option.

The autocomplete code removes all current options before creating an
option, and because of this redirect the browser is redirecting before
the new value can be entered, but we retain a reference to the field as
`$this->field`, which is now stale.
2025-05-20 12:42:26 +08:00
Laurent David 7b1bff7cca MDL-84304 core_courseformat: Remove COMPLETION_COMPLETE_FAIL test
* Because we removed this status in mod_scorm, we cannot test it
anymore against any module as no module has custom_rules that leads
to COMPLETION_COMPLETE_FAIL
2025-05-19 11:56:51 +02:00
Laurent David 75de28348a MDL-84304 mod_scorm: Remove completion failed from behat test
* Now that we removed the COMPLETION_COMPLETE_FAIL status for scorm
behat tests needs to be updated
2025-05-19 11:56:51 +02:00
Magnus Samuelsson 598fee8ec7 MDL-84304 mod_scorm: Remove the COMPLETION_COMPLETE_FAIL status 2025-05-19 11:56:51 +02:00
Mihail Geshoski e968dc4629 weekly release 4.4.8+ 2025-05-16 12:59:13 +08:00
Mihail Geshoski 170b3ea2ab Merge branch 'install_404_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_404_STABLE 2025-05-16 12:59:03 +08:00
sam marshall 3d17b48855 MDL-84793 Behat: Allow CLI scripts to run on Behat instance 2025-05-15 08:51:05 +01:00
Huong Nguyen 0bc7bd66b2 Merge branch 'MDL-85279-404' of https://github.com/andelacruz/moodle into MOODLE_404_STABLE 2025-05-15 11:42:58 +07:00
andelacruz 08ea67a272 MDL-85279 mod_assign: Renamed behat test to a more specific name 2025-05-14 15:14:03 +08:00
andelacruz 4d50167046 MDL-85279 mod_page: Fix behat to match the expected behaviour 2025-05-14 15:13:04 +08:00
Sara Arjona 333aabfaea Merge branch 'MDL-85248-404' of https://github.com/albertgasset/moodle into MOODLE_404_STABLE 2025-05-12 15:49:05 +02:00
AMOS bot f28de0cb41 Automatically generated installer lang files 2025-05-10 00:07:51 +00:00
Huong Nguyen 7e75a3680e weekly release 4.4.8+ 2025-05-09 09:50:31 +07:00
Huong Nguyen d75311461f Merge branch 'install_404_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_404_STABLE 2025-05-09 09:50:29 +07:00
Huong Nguyen 14467d84fb Merge branch 'MDL-84654-404' of https://github.com/andelacruz/moodle into MOODLE_404_STABLE 2025-05-08 08:44:42 +07:00
AMOS bot 897649d9a0 Automatically generated installer lang files 2025-05-07 00:07:45 +00:00
Angelia Dela Cruz 3edbc2c282 MDL-84654 mod_assign: Assignment additional files can be hidden 2025-05-06 13:12:06 +08:00
Huong Nguyen d39da752c6 Merge branch 'MDL-85310-404' of https://github.com/andelacruz/moodle into MOODLE_404_STABLE 2025-05-06 10:32:25 +07:00
Huong Nguyen 29381e8a0d weekly release 4.4.8+ 2025-05-02 09:16:28 +07:00
Huong Nguyen 1bd8f959e1 Merge branch 'install_404_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_404_STABLE 2025-05-02 09:16:27 +07:00
AMOS bot ebeeb9cef8 Automatically generated installer lang files 2025-05-01 00:07:52 +00:00
Angelia Dela Cruz 9071c67a2c MDL-85310 qtype: Renamed duplicate scenario names to fix warning 2025-04-30 13:35:43 +08:00
Huong Nguyen 32b8197ad0 Merge branch 'MDL-84421-404' of https://github.com/andrewnicols/moodle into MOODLE_404_STABLE 2025-04-25 09:10:36 +07:00
AMOS bot e7b223c14d Automatically generated installer lang files 2025-04-23 00:07:50 +00:00
Albert Gasset 027b1a9efe MDL-85248 qtype_ddimageortext: Revert MDL-66584
This reverts commit 701e76e301.
2025-04-22 16:58:26 +02:00
AMOS bot 8254bc5d09 Automatically generated installer lang files 2025-04-20 00:08:13 +00:00
AMOS bot 630ae866bf Automatically generated installer lang files 2025-04-19 00:07:49 +00:00
AMOS bot a3323b7d28 Automatically generated installer lang files 2025-04-18 00:07:51 +00:00
Sara Arjona 77fed64613 weekly release 4.4.8+ 2025-04-17 14:30:09 +02:00
Huong Nguyen ac0ae250f0 Merge branch 'MDL-84298-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2025-04-17 10:54:19 +07:00
Huong Nguyen bb10627261 Merge branch 'MDL-84625-M404_close-recordset-in-core_analytics-model-add_prediction_ids' of https://github.com/ziegenberg/moodle into MOODLE_404_STABLE 2025-04-17 10:28:26 +07:00
Huong Nguyen 1dbedf59ae Merge branch '83713-javascript-error-xml-grades-import-404' of https://github.com/DSI-Universite-Rennes2/moodle into MOODLE_404_STABLE 2025-04-17 10:12:33 +07:00
Huong Nguyen 03226fa1be Merge branch 'MDL-84232-404-avoid_recover_quiz_grades' of https://github.com/drobayo/moodle into MOODLE_404_STABLE 2025-04-17 08:39:46 +07:00
Julien Boulen 9ade94e0ea MDL-83713 form: Fix javascript selector on file picker
Co-authored-by: Meirza <meirza.arson@moodle.com>
2025-04-16 16:46:38 +02:00
Sara Arjona 9843d8a9ef Merge branch 'MDL-84820-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2025-04-16 15:24:45 +02:00
Amaia Anabitarte 3d27fbc77d MDL-85170 mod_choice: Remove the unnecessary ul closing tag 2025-04-16 15:12:37 +02:00
Sara Arjona 788900f048 Merge branch 'MDL-82132-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2025-04-16 14:55:15 +02:00
Huong Nguyen 274cb0f8b2 Merge branch 'MDL-83195-releaseanongradev2-404' of https://github.com/leonstr/moodle into MOODLE_404_STABLE 2025-04-16 09:40:16 +07:00
Paul Holden a54bdf4ade MDL-82132 user: less restrictive returning first/lastname details.
The `viewfullnames` capability check was overeager in restricting
the inclusion of user first and lastname properties in the returned
structure. Especially given that the same data was almost always
present in the fullname property of the same structure.
2025-04-15 16:00:52 +01:00
Paul Holden 3df91d98f4 MDL-82132 user: re-factor code for generating dummy user fullname. 2025-04-15 16:00:52 +01:00
Sara Arjona e54e923b55 Merge branch 'MDL-84149-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2025-04-15 16:45:08 +02:00
Sara Arjona 0dc8cfc9d4 Merge branch 'MDL-84140-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2025-04-15 16:31:25 +02:00
Sara Arjona da164d9dba Merge branch 'MDL-83990-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2025-04-15 16:18:21 +02:00
Sara Arjona fcfd4b3fc3 Merge branch 'MDL-83537-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2025-04-15 16:09:34 +02:00
Jun Pataleta b59cceeeb8 Merge branch 'MDL-83979-url-always-proxy-MOODLE_404_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_404_STABLE 2025-04-15 20:43:43 +08:00
Sara Arjona d6ed761e7f Merge branch 'MDL-55034-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2025-04-15 13:37:04 +02:00
Sara Arjona 47cb26cde1 Merge branch 'MDL-78381-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2025-04-15 11:37:01 +02:00
Sara Arjona a66e710e22 Merge branch 'MDL-80337-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2025-04-15 11:30:41 +02:00
Sara Arjona ad4887bdf1 Merge branch 'MDL-62230-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2025-04-14 18:57:11 +02:00
Sara Arjona ab5cb82442 Merge branch 'MDL-81454-404' of https://github.com/daniil-berg/moodle into MOODLE_404_STABLE 2025-04-14 18:46:34 +02:00
Sara Arjona cf7a9dd5fc Merge branch 'MDL-83550-404' of https://github.com/andrewgos/moodle into MOODLE_404_STABLE 2025-04-14 17:54:31 +02:00
Sara Arjona c2b06a60bf Merge branch 'MDL-78886-404' of https://github.com/mwehr/moodle into MOODLE_404_STABLE 2025-04-14 17:50:27 +02:00
Sara Arjona 0d78fef21c Merge branch 'MDL-66584-404' of https://github.com/danghieu1407/moodle into MOODLE_404_STABLE 2025-04-14 17:47:46 +02:00
Wehr Mario bd938712f4 MDL-78886 assignfeedback_editpdf: Fix broken next page button in PDFView
Credits go to Cédric Gerbault cdgerbault@gmail.com for providing the fix.
2025-04-14 17:41:24 +02:00
Sara Arjona 27615c8cc6 Merge branch 'MDL-84833-404' of https://github.com/ferranrecio/moodle into MOODLE_404_STABLE 2025-04-14 17:11:17 +02:00
Sara Arjona 30d23e5353 Merge branch 'MDL-79464-404' of https://github.com/mihailges/moodle into MOODLE_404_STABLE 2025-04-14 17:08:36 +02:00
Daniel Ziegenberg 24d1f24175 MDL-84625 analytics: close recordset when it's not needed anymore
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2025-04-14 10:02:11 +02:00
Jun Pataleta f22eed6b67 Moodle release 4.4.8 2025-04-13 09:52:59 +08:00
Huong Nguyen a969e35ef5 weekly release 4.4.7+ 2025-04-11 22:02:21 +07:00
Sara Arjona 43a0e4d96d MDL-83994 course: Adapt PHPUnit to lower PHP versions 2025-04-11 19:25:19 +08:00
Huong Nguyen b6cf3a1851 MDL-72704 message: Fix fetching for user has already contacted 2025-04-11 17:46:36 +08:00
Sara Arjona dd0b40c2ae Merge branch 'MDL-85139-404-2' of https://github.com/junpataleta/moodle into MOODLE_404_STABLE 2025-04-11 07:05:19 +02:00
Paul Holden c9c6dbebd6 MDL-84865 cohort: improve system report validation of parameters. 2025-04-11 12:46:48 +08:00
Jun Pataleta 13440d2edd MDL-72704 message: Additional optimisation tweaks
* Return early if the `userids` params is empty or if the filtered
user IDs end up being empty.
2025-04-11 12:18:58 +08:00
Stevani Andolo 866d5c02f3 MDL-72704 message: Fix fetching of conversation member info 2025-04-11 12:18:58 +08:00
raortegar d834f8698f MDL-85104 lib: Add additional check to local URLs params. 2025-04-11 10:22:17 +07:00
James C 72d54c6b1e MDL-83994 course: Respect course_can_delete_section() in AJAX 2025-04-11 13:05:56 +10:00
Paul Holden f113ecfba7 MDL-84473 repository_equella: safer unserializing of file references. 2025-04-11 09:52:05 +07:00
Paul Holden dffd193de5 MDL-84475 repository_dropbox: safer unserializing of file references. 2025-04-11 09:33:58 +07:00
Jun Pataleta a2be2e3067 MDL-85139 forms: Revert the addition of element IDs in group containers
This reverts the changes to core/element-group by MDL-61823 as it is
causing duplicate ID issues.
2025-04-11 10:12:25 +08:00
Alec Gullon c7d7c5a8c8 MDL-79464 mod_assign: Limit user navigation if grading fails validation 2025-04-10 16:27:52 +08:00
Michael Hawkins cb2690ca4e MDL-85152 filter_tex: Update deny list and slash handling 2025-04-10 14:21:00 +08:00
Paul Holden af704fe2b3 MDL-84478 tool_brickfield: verify sesskey prior to course analysis. 2025-04-10 13:06:58 +08:00
Paul Holden 4332522a7d MDL-84499 block_rss_client: user access checks for viewing feed. 2025-04-10 12:32:37 +08:00
Paul Holden cae8d49d99 MDL-65356 mod_data: update entry editing/deletion to not leak sesskey. 2025-04-10 10:07:53 +07:00
Paul Holden 320700db21 MDL-84750 course: require user be able to view course participants. 2025-04-10 09:29:58 +08:00
David Woloszyn d48c418aa0 MDL-84351 tool_mfa: Fix guidance page file access
File uploaded to the guidance page were not accessible due to
null values being provided to $course and $cm params for the
tool_mfa_pluginfile.
2025-04-09 16:50:47 +07:00
raortegar efd335ca90 MDL-84351 tool_mfa: Fix access to guide page when MFA login 2025-04-09 16:50:47 +07:00
David Woloszyn 588be50d53 MDL-84351 tool_mfa: Check URL against allowed components for redirect 2025-04-09 16:50:47 +07:00
David Woloszyn 52731101f6 MDL-84351 url: Add method for getting slashargument 2025-04-09 16:50:47 +07:00
Daniil Fajnberg 3b05390d62 MDL-81454 core: Remove incorrect @property-read annotation 2025-04-09 09:01:32 +02:00
Brendan Heywood a5242728c2 MDL-83979 repository_url: Always use the proxy for url downloads 2025-04-09 14:45:35 +10:00
Paul Holden ad5b72e696 MDL-84479 tool_usertours: verify sesskey prior to tour duplication. 2025-04-08 15:11:20 +00:00
Michael Hawkins a0ff17c66d MDL-85015 tool_mfa: Include extra param in email factor cancel check 2025-04-08 15:11:20 +00:00
David Woloszyn cf7fe7a547 MDL-84784 tool_mfa: Remove enrol/index.php from no redirect 2025-04-08 15:11:20 +00:00
Sara Arjona 3101137de3 weekly release 4.4.7+ 2025-04-08 17:05:49 +02:00
Sara Arjona 1c95a3a4da Merge branch 'install_404_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_404_STABLE 2025-04-08 17:05:48 +02:00
Jun Pataleta 39ce93c3b6 Merge branch 'MDL-84058-404' of https://github.com/meirzamoodle/moodle into MOODLE_404_STABLE 2025-04-08 10:07:16 +08:00
AMOS bot e8ae5de91b Automatically generated installer lang files 2025-04-08 00:07:46 +00:00
meirzamoodle 401a716147 MDL-84058 cli: Add a backup check for course module names
Co-authored-by: Jun Pataleta <jun@moodle.com>
2025-04-08 06:30:17 +07:00
Huong Nguyen d92296b89e Merge branch 'MDL-84970-404' of https://github.com/andrewnicols/moodle into MOODLE_404_STABLE 2025-04-07 10:02:14 +07:00
Jun Pataleta ede19c68df Merge branch 'MDL-85112-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2025-04-05 12:27:30 +08:00
Paul Holden a53ce235a8 MDL-85112 message: correct use of class to hide element content. 2025-04-04 17:08:18 +01:00
Huong Nguyen 30fed30e65 weekly release 4.4.7+ 2025-04-04 22:20:15 +07:00
Jun Pataleta 3cc3825f63 Merge branch 'MDL-84816-404' of https://github.com/meirzamoodle/moodle into MOODLE_404_STABLE 2025-04-04 12:37:20 +08:00
meirzamoodle e8eb81f399 MDL-84816 message: Make sure the 'see all' link stays visible 2025-04-04 11:27:35 +07:00
Huong Nguyen 1d21f959b4 Merge branch 'MDL-84997-404' of https://github.com/davewoloszyn/moodle into MOODLE_404_STABLE 2025-04-04 11:15:19 +07:00
Jun Pataleta 67107816a0 Merge branch 'MDL-84907-404' of https://github.com/HuongNV13/moodle into MOODLE_404_STABLE 2025-04-04 11:30:27 +08:00
Jun Pataleta 8f974b5e0e Merge branch 'MDL-84914-404-enfix' of https://github.com/mudrd8mz/moodle into MOODLE_404_STABLE 2025-04-04 09:47:24 +08:00
Shamim Rezaie 7cd120d902 Merge branch 'MDL-61823-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2025-04-04 09:08:43 +11:00
Paul Holden 2a0c01bb1a MDL-61823 question: exclude file element from grouped elements hack.
This removes the duplicated label, that was being matched by the
previously wide selector to make grouped element labels visible.
2025-04-03 15:36:32 +01:00
Paul Holden aaf84bc0cf MDL-61823 forms: ensure grouped elements have ID attribute.
This is used by the forms implementation for faux-label elements
so that when they are clicked on, the first input element of the
corresponding group is focused.
2025-04-03 14:52:11 +01:00
Jun Pataleta 09daa6585f MDL-75971 core: Remove unnecessary whitespace 2025-04-03 14:53:15 +08:00
Jun Pataleta 67dbbc95bd Merge branch 'MDL-75971-404' of https://github.com/lameze/moodle into MOODLE_404_STABLE 2025-04-03 14:36:47 +08:00
Simey Lameze f3eedaaf2a MDL-75971 behat: add email handling capabilities to Behat 2025-04-03 14:00:25 +08:00
Jun Pataleta 5d3fac792c Merge branch 'MDL-84823-404' of https://github.com/meirzamoodle/moodle into MOODLE_404_STABLE 2025-04-03 12:14:39 +08:00
meirzamoodle 516fed31e5 MDL-84823 message: Fix ARIA attributes in popovers and messaging drawers
> ARIA Expanded
A disclosure is a widget that allows content to be
collapsed (hidden) or expanded (visible). It has two elements:
1. Disclosure button, and
2. Section of content whose visibility is controlled by the button.

ARIA Expanded must be applied to the disclosure button element
or the element with role="button" rather than the content.

> ARIA label
Move the icon title and aria-label as they are not
interactive elements to the toggle element.
The title attribute is helpful for the tooltip,
and the aria-label benefits the screen reader.
2025-04-03 11:09:58 +07:00
Huong Nguyen 46cb497bae Merge branch 'MDL-85023_404' of https://github.com/PhilippImhof/moodle into MOODLE_404_STABLE 2025-04-03 11:08:04 +07:00
Shamim Rezaie 66c560de3d Merge branch 'MDL-61730-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2025-04-03 06:54:02 +11:00
Shamim Rezaie faea71c0aa Merge branch 'MDL-85000-404' of https://github.com/HuongNV13/moodle into MOODLE_404_STABLE 2025-04-03 06:13:45 +11:00
Shamim Rezaie 2e48537ee5 Merge branch 'MDL-72050-404' of https://github.com/sh-csg/moodle into MOODLE_404_STABLE 2025-04-03 00:38:35 +11:00
Shamim Rezaie d273c20427 Merge branch 'MDL-84961-404' of https://github.com/odeialba/moodle into MOODLE_404_STABLE 2025-04-02 20:55:01 +11:00
Shamim Rezaie 376c41e841 Merge branch 'MDL-80629-404' of https://github.com/andrewnicols/moodle into MOODLE_404_STABLE 2025-04-02 20:02:15 +11:00
Andrew Nicols 59f556e731 MDL-84970 editor_tiny: Use the langpack name for Moodle language 2025-04-02 16:06:22 +08:00
Paul Holden ccd7a6b9a6 MDL-61730 gradeimport_xml: set type on form iprestriction field. 2025-04-02 08:57:21 +01:00
David Mudrák 143fbe18f7 MDL-84914 lang: Use fixed strings in tests, too 2025-04-01 22:20:40 +02:00
Helen Foster a444834a5b MDL-84914 lang: Import fixed English strings (en_fix) 2025-04-01 22:20:09 +02:00
Sara Arjona 1b5e5e3c65 weekly release 4.4.7+ 2025-04-01 16:34:27 +02:00
Mihail Geshoski 1c8cc2b543 MDL-80091 mod_assign: Fix failing behat test 2025-04-01 11:34:16 +02:00
Philipp Imhof 659b50f380 MDL-85023 quiz: allow WebRTC with SEB on Mac 2025-04-01 06:52:57 +02:00
Huong Nguyen 77b6cf7568 Merge branch 'MDL-84419-404' of https://github.com/clransom/moodle into MOODLE_404_STABLE 2025-04-01 11:07:17 +07:00
Huong Nguyen 0b4c755b34 Merge branch 'MDL-83856-404' of https://github.com/andrewgos/moodle into MOODLE_404_STABLE 2025-04-01 10:48:16 +07:00
Huong Nguyen 04eb9c0b61 Merge branch 'MDL-80091-404' of https://github.com/andrewgos/moodle into MOODLE_404_STABLE 2025-04-01 10:41:51 +07:00
Paul Holden 21419b94bd MDL-55034 blog: update external blog deletion to not leak sesskey. 2025-03-31 14:04:19 +01:00
ferran 021965fd55 MDL-84833 course: completion feedback messages 2025-03-31 09:39:49 +02:00
Jun Pataleta 6685d750e7 Merge branch 'MDL-84826-404' of https://github.com/meirzamoodle/moodle into MOODLE_404_STABLE 2025-03-31 14:28:27 +08:00
Andrew Nicols 830fca4a77 Merge branch 'MDL-76801-404' of https://github.com/andrewgos/moodle into MOODLE_404_STABLE 2025-03-31 09:39:29 +08:00
Sara Arjona cdf702bea3 weekly release 4.4.7+ 2025-03-28 12:48:25 +01:00
Sara Arjona 6fb8b72782 Merge branch 'install_404_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_404_STABLE 2025-03-28 12:48:23 +01:00
Paul Holden 2e571156f9 MDL-85048 core: define mapping for new America/Coyhaique zone.
Follows same process as other timezone additions in d5ec3594.
2025-03-28 08:58:43 +00:00
Huong Nguyen 59547c9e26 Merge branch 'MDL-85048-404' of https://github.com/lameze/moodle into MOODLE_404_STABLE 2025-03-28 15:01:11 +07:00
Simey Lameze dba907c5a1 MDL-85048 phpunit: add america/coyhaique timezone 2025-03-28 15:00:16 +08:00
David Woloszyn b09ace0546 MDL-84997 core_message: Hide message pill when count is zero 2025-03-28 16:49:23 +11:00
Huong Nguyen 360812e77b Merge branch 'MDL-84952-404' of https://github.com/roland04/moodle into MOODLE_404_STABLE 2025-03-28 08:52:28 +07:00
AMOS bot 3f0fa1eb14 Automatically generated installer lang files 2025-03-28 00:08:40 +00:00
Paul Holden 1f859c16ea MDL-84140 course: more resilient check for activity footer component. 2025-03-27 08:33:02 +00:00
Mikel Martín a575fe46db MDL-84952 theme_boost: Fix spacing for collapse/expand buttons 2025-03-26 15:41:57 +01:00
Huong Nguyen f0d535b65c Merge branch 'MDL-85001-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2025-03-26 10:54:01 +07:00
Jake Dallimore 0dee8a90e3 Merge branch 'MDL-85007-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2025-03-26 11:32:26 +08:00
Huong Nguyen 0733ed3db1 Merge branch 'MDL-83272_404_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_404_STABLE 2025-03-26 10:27:40 +07:00
Huong Nguyen 32547c0496 Merge branch 'MDL-84623-M404_close-recordset-in-tool_dataprivacy-expired_contexts_manager-clear_old_records' of https://github.com/ziegenberg/moodle into MOODLE_404_STABLE 2025-03-26 10:23:54 +07:00
Huong Nguyen 39111a7bc7 MDL-85000 media_videojs: Enable Ogv.JS Tech for all browsers 2025-03-26 09:34:03 +07:00
Huong Nguyen a05d3938f8 weekly release 4.4.7+ 2025-03-26 08:56:04 +07:00
Huong Nguyen a7f6daff5b Merge branch 'install_404_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_404_STABLE 2025-03-26 08:56:03 +07:00
Paul Holden 90b4e8b85c MDL-85007 core: ensure events are dispatched against the same table.
This ensures that we always dispatch the dynamic table updated event
against the same table we just updated. Previously it was possible
for another table to receive the event, where both tables were
effectively the same instance of one another (e.g. custom reports).
2025-03-25 17:02:31 +00:00
meirzamoodle 8c6b8ed7ea MDL-84826 theme_boost: Mantaining hover/focus colour for contrast 2025-03-25 22:55:32 +07:00
Dagoberto Robayo 1390809635 MDL-84232 mod_quiz: Avoid recover grades in quiz view page
- If Recover grades default is not enabled, quiz grades should not be recover.
2025-03-25 09:16:26 -05:00
Paul Holden 43a62d768c MDL-85001 reportbuilder: ensure report uniqueness in filters loader.
Where the same report exists multiple times on the page, ensure we
are still able to uniquely identify each via ID. Update the filters
module to ensure the filters form for each report is initialised.
2025-03-25 11:43:48 +00:00
danghieu1407 701e76e301 MDL-66584 qtype_ddimageortext: Move JSON data to data-attribute 2025-03-25 16:37:37 +07:00
Andrew Nicols 0b88080611 Merge branch 'MDL-84893-404' of https://github.com/davewoloszyn/moodle into MOODLE_404_STABLE 2025-03-25 11:07:04 +08:00
Andrew Nicols a8f6fad781 Merge branch 'MDL-84112-MOODLE_404_STABLE-fix_bigbluebutton_defaultcompletion_performance' of https://github.com/praxisdigital/moodle into MOODLE_404_STABLE 2025-03-25 10:55:57 +08:00
Andrew Nicols 6bef9d816c Merge branch 'MDL-84335_404' of https://github.com/PhilippImhof/moodle into MOODLE_404_STABLE 2025-03-25 10:52:58 +08:00
Andrew Nicols c328216c75 Merge branch 'MDL-76668-404' of https://github.com/cameron1729/moodle into MOODLE_404_STABLE 2025-03-25 10:38:55 +08:00
Philipp Imhof 566dc85f06 MDL-84335 question: check for null before accessing property
in function check_hint_file_access
2025-03-24 17:44:39 +01:00
Odei Alba a7c7fda91a MDL-84961 core: Avoid loading the hidden table under the chart
Remove the table from under the chart when it is disabled, instead of just hiding it.
2025-03-24 17:14:50 +01:00
Huong Nguyen 16b78d03a7 Merge branch 'MDL-83160-404' of https://github.com/mickhawkins/moodle into MOODLE_404_STABLE 2025-03-24 14:54:40 +07:00
AMOS bot 3eb7553ab5 Automatically generated installer lang files 2025-03-22 00:07:49 +00:00
Huong Nguyen 5ef6bc0d7a weekly release 4.4.7+ 2025-03-21 22:02:47 +07:00
Huong Nguyen 08abd7ea3b Merge branch 'install_404_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_404_STABLE 2025-03-21 22:02:46 +07:00
Mark Johnson 7742681329 MDL-83272 qbank_managecategories: Fix exclusion of current category
The "currentcat" parameter contains the categoryid, but is being
compared to a string like "contextid,categoryid" so was not being
matched correctly to exclude the current category from the list of
options.
2025-03-21 11:40:31 +00:00
Glenn Poder 3f8d704ee4 MDL-76668 navigation: Fix navigation for results in single activity 2025-03-21 13:51:45 +08:00
Andrew Nicols f53120985a MDL-80629 env: Moodle 4.4.x and 4.5.x do not support PHP 8.4 2025-03-21 13:18:56 +08:00
Huong Nguyen ae03be74b6 Merge branch 'MDL-84446-404' of https://github.com/andrewnicols/moodle into MOODLE_404_STABLE 2025-03-21 11:18:08 +07:00
Huong Nguyen 431605b0ba Merge branch 'MDL-84867-404' of https://github.com/roland04/moodle into MOODLE_404_STABLE 2025-03-21 09:06:09 +07:00
AMOS bot 63e52a69c2 Automatically generated installer lang files 2025-03-21 00:07:49 +00:00
Andrew Nicols 473018cb53 Merge branch 'MDL-84803-404' of https://github.com/aanabit/moodle into MOODLE_404_STABLE 2025-03-21 07:57:43 +08:00
Paul Holden e837d357b1 MDL-84149 gradereport_grader: better support for collapse preferences.
The privacy provider is now resilient against missing courses, and also
supports retrieving preferences from multiple courses for the user.
2025-03-20 15:47:45 +00:00
Paul Holden f47253d387 Merge branch 'MDL-81655_404' of https://github.com/larsbonczek/moodle into MOODLE_404_STABLE 2025-03-20 15:14:26 +00:00
Amaia Anabitarte ba1f355fd5 MDL-84803 mod_feedback: Make titles unique 2025-03-20 16:09:27 +01:00
Paul Holden 3a44e5126f MDL-84538 lang: remove duplicated badge language string. 2025-03-20 15:05:26 +00:00
Paul Holden 1b11ed787b Merge branch 'MDL-84538-M404_fix-duplicated-language-strings' of https://github.com/ziegenberg/moodle into MOODLE_404_STABLE 2025-03-20 14:45:02 +00:00
Daniel Ziegenberg 2fda6af72f MDL-84538 language: Remove duplicated lang string entries
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2025-03-20 14:01:44 +01:00
Mikel Martín 239b833d99 MDL-84867 tool_behat: Improve SCSS deprecation failure information
- Improve SCSS deprecated-styles @mixin to receive a paramenter of the
  deprecated selector.
- Update all the current deprecated styles that are using deprecated-styles @mixin
  to include the deprecated selector as parameter.
- Improve the 'look_for_deprecated_styles' behat function.
2025-03-20 11:04:03 +01:00
Sara Arjona 15f176eb3d Merge branch 'MDL-84683-MOODLE_404_STABLE' of https://github.com/jfederico/moodle into MOODLE_404_STABLE 2025-03-19 16:19:36 +01:00
Paul Holden 7895aca40a MDL-84820 moodlenet: correct activity modal icon size/alignment. 2025-03-19 10:26:02 +00:00
Jun Pataleta 9f7839ba0b Merge branch 'MDL-84905-404' of https://github.com/HuongNV13/moodle into MOODLE_404_STABLE 2025-03-19 13:18:16 +08:00
David Woloszyn 710db6f11a MDL-84893 core_message: Fix message drawer overlap and truncation 2025-03-19 13:58:15 +11:00
Huong Nguyen ea1350cbe0 Merge branch 'MDL-84431-404' of https://github.com/andrewgos/moodle into MOODLE_404_STABLE 2025-03-19 09:55:30 +07:00
Huong Nguyen 1a9a5d1cbe MDL-84907 backup: Fix invalid CTRL characters regex 2025-03-19 09:22:54 +07:00
Huong Nguyen 8553c27e57 MDL-84905 Behat: Fix I set the following administration settings failure 2025-03-19 09:17:26 +07:00
Sara Arjona a18c3ad13a weekly release 4.4.7+ 2025-03-18 14:17:44 +01:00
Andrew Gosali 6cc2d8e5db MDL-83856 gradingform_guide: fix remark format to always be FORMAT_HTML 2025-03-18 16:31:04 +07:00
Anders Rasmussen 7b17ee7fb9 MDL-84112 bigbluebuttonbn: Added user output only if bbactivity is set 2025-03-18 10:15:44 +01:00
Andrew Gosali 3feecc5bb8 MDL-80091 assign grade: select the first user when changing filter
(if the previously selected user is no longer in the filtered list)
2025-03-18 15:23:15 +07:00
Andrew Nicols 64dbf8d6c8 Merge branch 'MDL-84222-404' of https://github.com/HuongNV13/moodle into MOODLE_404_STABLE 2025-03-18 08:04:52 +08:00
Huong Nguyen 7c9fc3fb34 Merge branch 'MDL-83591-404' of https://github.com/andrewgos/moodle into MOODLE_404_STABLE 2025-03-17 16:00:46 +07:00
Andrew Gosali 500a225afc MDL-83550 gradingform_rubric: fix submit no grade when remark disabled 2025-03-17 14:50:31 +07:00
Andrew Gosali e8054b547a MDL-83591 grade: fix issue when item is already deleted
The deleted grade is causing the error while using its id that was previously saved in the session variable
2025-03-17 10:47:39 +07:00
Paul Holden 9ab9d973c7 MDL-80337 availability: more robust checking for plugin class presence.
Co-authored-by: Dustin Brisebois <dustin.brisebois@lambdasolutions.net>
2025-03-16 19:27:37 +00:00
Daniel Ziegenberg ce2a687c2b MDL-84623 privacy: close recordset when it's not needed anymore
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2025-03-16 19:54:14 +01:00
Paul Holden 22b0195c6d MDL-83990 course: ensure course start/end dates set in external call. 2025-03-13 17:53:52 +00:00
Paul Holden 5ec7fa94c5 MDL-83537 check: confirm presence of instance action link. 2025-03-13 17:52:47 +00:00
Michael Hawkins 9186e7e0ec MDL-83160 core: Update security.txt expiry 2025-03-13 20:35:55 +08:00
Stefan Hanauska a4c7cb3241 MDL-72050 question: Delete import draftfiles immediately 2025-03-13 08:17:43 +01:00
Stefan Hanauska 7d00d01b66 MDL-72050 filelib: Add function for deleting draftarea 2025-03-13 08:17:43 +01:00
Paul Holden e34037ea6a MDL-78381 course: observe default "showactivitydates" in external call. 2025-03-11 17:33:29 +00:00
Andrew Gosali 2b5ba79954 MDL-76801 mod_assign: grader ux fixes on "requires grading"
- refresh list when the user is graded hence no longer in the list
- hide the CTA buttons when no user is selected
2025-03-07 15:59:22 +08:00
Paul Holden f19403ea2f MDL-62230 mod_feedback: define exporter format for name/presentation. 2025-03-04 14:13:08 +00:00
Huong Nguyen 3d314d6d4b MDL-84222 lib: PHPMailer - Renew the expired token
This patch includes:
 - Get a new token if it is not available.
 - Renew the token if it is expired using the refresh token.
2025-03-03 14:30:41 +07:00
jfederico bb3e575079 MDL-84683 mdl_bigbluebuttonbn: Hide Settings for RecordingsOnly 2025-02-28 15:02:42 +00:00
Andrew Gosali d42c502516 MDL-84431 mod_forum: fix visual issue on forum reply button :focus 2025-02-26 10:14:18 +07:00
Paul Holden 9451a354fd MDL-84298 mod_assign: target only first label for grade popout button. 2025-02-24 22:22:17 +00:00
Andrew Nicols c98be745f5 MDL-84446 core: Check existence of pcntl_signal 2025-02-18 06:20:51 +08:00
Leon Stringer ff4f2c02ef MDL-83195 mod_assign: Individual grade release
Fix pushing individual grades into the gradebook (as opposed to the
batch release of grades) when "Allow partial release of grades while
marking anonymously" is enabled.

This change reworks MDL-73626's fix for the same issue for releasing
multiple grades in a batch operation.
2025-02-14 09:28:21 +00:00
Katie Ransom d4f2a8b417 MDL-84419 core_task: Scheduled task timing is wrong when DST begins
This was only an issue for tasks set to run in the hour when the clocks
change for daylight saving time. E.g. if a task is set to run at 1am
every day in the Europe/London timezone, then the day the clocks go
forward gets skipped because 1am doesn't exist on that day.
2025-02-07 09:32:58 +00:00
Andrew Nicols cfef02a97c MDL-84421 tool_uploadcourse: Stop MUC caching enrol instances
We should not normally cache instances of a class. This can lead to poor
design to work around the limitations of PHP Serialization, and could
theoretically cause issues with PHP versions changing within a Moodle
version.
2025-02-04 22:14:19 +08:00
Lars Bonczek 0e9b826517 MDL-81655 theme: Fix maintenance warning positioning 2024-12-17 13:07:13 +01:00
934 changed files with 8077 additions and 3048 deletions
+3 -3
View File
@@ -19,7 +19,7 @@ env:
jobs:
Grunt:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checking out code
@@ -61,12 +61,12 @@ jobs:
matrix:
include:
# MySQL builds always run with the lowest PHP supported version.
- os: ubuntu-22.04
- os: ubuntu-24.04
php: 8.1
extensions:
db: mysqli
# PostgreSQL builds always run with the highest PHP supported version.
- os: ubuntu-22.04
- os: ubuntu-24.04
php: 8.3
db: pgsql
+1
View File
@@ -24,6 +24,7 @@
*/
define('CLI_SCRIPT', true);
define('IGNORE_COMPONENT_CACHE', true);
require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/clilib.php');
+40 -17
View File
@@ -55,13 +55,14 @@ If courseid is set, course module/s will be added into the course.
Options:
-f, --file=STRING Path to the backup file.
-c, --categoryid=INT ID of the course category to restore to.
-C, --courseid=INT ID of the course to restore to. This option is ignored if categoryid is set.
-c, --categoryid=INT ID of the course category to restore to. This option is ignored when restoring an activity and courseid is set.
-C, --courseid=INT ID of the course to restore to. This option is ignored when restoring a course and the categoryid is set.
-s, --showdebugging Show developer level debugging information
-h, --help Print out this help.
Example:
\$sudo -u www-data /usr/bin/php admin/cli/restore_backup.php --file=/path/to/backup/file.mbz --categoryid=1\n
\$sudo -u www-data /usr/bin/php admin/cli/restore_backup.php --file=/path/to/backup/coursebackup.mbz --categoryid=1\n
\$sudo -u www-data /usr/bin/php admin/cli/restore_backup.php --file=/path/to/backup/activitybackup.mbz --courseid=1\n
EOL;
echo $help;
@@ -84,11 +85,15 @@ if ($options['categoryid']) {
if (!$category = $DB->get_record('course_categories', ['id' => $options['categoryid']], 'id')) {
throw new \moodle_exception('invalidcategoryid');
}
} else if ($options['courseid']) {
}
if ($options['courseid']) {
if (!$course = $DB->get_record('course', ['id' => $options['courseid']], 'id')) {
throw new \moodle_exception('invalidcourseid');
}
} else {
}
if (empty($category) && empty($course)) {
throw new \moodle_exception('invalidoption');
}
@@ -100,28 +105,46 @@ $fp = get_file_packer('application/vnd.moodle.backup');
$fp->extract_to_pathname($options['file'], $path);
cli_heading(get_string('preprocessingbackupfile'));
try {
list($fullname, $shortname) = restore_dbops::calculate_course_names(0, get_string('restoringcourse', 'backup'),
get_string('restoringcourseshortname', 'backup'));
if (!empty($course)) {
$courseid = $course->id;
$rc = new restore_controller($backupdir, $courseid, backup::INTERACTIVE_NO,
backup::MODE_GENERAL, $admin->id, backup::TARGET_EXISTING_ADDING);
} else {
try {
// Create a temporary restore controller to determine the restore type.
$tmprc = new restore_controller($backupdir, SITEID, backup::INTERACTIVE_NO,
backup::MODE_GENERAL, $admin->id, backup::TARGET_EXISTING_ADDING);
// Restore the backup into a new course if:
// - It is a course backup and the category is set.
// - It is an activity backup and the course is not set.
$restoreasnewcourse = ($tmprc->get_type() === backup::TYPE_1COURSE && !empty($category)) ||
($tmprc->get_type() !== backup::TYPE_1COURSE && empty($course));
// Make sure to clean up the temporary restore controller.
$tmprc->destroy();
if ($restoreasnewcourse) {
list($fullname, $shortname) = restore_dbops::calculate_course_names(0, get_string('restoringcourse', 'backup'),
get_string('restoringcourseshortname', 'backup'));
$courseid = restore_dbops::create_new_course($fullname, $shortname, $category->id);
$rc = new restore_controller($backupdir, $courseid, backup::INTERACTIVE_NO,
backup::MODE_GENERAL, $admin->id, backup::TARGET_NEW_COURSE);
} else {
$courseid = $course->id;
$rc = new restore_controller($backupdir, $courseid, backup::INTERACTIVE_NO,
backup::MODE_GENERAL, $admin->id, backup::TARGET_EXISTING_ADDING);
}
$rc->execute_precheck();
$rc->execute_plan();
$rc->destroy();
// Rename course name if the backup is from course module and restore to category.
if (empty($course)) {
// Rename the course's full and short names with the backup file's original names if the backup file is an activity backup
// that is restored to a new course.
if ($restoreasnewcourse && $rc->get_type() !== backup::TYPE_1COURSE) {
$course = get_course($courseid);
list($fullname, $shortname) = restore_dbops::calculate_course_names(0, get_string('restoretonewcourse', 'backup'),
get_string('newcourse'));
$backupinfo = $rc->get_info();
$tmpfullname = $backupinfo->original_course_fullname ?? get_string('restoretonewcourse', 'backup');
$tmpshortname = $backupinfo->original_course_shortname ?? get_string('newcourse');
list($fullname, $shortname) = restore_dbops::calculate_course_names(
courseid: 0,
fullname: $tmpfullname,
shortname: $tmpshortname,
);
$course->fullname = $fullname;
$course->shortname = $shortname;
$course->visible = 1;
+205
View File
@@ -4327,6 +4327,7 @@
<VENDOR name="oracle" version="19" />
</DATABASE>
<PHP version="8.1.0" level="required">
<RESTRICT function="restrict_php_version_84" message="unsupportedphpversion84" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -4522,6 +4523,7 @@
<VENDOR name="oracle" version="19" />
</DATABASE>
<PHP version="8.1.0" level="required">
<RESTRICT function="restrict_php_version_84" message="unsupportedphpversion84" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -4714,6 +4716,7 @@
<VENDOR name="mysql" version="8.4" />
<VENDOR name="postgres" version="14" />
<VENDOR name="mssql" version="14.0" />
<VENDOR name="auroramysql" version="8.0" />
</DATABASE>
<PHP version="8.2.0" level="required">
</PHP>
@@ -4893,6 +4896,208 @@
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_async_backup" level="recommended">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_aurora_version" level="optional">
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="5.1" requires="4.2.3">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.11.0" />
<VENDOR name="mysql" version="8.4" />
<VENDOR name="postgres" version="15" />
<VENDOR name="mssql" version="14.0" />
<VENDOR name="auroramysql" version="8.0" />
</DATABASE>
<PHP version="8.2.0" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="required">
<FEEDBACK>
<ON_ERROR message="mbstringrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="required">
<FEEDBACK>
<ON_ERROR message="opensslrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlreader" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="required">
<FEEDBACK>
<ON_ERROR message="intlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
<PHP_EXTENSION name="sodium" level="required"/>
<PHP_EXTENSION name="exif" level="optional"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="zend.exception_ignore_args" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingzendexceptionignoreargs" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbstorageengine" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
<FEEDBACK>
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
<FEEDBACK>
<ON_CHECK message="slashargumentswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
<FEEDBACK>
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
<FEEDBACK>
<ON_CHECK message="unoconvwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfileformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfilepertable" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddblargeprefix" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
<FEEDBACK>
<ON_CHECK message="ishttpswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
<FEEDBACK>
<ON_CHECK message="incompleteunicodesupport" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_sixtyfour_bits" level="required">
<FEEDBACK>
<ON_ERROR message="sixtyfourbitsrequired" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_max_input_vars" level="optional">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_admin_dir_usage" level="optional">
<FEEDBACK>
<ON_CHECK message="iscustomadminwarnings" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_xmlrpc_usage" level="optional">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mod_assignment" level="required">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_db_prefix_length" level="required">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_async_backup" level="recommended">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_aurora_version" level="optional">
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+2
View File
@@ -23,6 +23,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('IGNORE_COMPONENT_CACHE', true);
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
+2
View File
@@ -81,6 +81,8 @@ class behat_admin extends behat_base {
$this->execute('behat_forms::i_set_the_field_with_xpath_to', [$fieldxpath, $value]);
$this->execute("behat_general::i_click_on", [get_string('savechanges'), 'button']);
// Wait for the page to be redirected.
$this->execute("behat_general::i_wait_to_be_redirected");
}
}
@@ -18,6 +18,7 @@ Feature: Verify the breadcrumbs in webservice tokens site administration pages
And "Manage tokens" "link" should exist in the ".breadcrumb" "css_element"
And "Web services" "link" should exist in the ".breadcrumb" "css_element"
And I set the field "User" to "John Doe"
And I set the field "Service" to "Moodle mobile web service"
And I press "Save changes"
When I click on "Delete" "link"
Then "Delete token" "text" should exist in the ".breadcrumb" "css_element"
+4
View File
@@ -36,6 +36,10 @@ if (function_exists('opcache_reset')) {
define('CLI_SCRIPT', true);
define('CACHE_DISABLE_ALL', true);
// It makes no sense to use BEHAT_CLI for this script (the Behat launch scripts expect to start
// from the normal environment), so in case user has set tne environment variable, disable it.
putenv('BEHAT_CLI=0');
// Basic functions.
require_once(__DIR__ . '/../../../../lib/clilib.php');
require_once(__DIR__ . '/../../../../lib/behat/lib.php');
+4
View File
@@ -31,6 +31,10 @@ define('ABORT_AFTER_CONFIG', true);
define('CACHE_DISABLE_ALL', true);
define('NO_OUTPUT_BUFFERING', true);
// It makes no sense to use BEHAT_CLI for this script (the Behat launch scripts expect to start
// from the normal environment), so in case user has set tne environment variable, disable it.
putenv('BEHAT_CLI=0');
require_once(__DIR__ .'/../../../../config.php');
require_once(__DIR__.'/../../../../lib/clilib.php');
require_once(__DIR__.'/../../../../lib/behat/lib.php');
+4
View File
@@ -39,6 +39,10 @@ define('NO_OUTPUT_BUFFERING', true);
define('IGNORE_COMPONENT_CACHE', true);
define('ABORT_AFTER_CONFIG', true);
// It makes no sense to use BEHAT_CLI for this script (the Behat launch scripts expect to start
// from the normal environment), so in case user has set tne environment variable, disable it.
putenv('BEHAT_CLI=0');
require_once(__DIR__ . '/../../../../lib/clilib.php');
// CLI options.
+4
View File
@@ -33,6 +33,10 @@ if (isset($_SERVER['REMOTE_ADDR'])) {
die(); // No access from web!.
}
// It makes no sense to use BEHAT_CLI for this script (the Behat launch scripts expect to start
// from the normal environment), so in case user has set tne environment variable, disable it.
putenv('BEHAT_CLI=0');
// Basic functions.
require_once(__DIR__ . '/../../../../lib/clilib.php');
require_once(__DIR__ . '/../../../../lib/behat/lib.php');
+1
View File
@@ -87,6 +87,7 @@ $action = optional_param('action', '', PARAM_ALPHA);
// Handle any single operation actions.
if ($action == 'requestanalysis') {
if ($courseid != 0) {
require_sesskey();
scheduler::request_course_analysis($courseid);
if ($courseid == SITEID) {
redirect(accessibility::get_plugin_url());
@@ -0,0 +1,70 @@
<?php
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
namespace tool_capability;
// phpcs:disable moodle.PHPUnit.TestCaseProvider.dataProviderSyntaxMethodNotFound
/**
* Detect common problems in capability definitions of plugins.
*
* @group plugin_checks
* @package tool_capability
* @copyright 2025 Petr Skoda
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
final class plugin_checks_test extends \core\tests\plugin_checks_testcase {
/**
* Verify contents of plugin db/access.php file.
*
* @dataProvider all_plugins_provider
* @coversNothing
*
* @param string $component
* @param string $plugintype
* @param string $pluginname
* @param string $dir
*/
public function test_db_access_file(string $component, string $plugintype, string $pluginname, string $dir): void {
global $CFG;
$stringmanager = get_string_manager();
$corerolefile = "$CFG->dirroot/lang/en/role.php";
$langfile = "$dir/lang/en/$component.php";
$file = "$dir/db/access.php";
$capabilities = $this->fetch_array_from_file($file, 'capabilities');
if (!$capabilities) {
$this->expectNotToPerformAssertions();
return;
}
foreach ($capabilities as $capname => $capability) {
if ($plugintype === 'qbank' && str_starts_with($capname, 'moodle/question:')) {
// Question bank capabilities are irregular.
$strname = explode('/', $capname, 2)[1];
$this->assertTrue($stringmanager->string_exists($strname, 'core_role'),
"Missing capability name string '$strname' in $corerolefile");
continue;
}
$this->assertMatchesRegularExpression("|^$plugintype/$pluginname:[a-z0-9_]+$|", $capname);
$strname = substr($capname, strlen($plugintype) + 1);
$this->assertTrue($stringmanager->string_exists($strname, $component),
"Missing capability name string '$strname' in $langfile");
$this->assertSame($capname, clean_param($capname, PARAM_CAPABILITY));
}
}
}
@@ -123,6 +123,7 @@ class expired_contexts_manager {
$expiredcontext = new expired_context(0, $orphan);
$expiredcontext->delete();
}
$orphaned->close();
// Delete any child of a user context.
$parentpath = $DB->sql_concat('ctxuser.path', "'/%'");
@@ -143,6 +144,7 @@ class expired_contexts_manager {
$expiredcontext = new expired_context(0, $child);
$expiredcontext->delete();
}
$userchildren->close();
}
/**
@@ -127,7 +127,6 @@ $string['dporolemapping'] = 'Privacy officer role mapping';
$string['dporolemapping_desc'] = 'The privacy officer can manage data requests. The capability tool/dataprivacy:managedatarequests must be allowed for a role to be listed as a privacy officer role mapping option.';
$string['editcategories'] = 'Edit categories';
$string['editcategory'] = 'Edit category';
$string['editcategories'] = 'Edit categories';
$string['editdefaults'] = 'Edit defaults: {$a}';
$string['editmoduledefaults'] = 'Edit module defaults';
$string['editpurpose'] = 'Edit purpose';
@@ -46,11 +46,11 @@ Feature: See the competencies for an activity on the course competencies page.
When I follow "Competencies"
Then I should see "Test-Comp1"
And I should see "Test-Comp2"
And I set the field "Filter competencies by resource or activity" to "PageName1"
And I set the competency filter "Filter competencies by resource or activity" to "PageName1"
And I press the enter key
And I should see "Test-Comp1"
And I should not see "Test-Comp2"
And I set the field "Filter competencies by resource or activity" to "PageName2"
And I set the competency filter "Filter competencies by resource or activity" to "PageName2"
And I press the enter key
And I should not see "Test-Comp1"
And I should not see "Test-Comp2"
+43 -12
View File
@@ -41,6 +41,18 @@ class manager {
/** @var int */
const REDIR_LOOP_THRESHOLD = 5;
/** @var array These components and related fileareas will not redirect. */
const ALLOWED_COMPONENTS = [
'core_admin' => [
'logocompact',
'logo',
'favicon',
],
'tool_mfa' => [
'guidance',
],
];
/**
* Displays a debug table with current factor information.
*
@@ -424,6 +436,37 @@ class manager {
return self::NO_REDIRECT;
}
// Ensure we have a moodle_url object if a string is provided.
if (is_string($url)) {
$url = new \moodle_url($url);
}
// Check for pluginfile.php urls.
$pluginfileurl = new \moodle_url('/pluginfile.php');
if ($url->compare($pluginfileurl)) {
// Get the slash arguments.
$args = explode('/', ltrim($url->get_slashargument(), '/'));
// Remove the contextid because we do not need it for this check.
array_shift($args);
// Get the component and filearea.
$component = clean_param(array_shift($args), PARAM_COMPONENT);
$filearea = clean_param(array_shift($args), PARAM_AREA);
// Check allowed components.
if (!array_key_exists($component, static::ALLOWED_COMPONENTS)) {
return self::REDIRECT;
}
// Check allowed fileareas.
if (!in_array($filearea, static::ALLOWED_COMPONENTS[$component])) {
return self::REDIRECT;
}
return self::NO_REDIRECT;
}
// Remove all params before comparison.
$url->remove_all_params();
@@ -442,12 +485,6 @@ class manager {
}
}
// Dont redirect logo images from pluginfile.php (for example: logo in header).
$logourl = new \moodle_url('/pluginfile.php/1/core_admin/logocompact/');
if ($url->compare($logourl)) {
return self::NO_REDIRECT;
}
// Admin not setup.
if (!empty($CFG->adminsetuppending)) {
return self::NO_REDIRECT;
@@ -469,12 +506,6 @@ class manager {
return self::NO_REDIRECT;
}
// Enrolment.
$enrol = new \moodle_url('/enrol/index.php');
if ($enrol->compare($url, URL_MATCH_BASE)) {
return self::NO_REDIRECT;
}
// Guest access.
if (isguestuser()) {
return self::NO_REDIRECT;
@@ -41,7 +41,8 @@ class factor_email_renderer extends plugin_renderer_base {
$authurl = new \moodle_url('/admin/tool/mfa/factor/email/email.php',
['instance' => $instance->id, 'pass' => 1, 'secret' => $instance->secret]);
$authurlstring = \html_writer::link($authurl, get_string('email:link', 'factor_email'));
$blockurl = new \moodle_url('/admin/tool/mfa/factor/email/email.php', ['instance' => $instanceid]);
$blockurl = new \moodle_url('/admin/tool/mfa/factor/email/email.php',
['instance' => $instance->id, 'secret' => $instance->secret]);
$blockurlstring = \html_writer::link($blockurl, get_string('email:stoploginlink', 'factor_email'));
$geoinfo = iplookup_find_location($instance->createdfromip);
+8 -3
View File
@@ -42,7 +42,8 @@ $PAGE->set_cacheable(false);
$instance = $DB->get_record('tool_mfa', ['id' => $instanceid]);
$factor = \tool_mfa\plugininfo\factor::get_factor('email');
// If pass is set, require login to force $SESSION and user, and pass for that session.
// If pass is set, do checks and pass for this session.
// Require login to force $SESSION and user, and pass for that session.
if (!empty($instance) && $pass != 0 && $secret != 0) {
require_login();
if ($factor->get_state() === \tool_mfa\plugininfo\factor::STATE_LOCKED) {
@@ -69,8 +70,12 @@ $form = new \factor_email\form\email($url);
if ($form->is_cancelled()) {
redirect(new moodle_url('/'));
} else if ($fromform = $form->get_data()) {
if (empty($instance)) {
}
// If submitted without the pass param, is a cancel request - do checks and revoke email factor.
if ($fromform = $form->get_data()) {
// Only allow revoke attempts from requests with a valid instance and secret.
if (empty($instance) || empty($secret) || $instance->secret != $secret) {
$message = get_string('error:badcode', 'factor_email');
} else {
$user = $DB->get_record('user', ['id' => $instance->userid]);
@@ -33,7 +33,7 @@ $string['email:loginlink'] = 'Or, if you\'re on the same device, use this {$a}.'
$string['email:message'] = 'Here\'s your verification code for {$a->sitename} ({$a->siteurl}).';
$string['email:originatingip'] = 'This login request was made from \'{$a}\'';
$string['email:revokelink'] = 'If this wasn\'t you, you can {$a}.';
$string['email:revokesuccess'] = 'This code has been successfully revoked. All sessions for {$a} have been ended.
$string['email:revokesuccess'] = 'This code has been successfully revoked. All sessions for this user have been ended.
Email will not be usable as a factor until account security has been verified.';
$string['email:subject'] = 'Here\'s your verification code';
$string['email:stoploginlink'] = 'stop this login attempt';
+1 -1
View File
@@ -29,7 +29,7 @@ require_once(__DIR__ . '/../../../config.php');
$PAGE->set_context(\context_system::instance());
$PAGE->set_url(new moodle_url('/admin/tool/mfa/guide.php'));
$PAGE->set_title(get_string('guidance', 'tool_mfa'));
$PAGE->set_pagelayout('standard');
$PAGE->set_pagelayout('secure');
// If guidance page isn't enabled, just redir back to home.
if (!get_config('tool_mfa', 'guidance')) {
+3 -3
View File
@@ -109,8 +109,8 @@ function tool_mfa_after_config(): void {
/**
* Serves any files for the guidance page.
*
* @param stdClass $course
* @param stdClass $cm
* @param stdClass|null $course
* @param stdClass|null $cm
* @param context $context
* @param string $filearea
* @param array $args
@@ -118,7 +118,7 @@ function tool_mfa_after_config(): void {
* @param array $options
* @return bool
*/
function tool_mfa_pluginfile(stdClass $course, stdClass $cm, context $context, string $filearea,
function tool_mfa_pluginfile(stdClass|null $course, stdClass|null $cm, context $context, string $filearea,
array $args, bool $forcedownload, array $options = []): bool {
// Hardcode to only send guidance files from the top level.
$fs = get_file_storage();
+1 -1
View File
@@ -23,6 +23,6 @@
{
}
}}
<a href='{{config.wwwroot}}/admin/tool/mfa/guide.php'>
<a href='{{config.wwwroot}}/admin/tool/mfa/guide.php' target='_blank'>
{{#str}} guidance, tool_mfa {{/str}}
</a>
+21 -5
View File
@@ -241,11 +241,6 @@ final class manager_test extends \advanced_testcase {
$this->assertEquals(\tool_mfa\manager::NO_REDIRECT, \tool_mfa\manager::should_require_mfa($badurl, false));
$this->setUser($user);
// Enrolment.
$enrolurl = new \moodle_url('/enrol/index.php');
$this->assertEquals(\tool_mfa\manager::REDIRECT, \tool_mfa\manager::should_require_mfa($badurl, false));
$this->assertEquals(\tool_mfa\manager::NO_REDIRECT, \tool_mfa\manager::should_require_mfa($enrolurl, false));
// Guest User.
$this->assertEquals(\tool_mfa\manager::REDIRECT, \tool_mfa\manager::should_require_mfa($badurl, false));
$this->setGuestUser();
@@ -266,6 +261,27 @@ final class manager_test extends \advanced_testcase {
\core\session\manager::loginas($user2->id, $syscontext, false);
$this->assertEquals(\tool_mfa\manager::NO_REDIRECT, \tool_mfa\manager::should_require_mfa($badurl, false));
$this->setUser($user);
// Access logocompact via pluginfile.
$logourl = new \moodle_url('/pluginfile.php/1/core_admin/logocompact/');
$this->assertEquals(\tool_mfa\manager::NO_REDIRECT, \tool_mfa\manager::should_require_mfa($logourl, false));
// Access logo via pluginfile.
$logourl = new \moodle_url('/pluginfile.php/1/core_admin/logo/');
$this->assertEquals(\tool_mfa\manager::NO_REDIRECT, \tool_mfa\manager::should_require_mfa($logourl, false));
// Access favicon via pluginfile.
$logourl = new \moodle_url('/pluginfile.php/1/core_admin/favicon/');
$this->assertEquals(\tool_mfa\manager::NO_REDIRECT, \tool_mfa\manager::should_require_mfa($logourl, false));
// Access guidance files.
$guideurl = new \moodle_url('/pluginfile.php/1/tool_mfa/guidance/0/capybara.png');
$this->assertEquals(\tool_mfa\manager::NO_REDIRECT, \tool_mfa\manager::should_require_mfa($guideurl, false));
// Access private area.
$user3 = $this->getDataGenerator()->create_user();
$privateurl = new \moodle_url("/pluginfile.php/{$user3->id}/user/private/privatefile.png");
$this->assertEquals(\tool_mfa\manager::REDIRECT, \tool_mfa\manager::should_require_mfa($privateurl, false));
}
/**
+4
View File
@@ -34,6 +34,10 @@ if (function_exists('opcache_reset')) {
define('IGNORE_COMPONENT_CACHE', true);
// It makes no sense to use BEHAT_CLI for this script (you cannot initialise PHPunit starting from
// the Behat environment), so in case user has set tne environment variable, disable it.
putenv('BEHAT_CLI=0');
require_once(__DIR__.'/../../../../lib/clilib.php');
require_once(__DIR__.'/../../../../lib/phpunit/bootstraplib.php');
require_once(__DIR__.'/../../../../lib/testing/lib.php');
+4
View File
@@ -30,6 +30,10 @@ if (isset($_SERVER['REMOTE_ADDR'])) {
define('IGNORE_COMPONENT_CACHE', true);
// It makes no sense to use BEHAT_CLI for this script (you cannot initialise PHPunit starting from
// the Behat environment), so in case user has set tne environment variable, disable it.
putenv('BEHAT_CLI=0');
require_once(__DIR__.'/../../../../lib/clilib.php');
require_once(__DIR__.'/../../../../lib/phpunit/bootstraplib.php');
require_once(__DIR__.'/../../../../lib/testing/lib.php');
+5 -5
View File
@@ -42,7 +42,7 @@ $string['activate'] = 'Set status to "Active"';
$string['activating'] = 'Activating a policy';
$string['activateconfirm'] = '<p>You are about to activate policy <em>\'{$a->name}\'</em> and make the version <em>\'{$a->revision}\'</em> the current one.</p><p>All users will be required to agree to this new policy version to be able to use the site.</p>';
$string['activateconfirmyes'] = 'Activate';
$string['agreepolicies'] = 'Please agree to the following policies';
$string['agreepolicies'] = 'Please agree to the following policies:';
$string['backtoprevious'] = 'Go back to previous page';
$string['backtotop'] = 'Back to top';
$string['cachedef_policy_optional'] = 'Cache of the optional/compulsory flag for policy versions';
@@ -74,8 +74,8 @@ $string['filterplaceholder'] = 'Search keyword or select filter';
$string['filterpolicy'] = 'Policy: {$a}';
$string['guestconsent:continue'] = 'Continue';
$string['guestconsentmessage'] = 'If you continue browsing this website, you agree to our policies:';
$string['iagree'] = 'I agree to the {$a}';
$string['idontagree'] = 'No thanks, I decline {$a}';
$string['iagree'] = 'I agree to the {$a}.';
$string['idontagree'] = 'I don\'t agree to the {$a}.';
$string['iagreetothepolicy'] = 'Give consent';
$string['inactivate'] = 'Set status to "Inactive"';
$string['inactivating'] = 'Inactivating a policy';
@@ -94,9 +94,9 @@ $string['newpolicy'] = 'New policy';
$string['newversion'] = 'New version';
$string['noactivepolicies'] = 'There are no policies with an active version.';
$string['nofiltersapplied'] = 'No filters applied';
$string['nopermissiontoagreedocs'] = 'No permission to agree to the policies';
$string['nopermissiontoagreedocs'] = 'No permission to agree to the policies.';
$string['nopermissiontoagreedocs_desc'] = 'Sorry, you do not have the required permissions to agree to the policies.<br />You will not be able to use this site until the following policies are agreed:';
$string['nopermissiontoagreedocsbehalf'] = 'No permission to agree to the policies on behalf of this user';
$string['nopermissiontoagreedocsbehalf'] = 'No permission to agree to the policies on behalf of this user.';
$string['nopermissiontoagreedocsbehalf_desc'] = 'Sorry, you do not have the required permission to agree to the following policies on behalf of {$a}:';
$string['nopermissiontoagreedocscontact'] = 'For more help:';
$string['nopermissiontoviewpolicyversion'] = 'You do not have permissions to view this policy version.';
@@ -34,13 +34,13 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
Then I should see "This site policy"
And I should not see "Course overview"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This site policy." to "1"
And I press "Next"
And I should see "Calendar"
And I log out
And I log in as "manager"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This site policy." to "1"
And I press "Next"
And I navigate to "Users > Privacy and policies > User agreements" in site administration
And "Accepted" "text" should exist in the "User One" "table_row"
@@ -53,7 +53,7 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
| tool/policy:acceptbehalf | allow |
When I log in as "manager"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This site policy." to "1"
And I press "Next"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
And I click on "1 of 4 (25%)" "link" in the "This site policy" "table_row"
@@ -76,7 +76,7 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
| tool/policy:acceptbehalf | allow |
When I log in as "manager"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This site policy." to "1"
And I press "Next"
And I should see "Calendar"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
@@ -104,16 +104,16 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
And I press "Next"
And I should see "This privacy policy"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This privacy policy" to "1"
And I set the field "I agree to the This site policy." to "1"
And I set the field "I agree to the This privacy policy." to "1"
And I press "Next"
And I should see "Calendar"
And I log out
And I log in as "manager"
And I press "Next"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This privacy policy" to "1"
And I set the field "I agree to the This site policy." to "1"
And I set the field "I agree to the This privacy policy." to "1"
And I press "Next"
And I navigate to "Users > Privacy and policies > User agreements" in site administration
And "Accepted" "text" should exist in the "User One" "table_row"
@@ -142,8 +142,8 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
When I log in as "manager"
And I press "Next"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This privacy policy" to "1"
And I set the field "I agree to the This site policy." to "1"
And I set the field "I agree to the This privacy policy." to "1"
And I press "Next"
And I navigate to "Users > Privacy and policies > User agreements" in site administration
And I click on "Accept This site policy" "link" in the "User One" "table_row"
@@ -176,8 +176,8 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
When I log in as "manager"
And I press "Next"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This privacy policy" to "1"
And I set the field "I agree to the This site policy." to "1"
And I set the field "I agree to the This privacy policy." to "1"
And I press "Next"
And I navigate to "Users > Privacy and policies > User agreements" in site administration
And I click on "Accept This site policy" "link" in the "User One" "table_row"
@@ -198,7 +198,7 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
Scenario: Policies and agreements profile link visible for current user
Given I log in as "user1"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This site policy." to "1"
And I press "Next"
When I follow "Profile" in the user menu
# User can see his own agreements link in the profile.
@@ -217,7 +217,7 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
| tool/policy:acceptbehalf | allow |
And I log in as "manager"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This site policy." to "1"
And I press "Next"
# User can see agreements link in other user profiles because has the capability for accepting on behalf of them.
When I am on "Course1" course homepage
@@ -231,7 +231,7 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
| tool/policy:acceptbehalf | allow |
When I log in as "manager"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This site policy." to "1"
And I press "Next"
And I log out
And I am on the "manager" "user > profile" page logged in as "admin"
@@ -267,8 +267,8 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
When I log in as "manager"
And I press "Next"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This privacy policy" to "1"
And I set the field "I agree to the This site policy." to "1"
And I set the field "I agree to the This privacy policy." to "1"
And I press "Next"
And I navigate to "Users > Privacy and policies > User agreements" in site administration
And I click on "Select" "checkbox" in the "User One" "table_row"
@@ -290,7 +290,7 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
And I should see "This site policy"
And I should not see "Course overview"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This site policy." to "1"
And I press "Next"
And I should see "Calendar"
And I log out
+94 -94
View File
@@ -4,7 +4,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
As a user
I need to be able to accept site policy during sign up
Scenario: Accept policy on sign up, no site policy
Scenario: Accept policy on sign up manage by plugin, no site policy
Given the following config values are set as admin:
| registerauth | email |
| passwordpolicy | 0 |
@@ -16,13 +16,13 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I set the following fields to these values:
| Username | user1 |
| Password | user1 |
| Email address | user1@address.invalid |
| Email (again) | user1@address.invalid |
| Email address | user1@example.com |
| Email (again) | user1@example.com |
| First name | User1 |
| Last name | L1 |
And I press "Create my new account"
And I should see "Confirm your account"
And I should see "An email should have been sent to your address at user1@address.invalid"
And I should see "An email should have been sent to your address at user1@example.com"
And I confirm email for "user1"
And I should see "Thanks, User1 L1"
And I should see "Your registration has been confirmed"
@@ -50,13 +50,13 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I set the following fields to these values:
| Username | user1 |
| Password | user1 |
| Email address | user1@address.invalid |
| Email (again) | user1@address.invalid |
| Email address | user1@example.com |
| Email (again) | user1@example.com |
| First name | User1 |
| Last name | L1 |
And I press "Create my new account"
And I should see "Confirm your account"
And I should see "An email should have been sent to your address at user1@address.invalid"
And I should see "An email should have been sent to your address at user1@example.com"
And I confirm email for "user1"
And I should see "Thanks, User1 L1"
And I should see "Your registration has been confirmed"
@@ -85,23 +85,23 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I should see "short text2"
And I should see "full text2"
And I press "Next"
And I should see "Please agree to the following policies"
And I should see "Please agree to the following policies:"
And I should see "This site policy" in the "region-main" "region"
And I should see "short text2"
And I should not see "full text2"
And I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This site policy." to "1"
And I press "Next"
And I should not see "I understand and agree"
And I set the following fields to these values:
| Username | user1 |
| Password | user1 |
| Email address | user1@address.invalid |
| Email (again) | user1@address.invalid |
| Email address | user1@example.com |
| Email (again) | user1@example.com |
| First name | User1 |
| Last name | L1 |
And I press "Create my new account"
And I should see "Confirm your account"
And I should see "An email should have been sent to your address at user1@address.invalid"
And I should see "An email should have been sent to your address at user1@example.com"
And I confirm email for "user1"
And I should see "Thanks, User1 L1"
And I should see "Your registration has been confirmed"
@@ -137,7 +137,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I should see "short text3"
And I should see "full text3"
And I press "Next"
And I should see "Please agree to the following policies"
And I should see "Please agree to the following policies:"
And I should see "This site policy" in the "region-main" "region"
And I should see "short text2"
And I should not see "full text2"
@@ -147,20 +147,20 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I should not see "This guests policy" in the "region-main" "region"
And I should not see "short text4"
And I should not see "full text4"
And I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This privacy policy" to "1"
And I set the field "I agree to the This site policy." to "1"
And I set the field "I agree to the This privacy policy." to "1"
And I press "Next"
And I should not see "I understand and agree"
And I set the following fields to these values:
| Username | user1 |
| Password | user1 |
| Email address | user1@address.invalid |
| Email (again) | user1@address.invalid |
| Email address | user1@example.com |
| Email (again) | user1@example.com |
| First name | User1 |
| Last name | L1 |
And I press "Create my new account"
And I should see "Confirm your account"
And I should see "An email should have been sent to your address at user1@address.invalid"
And I should see "An email should have been sent to your address at user1@example.com"
And I confirm email for "user1"
And I should see "Thanks, User1 L1"
And I should see "Your registration has been confirmed"
@@ -197,23 +197,23 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I should see "short text2"
And I should see "full text2"
And I press "Next"
And I should see "Please agree to the following policies"
And I should see "Please agree to the following policies:"
And I should see "This site policy"
And I should see "short text2"
And I should not see "full text2"
And I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This site policy." to "1"
And I press "Next"
And I should not see "I understand and agree"
And I set the following fields to these values:
| Username | user1 |
| Password | user1 |
| Email address | user1@address.invalid |
| Email (again) | user1@address.invalid |
| Email address | user1@example.com |
| Email (again) | user1@example.com |
| First name | User1 |
| Last name | L1 |
And I press "Create my new account"
And I should see "Confirm your account"
And I should see "An email should have been sent to your address at user1@address.invalid"
And I should see "An email should have been sent to your address at user1@example.com"
And I confirm email for "user1"
And I should see "Thanks, User1 L1"
And I should see "Your registration has been confirmed"
@@ -244,19 +244,19 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I press "Next"
And I should see "This privacy policy"
And I press "Next"
And I should see "Please agree to the following policies"
And I should see "Please agree to the following policies:"
And I should see "This site policy"
And I should see "This privacy policy"
# Confirm that a notification is displayed if none of the policies are accepted.
When I set the field "I agree to the This site policy" to "0"
And I set the field "I agree to the This privacy policy" to "0"
When I set the field "I agree to the This site policy." to "0"
And I set the field "I agree to the This privacy policy." to "0"
And I press "Next"
Then I should see "Please agree to the following policies"
Then I should see "Please agree to the following policies:"
And I should see "Before continuing you need to acknowledge all these policies."
# Confirm that a notification is displayed if only some policies are accepted.
When I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This privacy policy" to "0"
Then I should see "Please agree to the following policies"
When I set the field "I agree to the This site policy." to "1"
And I set the field "I agree to the This privacy policy." to "0"
Then I should see "Please agree to the following policies:"
And I should see "Before continuing you need to acknowledge all these policies."
Scenario: Accept policy on login, do not accept all policies
@@ -276,23 +276,23 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I press "Next"
And I should see "This privacy policy"
And I press "Next"
And I should see "Please agree to the following policies"
And I should see "Please agree to the following policies:"
And I should see "This site policy"
And I should see "This privacy policy"
# Confirm that a notification is displayed if none of the policies are accepted.
When I set the field "I agree to the This site policy" to "0"
And I set the field "I agree to the This privacy policy" to "0"
When I set the field "I agree to the This site policy." to "0"
And I set the field "I agree to the This privacy policy." to "0"
And I press "Next"
Then I should see "Please agree to the following policies"
Then I should see "Please agree to the following policies:"
And I should see "Before continuing you need to acknowledge all these policies."
# Confirm that a notification is displayed if only some policies are accepted.
When I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This privacy policy" to "0"
Then I should see "Please agree to the following policies"
When I set the field "I agree to the This site policy." to "1"
And I set the field "I agree to the This privacy policy." to "0"
Then I should see "Please agree to the following policies:"
And I should see "Before continuing you need to acknowledge all these policies."
# Confirm that user can not browse the site (edit their profile).
When I follow "Profile" in the user menu
Then I should see "Please agree to the following policies"
Then I should see "Please agree to the following policies:"
Scenario: Accept policy on login, accept all policies
Given the following config values are set as admin:
@@ -311,14 +311,14 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I press "Next"
And I should see "This privacy policy"
And I press "Next"
And I should see "Please agree to the following policies"
And I should see "Please agree to the following policies:"
And I should see "This site policy"
And I should see "This privacy policy"
# User accepts all policies.
When I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This privacy policy" to "1"
When I set the field "I agree to the This site policy." to "1"
And I set the field "I agree to the This privacy policy." to "1"
And I press "Next"
Then I should not see "Please agree to the following policies"
Then I should not see "Please agree to the following policies:"
And I should not see "Before continuing you need to acknowledge all these policies."
# Confirm that user can login and browse the site (edit their profile).
When I open my profile in edit mode
@@ -328,7 +328,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
When I log in as "user1"
Then I should not see "This site policy"
And I should not see "This privacy policy"
And I should not see "Please agree to the following policies"
And I should not see "Please agree to the following policies:"
# Confirm that user can login and browse the site (edit their profile).
When I open my profile in edit mode
Then the field "First name" matches value "User"
@@ -350,14 +350,14 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I press "Next"
And I should see "This privacy policy"
And I press "Next"
And I should see "Please agree to the following policies"
And I should see "Please agree to the following policies:"
And I should see "This site policy"
And I should see "This privacy policy"
# User accepts all policies.
When I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This privacy policy" to "1"
When I set the field "I agree to the This site policy." to "1"
And I set the field "I agree to the This privacy policy." to "1"
And I press "Next"
Then I should not see "Please agree to the following policies"
Then I should not see "Please agree to the following policies:"
# Confirm that user can login and browse the site (edit their profile).
When I open my profile in edit mode
Then the field "First name" matches value "User"
@@ -385,7 +385,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I should not see "This privacy policy"
Then I should see "This third parties policy"
And I press "Next"
And I should see "Please agree to the following policies"
And I should see "Please agree to the following policies:"
And I should see "This third parties policy"
And I set the field "This third parties policy" to "1"
And I press "Next"
@@ -407,12 +407,12 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I log in as "user1"
And I should see "This site policy"
And I press "Next"
And I should see "Please agree to the following policies"
And I should see "Please agree to the following policies:"
And I should see "This site policy"
# User accepts policy.
When I set the field "I agree to the This site policy" to "1"
When I set the field "I agree to the This site policy." to "1"
And I press "Next"
Then I should not see "Please agree to the following policies"
Then I should not see "Please agree to the following policies:"
# Confirm that user can login and browse the site (edit their profile).
When I open my profile in edit mode
Then the field "First name" matches value "User"
@@ -437,13 +437,13 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I should see "short text2 new version"
And I should see "full text2 new version"
When I press "Next"
Then I should see "Please agree to the following policies"
Then I should see "Please agree to the following policies:"
And I should see "This site policy new version"
And I should see "short text2 new version"
# User accepts policy.
And I set the field "I agree to the This site policy new version" to "1"
And I set the field "I agree to the This site policy new version." to "1"
When I press "Next"
Then I should not see "Please agree to the following policies"
Then I should not see "Please agree to the following policies:"
# Confirm that user can login and browse the site (edit their profile).
When I open my profile in edit mode
Then the field "First name" matches value "User"
@@ -504,28 +504,28 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I should see "short text3"
And I should see "full text3"
When I press "Next"
Then I should see "Please agree to the following policies"
Then I should see "Please agree to the following policies:"
And I should see "This site policy" in the "region-main" "region"
And I should see "short text2"
And I should see "This privacy policy" in the "region-main" "region"
And I should see "short text3"
And I should not see "This guests policy" in the "region-main" "region"
And I should not see "short text4"
And I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This privacy policy" to "1"
And I set the field "I agree to the This site policy." to "1"
And I set the field "I agree to the This privacy policy." to "1"
When I press "Next"
Then I should not see "I understand and agree"
And I should see "New account"
And I set the following fields to these values:
| Username | user1 |
| Password | user1 |
| Email address | user1@address.invalid |
| Email (again) | user1@address.invalid |
| Email address | user1@example.com |
| Email (again) | user1@example.com |
| First name | User1 |
| Last name | L1 |
When I press "Create my new account"
Then I should see "Confirm your account"
And I should see "An email should have been sent to your address at user1@address.invalid"
And I should see "An email should have been sent to your address at user1@example.com"
And I follow "Log in"
When I click on "Create new account" "link"
# Confirm that the user can view and accept policies when attempting to create another account.
@@ -537,7 +537,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I should see "short text3"
And I should see "full text3"
When I press "Next"
Then I should see "Please agree to the following policies"
Then I should see "Please agree to the following policies:"
And I should see "This site policy" in the "region-main" "region"
And I should see "short text2"
And I should not see "full text2"
@@ -547,8 +547,8 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I should not see "This guests policy" in the "region-main" "region"
And I should not see "short text4"
And I should not see "full text4"
And I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This privacy policy" to "1"
And I set the field "I agree to the This site policy." to "1"
And I set the field "I agree to the This privacy policy." to "1"
When I press "Next"
Then I should not see "I understand and agree"
And I should see "New account"
@@ -572,8 +572,8 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I should see "Please read our This privacy policy"
And I press "Next"
And I should see "Viewing this page on behalf of User 1"
And I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This privacy policy" to "1"
And I set the field "I agree to the This site policy." to "1"
And I set the field "I agree to the This privacy policy." to "1"
And I press "Next"
And I log out
And I log in as "user1"
@@ -599,15 +599,15 @@ Feature: User must accept policy managed by this plugin when logging in and sign
When I log in as "manager"
And I press "Next"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This privacy policy" to "1"
And I set the field "I agree to the This site policy." to "1"
And I set the field "I agree to the This privacy policy." to "1"
And I press "Next"
And I am on the "user1" "user > profile" page
And I follow "Log in as"
Then I should see "You are logged in as User 1"
And I press "Continue"
And I should see "Policies and agreements"
And I should see "No permission to agree to the policies on behalf of this user"
And I should see "No permission to agree to the policies on behalf of this user."
And I should see "Sorry, you do not have the required permission to agree to the following policies on behalf of User 1"
Scenario: Accept policy on sign up as a guest, one policy
@@ -631,23 +631,23 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I should see "short text2"
And I should see "full text2"
And I press "Next"
And I should see "Please agree to the following policies"
And I should see "Please agree to the following policies:"
And I should see "This site policy"
And I should see "short text2"
And I should not see "full text2"
And I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This site policy." to "1"
And I press "Next"
And I should not see "I understand and agree"
And I set the following fields to these values:
| Username | user1 |
| Password | user1 |
| Email address | user1@address.invalid |
| Email (again) | user1@address.invalid |
| Email address | user1@example.com |
| Email (again) | user1@example.com |
| First name | User1 |
| Last name | L1 |
And I press "Create my new account"
And I should see "Confirm your account"
And I should see "An email should have been sent to your address at user1@address.invalid"
And I should see "An email should have been sent to your address at user1@example.com"
And I confirm email for "user1"
And I should see "Thanks, User1 L1"
And I should see "Your registration has been confirmed"
@@ -680,12 +680,12 @@ Feature: User must accept policy managed by this plugin when logging in and sign
Then I should see "Digital maturity declaration" in the "region-main" "region"
And I should see "You declare be old enough"
And I should see "Here goes content."
And I press "I agree to the Digital maturity declaration"
And I press "I agree to the Digital maturity declaration."
# The second policy with the agreement style "on its own page" must be accepted now.
And I should see "Terms of Service" in the "region-main" "region"
And I should see "We teach, you learn"
And I should see "Here goes content."
And I press "I agree to the Terms of Service"
And I press "I agree to the Terms of Service."
# Only now we see the remaining consent page policies.
And I should see "Policy 1 out of 2"
And I should see "Privacy policy" in the "region-main" "region"
@@ -697,26 +697,26 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I should see "We eat cookies, srsly"
And I should see "Here goes content."
And I press "Next"
And I should see "Please agree to the following policies"
And I should see "Please agree to the following policies:"
And I should see "Privacy policy"
And I should see "Cookies policy"
And I should not see "Digital maturity declaration" in the "region-main" "region"
And I should not see "Terms of Service" in the "region-main" "region"
And I should not see "Here goes content."
And I set the field "I agree to the Privacy policy" to "1"
And I set the field "I agree to the Cookies policy" to "1"
And I set the field "I agree to the Privacy policy." to "1"
And I set the field "I agree to the Cookies policy." to "1"
And I press "Next"
And I should see "New account"
And I set the following fields to these values:
| Username | user1 |
| Password | user1 |
| Email address | user1@address.invalid |
| Email (again) | user1@address.invalid |
| Email address | user1@example.com |
| Email (again) | user1@example.com |
| First name | User1 |
| Last name | L1 |
And I press "Create my new account"
And I should see "Confirm your account"
And I should see "An email should have been sent to your address at user1@address.invalid"
And I should see "An email should have been sent to your address at user1@example.com"
And I confirm email for "user1"
And I should see "Thanks, User1 L1"
And I should see "Your registration has been confirmed"
@@ -751,7 +751,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
Then I should see "Digital maturity declaration" in the "region-main" "region"
And I should see "You declare be old enough"
And I should see "Here goes content."
And I press "I agree to the Digital maturity declaration"
And I press "I agree to the Digital maturity declaration."
# The second policy with the agreement style "on its own page" must be accepted now.
And I should see "Terms of Service" in the "region-main" "region"
And I should see "We teach, you learn"
@@ -762,7 +762,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I should see "Terms of Service" in the "region-main" "region"
And I should see "We teach, you learn"
And I should see "Here goes content."
And I press "I agree to the Terms of Service"
And I press "I agree to the Terms of Service."
# Only now we see the remaining consent page policies.
And I should see "Policy 1 out of 2"
And I should see "Privacy policy" in the "region-main" "region"
@@ -774,14 +774,14 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I should see "We eat cookies, srsly"
And I should see "Here goes content."
And I press "Next"
And I should see "Please agree to the following policies"
And I should see "Please agree to the following policies:"
And I should see "Privacy policy"
And I should see "Cookies policy"
And I should not see "Digital maturity declaration" in the "region-main" "region"
And I should not see "Terms of Service" in the "region-main" "region"
And I should not see "Here goes content."
And I set the field "I agree to the Privacy policy" to "1"
And I set the field "I agree to the Cookies policy" to "1"
And I set the field "I agree to the Privacy policy." to "1"
And I set the field "I agree to the Cookies policy." to "1"
And I press "Next"
And I follow "Profile" in the user menu
# User can see his own agreements in the profile.
@@ -809,15 +809,15 @@ Feature: User must accept policy managed by this plugin when logging in and sign
Then I should see "Privacy policy" in the "region-main" "region"
And I should see "We scan your thoughts"
And I should see "Here goes content."
And I press "I agree to the Privacy policy"
And I press "I agree to the Privacy policy."
And I should see "Digital maturity declaration" in the "region-main" "region"
And I should see "You declare be old enough"
And I should see "Here goes content."
And I press "I agree to the Digital maturity declaration"
And I press "I agree to the Digital maturity declaration."
And I should see "Terms of Service" in the "region-main" "region"
And I should see "We teach, you learn"
And I should see "Here goes content."
And I press "I agree to the Terms of Service"
And I press "I agree to the Terms of Service."
And I follow "Profile" in the user menu
And I follow "Policies and agreements"
And "Accepted" "text" should exist in the "Privacy policy" "table_row"
@@ -844,21 +844,21 @@ Feature: User must accept policy managed by this plugin when logging in and sign
Then I should see "Digital maturity declaration" in the "region-main" "region"
And I should see "You declare be old enough"
And I should see "Here goes content."
And I press "I agree to the Digital maturity declaration"
And I press "I agree to the Digital maturity declaration."
And I should see "Cookies policy" in the "region-main" "region"
And I should see "We eat cookies, srsly"
And I press "I agree to the Cookies policy"
And I press "I agree to the Cookies policy."
And I should see "New account"
And I set the following fields to these values:
| Username | user1 |
| Password | user1 |
| Email address | user1@address.invalid |
| Email (again) | user1@address.invalid |
| Email address | user1@example.com |
| Email (again) | user1@example.com |
| First name | User1 |
| Last name | L1 |
And I press "Create my new account"
And I should see "Confirm your account"
And I should see "An email should have been sent to your address at user1@address.invalid"
And I should see "An email should have been sent to your address at user1@example.com"
And I confirm email for "user1"
And I should see "Thanks, User1 L1"
And I should see "Your registration has been confirmed"
@@ -61,7 +61,7 @@ Feature: Manage policies
| Policy1 | v1 | full text2 | short text2 | active |
And I log in as "manager"
And I press "Next"
And I set the field "I agree to the Policy1" to "1"
And I set the field "I agree to the Policy1." to "1"
And I press "Next"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
And I click on "Edit" "link" in the "Policy1" "table_row"
@@ -83,7 +83,7 @@ Feature: Manage policies
| Policy1 | v1 | full text2 | short text2 | active |
And I log in as "manager"
And I press "Next"
And I set the field "I agree to the Policy1" to "1"
And I set the field "I agree to the Policy1." to "1"
And I press "Next"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
And I click on "Edit" "link" in the "Policy1" "table_row"
@@ -101,7 +101,7 @@ Feature: Manage policies
| Policy1 | v1 | full text2 | short text2 | active |
And I log in as "manager"
And I press "Next"
And I set the field "I agree to the Policy1" to "1"
And I set the field "I agree to the Policy1." to "1"
And I press "Next"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
And I click on "Edit" "link" in the "Policy1" "table_row"
@@ -180,7 +180,7 @@ Feature: Manage policies
| Policy1 | v1 | full text2 | short text2 | active |
And I log in as "manager"
And I press "Next"
And I set the field "I agree to the Policy1" to "1"
And I set the field "I agree to the Policy1." to "1"
And I press "Next"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
And I click on "Set status to \"Inactive\"" "link" in the "Policy1" "table_row"
@@ -218,7 +218,7 @@ Feature: Manage policies
| Policy1 | v1 | full text2 | short text2 | active |
And I log in as "manager"
And I press "Next"
And I set the field "I agree to the Policy1" to "1"
And I set the field "I agree to the Policy1." to "1"
And I press "Next"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
And I click on "Set status to \"Inactive\"" "link" in the "Policy1" "table_row"
@@ -247,7 +247,7 @@ Feature: Manage policies
| Policy1 | v1 | full text2 | short text2 | active |
And I log in as "user1"
And I press "Next"
And I set the field "I agree to the Policy1" to "1"
And I set the field "I agree to the Policy1." to "1"
And I press "Next"
And I follow "Preferences" in the user menu
And I should see "Preferences"
+21 -21
View File
@@ -70,26 +70,26 @@ Feature: Optional policies
And I should see "OwnPageCompulsory1" in the "region-main" "region"
And I should see "short text4" in the "region-main" "region"
And I should see "full text4" in the "region-main" "region"
And I press "I agree to the OwnPageCompulsory1"
And I press "I agree to the OwnPageCompulsory1."
# Compulsory policies displayed on the consent page are shown next and must be agreed.
And I should see "ConsentPageCompulsory1"
And I should see "short text3" in the "region-main" "region"
And I should see "full text3" in the "region-main" "region"
And I press "Next"
And I should see "Please agree to the following policies"
And I set the field "I agree to the ConsentPageCompulsory1" to "1"
And I should see "Please agree to the following policies:"
And I set the field "I agree to the ConsentPageCompulsory1." to "1"
And I press "Next"
# The signup form can be submitted and a new account created.
And I set the following fields to these values:
| Username | user3 |
| Password | user3 |
| Email address | user3@address.invalid |
| Email (again) | user3@address.invalid |
| Email address | user3@example.com |
| Email (again) | user3@example.com |
| First name | User3 |
| Last name | L3 |
And I press "Create my new account"
And I should see "Confirm your account"
And I should see "An email should have been sent to your address at user3@address.invalid"
And I should see "An email should have been sent to your address at user3@example.com"
And I confirm email for "user3"
And I should see "Thanks, User3 L3"
And I should see "Your registration has been confirmed"
@@ -99,7 +99,7 @@ Feature: Optional policies
Then I should see "OwnPageOptional1"
And I should see "short text5" in the "region-main" "region"
And I should see "full text5" in the "region-main" "region"
And I press "No thanks, I decline OwnPageOptional1"
And I press "I don't agree to the OwnPageOptional1"
# Then come policies displayed on the consent page.
And I should see "ConsentPageOptional1" in the "region-main" "region"
And I should see "short text1" in the "region-main" "region"
@@ -109,9 +109,9 @@ Feature: Optional policies
And I should see "short text2" in the "region-main" "region"
And I should see "full text2" in the "region-main" "region"
And I press "Next"
And I should see "Please agree to the following policies"
And I set the field "I agree to the ConsentPageOptional1" to "1"
And I set the field "No thanks, I decline ConsentPageOptional2" to "0"
And I should see "Please agree to the following policies:"
And I set the field "I agree to the ConsentPageOptional1." to "1"
And I set the field "I don't agree to the ConsentPageOptional2" to "0"
And I press "Next"
# Accepted and declined policies are shown in the profile.
And I follow "Profile" in the user menu
@@ -132,14 +132,14 @@ Feature: Optional policies
Then I should see "OwnPageOptional1"
And I should see "short text5" in the "region-main" "region"
And I should see "full text5" in the "region-main" "region"
And I press "I agree to the OwnPageOptional1"
And I press "I agree to the OwnPageOptional1."
# Then come policies displayed on the consent page.
And I should see "ConsentPageOptional1" in the "region-main" "region"
And I should see "short text1" in the "region-main" "region"
And I should see "full text1" in the "region-main" "region"
And I press "Next"
And I should see "Please agree to the following policies"
And I set the field "No thanks, I decline ConsentPageOptional1" to "0"
And I should see "Please agree to the following policies:"
And I set the field "I don't agree to the ConsentPageOptional1" to "0"
And I press "Next"
# Accepted and declined policies are shown in the profile.
And I follow "Profile" in the user menu
@@ -152,7 +152,7 @@ Feature: Optional policies
| Name | Content | Summary | Agreementstyle | Optional |
| OwnPageOptional1 | full text1 | short text1 | 1 | 1 |
And I log in as "user1"
And I press "I agree to the OwnPageOptional1"
And I press "I agree to the OwnPageOptional1."
And I follow "Profile" in the user menu
And I follow "Policies and agreements"
And "Accepted" "text" should exist in the "OwnPageOptional1" "table_row"
@@ -177,7 +177,7 @@ Feature: Optional policies
| Name | Content | Summary | Agreementstyle | Optional |
| OwnPageOptional1 | full text1 | short text1 | 1 | 1 |
And I log in as "user1"
And I press "I agree to the OwnPageOptional1"
And I press "I agree to the OwnPageOptional1."
And I follow "Profile" in the user menu
And I follow "Policies and agreements"
And "Accepted" "text" should exist in the "OwnPageOptional1" "table_row"
@@ -202,12 +202,12 @@ Feature: Optional policies
| OwnPageOptional1 | full text1 | short text1 | 1 | 1 |
| OwnPageOptional2 | full text2 | short text2 | 1 | 1 |
And I log in as "user1"
And I press "I agree to the OwnPageOptional1"
And I press "No thanks, I decline OwnPageOptional2"
And I press "I agree to the OwnPageOptional1."
And I press "I don't agree to the OwnPageOptional2"
And I log out
And I log in as "manager"
And I press "I agree to the OwnPageOptional1"
And I press "I agree to the OwnPageOptional2"
And I press "I agree to the OwnPageOptional1."
And I press "I agree to the OwnPageOptional2."
When I navigate to "Users > Privacy and policies > User agreements" in site administration
# User One has accepted just some policies.
Then "Partially accepted" "text" should exist in the "User One" "table_row"
@@ -228,8 +228,8 @@ Feature: Optional policies
| OwnPageOptional1 | full text1 | short text1 | 1 | 1 |
| OwnPageOptional2 | full text2 | short text2 | 1 | 1 |
And I log in as "user1"
And I press "I agree to the OwnPageOptional1"
And I press "No thanks, I decline OwnPageOptional2"
And I press "I agree to the OwnPageOptional1."
And I press "I don't agree to the OwnPageOptional2"
And I log out
And I log in as "admin"
When I navigate to "Users > Privacy and policies > User agreements" in site administration
+1 -6
View File
@@ -178,12 +178,7 @@ class tool_uploadcourse_helper {
* @return enrol_plugin[]
*/
public static function get_enrolment_plugins() {
$cache = cache::make('tool_uploadcourse', 'helper');
if (($enrol = $cache->get('enrol')) === false) {
$enrol = enrol_get_plugins(false);
$cache->set('enrol', $enrol);
}
return $enrol;
return enrol_get_plugins(false);
}
/**
+2 -3
View File
@@ -208,12 +208,11 @@ class helper {
* @return \moodle_url The URL.
*/
public static function get_duplicate_tour_link($tourid) {
$link = new \moodle_url('/admin/tool/usertours/configure.php', [
return new \moodle_url('/admin/tool/usertours/configure.php', [
'action' => manager::ACTION_DUPLICATETOUR,
'id' => $tourid,
'sesskey' => sesskey(),
]);
return $link;
}
/**
+2 -1
View File
@@ -503,8 +503,9 @@ class manager {
* @param int $tourid The ID of the tour to duplicate.
*/
protected function duplicate_tour($tourid) {
$tour = helper::get_tour($tourid);
require_sesskey();
$tour = helper::get_tour($tourid);
$export = $tour->to_record();
// Remove the id.
unset($export->id);
@@ -102,7 +102,6 @@ $string['name'] = 'Name';
$string['name_help'] = 'The name of a tour may be added as plain text, enclosed in multilang tags (for use with the multi-language content filter) if required.
Alternatively, a language string ID may be entered in the format identifier,component (with no brackets or space after the comma).';
$string['newstep'] = 'Create step';
$string['newstep'] = 'New step';
$string['newtour'] = 'Create a new tour';
$string['next'] = 'Next';
@@ -1,12 +0,0 @@
@tool @tool_xmldb
Feature: The Reconcile XMLDB files report works and all the files are ok
In order to ensure that all the XMLDB Editor xml files are generated properly
As a developer
I need to be able to run the Reconcile XMLDB files report and verify that everything is ok
Scenario: The Reconcile XMLDB files reports that all files are ok
Given I log in as "admin"
And I navigate to "Development > XMLDB editor" in site administration
When I follow "[Reconcile XMLDB files]"
Then I should see "Look for XMLDB files needing reconciling"
And I should see "All files are OK. No reconciling is needed."
+1
View File
@@ -1925,6 +1925,7 @@ class model {
$uniqueid = $this->get_time_splitting()->append_rangeindex($dbprediction->sampleid, $dbprediction->rangeindex);
$predictionrecords[$uniqueid]->id = $dbprediction->id;
}
$dbpredictions->close();
}
return $predictionrecords;
+8 -8
View File
@@ -15,13 +15,13 @@ Feature: User must accept policy when logging in and signing up
And I set the following fields to these values:
| Username | user1 |
| Password | user1 |
| Email address | user1@address.invalid |
| Email (again) | user1@address.invalid |
| Email address | student1@example.com |
| Email (again) | student1@example.com |
| First name | User1 |
| Last name | L1 |
And I press "Create my new account"
And I should see "Confirm your account"
And I should see "An email should have been sent to your address at user1@address.invalid"
And I should see "An email should have been sent to your address at student1@example.com"
And I confirm email for "user1"
And I should see "Thanks, User1 L1"
And I should see "Your registration has been confirmed"
@@ -45,14 +45,14 @@ Feature: User must accept policy when logging in and signing up
And I set the following fields to these values:
| Username | user1 |
| Password | user1 |
| Email address | user1@address.invalid |
| Email (again) | user1@address.invalid |
| Email address | user1@example.com |
| Email (again) | user1@example.com |
| First name | User1 |
| Last name | L1 |
| I understand and agree | 1 |
And I press "Create my new account"
And I should see "Confirm your account"
And I should see "An email should have been sent to your address at user1@address.invalid"
And I should see "An email should have been sent to your address at user1@example.com"
And I confirm email for "user1"
And I should see "Thanks, User1 L1"
And I should see "Your registration has been confirmed"
@@ -67,8 +67,8 @@ Feature: User must accept policy when logging in and signing up
Scenario Outline: Email validation during email registration
Given the following config values are set as admin:
| allowaccountssameemail | <allowsameemail> |
| registerauth | email |
| passwordpolicy | 0 |
| registerauth | email |
| passwordpolicy | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| s1 | John | Doe | s1@example.com |
+5
View File
@@ -117,6 +117,11 @@ abstract class frontend {
foreach ($enabled as $plugin => $info) {
// Create plugin front-end object.
$class = '\availability_' . $plugin . '\frontend';
if (!class_exists($class)) {
continue;
}
/** @var \core_availability\frontend $frontend */
$frontend = new $class();
// Add to array of required YUI modules.
+2 -3
View File
@@ -792,11 +792,10 @@ abstract class info {
// plugin could also rely on the completion plugin.
$pluginmanager = \core_plugin_manager::instance();
$enabled = $pluginmanager->get_enabled_plugins('availability');
$componentparams = new \stdClass();
foreach ($enabled as $plugin => $info) {
// Use the static method.
/** @var \core_availability\condition $class */
$class = '\availability_' . $plugin . '\condition';
if ($class::completion_value_used($course, $cmid)) {
if (class_exists($class) && $class::completion_value_used($course, $cmid)) {
return true;
}
}
+2 -2
View File
@@ -220,9 +220,9 @@ class tree extends tree_node {
// First see if it's a condition. These have a defined type.
if (isset($child->type)) {
// Look for a plugin of this type.
/** @var \core_availability\condition $classname */
$classname = '\availability_' . $child->type . '\condition';
if (!array_key_exists($child->type, $enabled)) {
if (!array_key_exists($child->type, $enabled) || !class_exists($classname)) {
if ($lax) {
// On load of existing settings, ignore if class
// doesn't exist.
@@ -197,8 +197,7 @@ abstract class restore_qtype_plugin extends restore_plugin {
$this->questionanswercacheid = $newquestionid;
// Cache all cleaned answers for a simple text match.
foreach ($answers as $answer) {
// MDL-30018: Clean in the same way as {@link xml_writer::xml_safe_utf8()}.
$clean = preg_replace('/[\x-\x8\xb-\xc\xe-\x1f\x7f]/is','', $answer->answer); // Clean CTRL chars.
$clean = core_text::trim_ctrl_chars($answer->answer); // Clean CTRL chars.
$clean = preg_replace("/\r\n|\r/", "\n", $clean); // Normalize line ending.
$this->questionanswercache[$clean] = $answer->id;
}
+1 -2
View File
@@ -5271,8 +5271,7 @@ class restore_create_categories_and_questions extends restore_structure_step {
$potentialhints = $DB->get_records('question_hints',
array('questionid' => $newquestionid), '', 'id, hint');
foreach ($potentialhints as $potentialhint) {
// Clean in the same way than {@link xml_writer::xml_safe_utf8()}.
$cleanhint = preg_replace('/[\x-\x8\xb-\xc\xe-\x1f\x7f]/is','', $potentialhint->hint); // Clean CTRL chars.
$cleanhint = core_text::trim_ctrl_chars($potentialhint->hint); // Clean CTRL chars.
$cleanhint = preg_replace("/\r\n|\r/", "\n", $cleanhint); // Normalize line ending.
if ($cleanhint === $data->hint) {
$newitemid = $data->id;
+3 -3
View File
@@ -253,14 +253,14 @@ class xml_writer {
}
/**
* Perform some UTF-8 cleaning, stripping the control chars (\x0-\x1f)
* but tabs (\x9), newlines (\xa) and returns (\xd). The delete control
* Perform some UTF-8 cleaning, stripping the control chars (\x00-\x1f)
* but tabs (\x09), newlines (\xa) and returns (\xd). The delete control
* char (\x7f) is also included. All them are forbiden in XML 1.0 specs.
* The expression below seems to be UTF-8 safe too because it simply
* ignores the rest of characters. Also normalize linefeeds and return chars.
*/
protected function xml_safe_utf8($content) {
$content = preg_replace('/[\x-\x8\xb-\xc\xe-\x1f\x7f]/is', '', $content ?? ''); // clean CTRL chars.
$content = core_text::trim_ctrl_chars($content ?? '');
$content = preg_replace("/\r\n|\r/", "\n", $content); // Normalize line&return=>line
return fix_utf8($content);
}
+112 -58
View File
@@ -60,6 +60,7 @@ if (!empty($issuedbadge->recipient->id)) {
$assertionid = $assertion->get_assertion_hash();
$assertionentityid = $assertiondata['id'];
$badgeadded = false;
$issuerexists = false;
if (badges_open_badges_backpack_api() == OPEN_BADGES_V2) {
$sitebackpack = badges_get_site_primary_backpack();
$api = new \core_badges\backpack_api($sitebackpack);
@@ -71,62 +72,75 @@ if (!empty($issuedbadge->recipient->id)) {
$issuer = $assertion->get_issuer();
if (!($issuerentityid = badges_external_get_mapping($sitebackpack->id, OPEN_BADGES_V2_TYPE_ISSUER, $issuer['email']))) {
$response = $api->put_issuer($issuer);
if (!$response) {
throw new moodle_exception('invalidrequest', 'error');
if ($response) {
$issuerexists = true;
$issuerentityid = $response->id;
badges_external_create_mapping(
$sitebackpack->id,
OPEN_BADGES_V2_TYPE_ISSUER,
$issuer['email'],
$issuerentityid,
);
}
$issuerentityid = $response->id;
badges_external_create_mapping($sitebackpack->id, OPEN_BADGES_V2_TYPE_ISSUER, $issuer['email'],
$issuerentityid);
}
// Create badge.
$badge = $assertion->get_badge_class(false);
$badgeid = $assertion->get_badge_id();
if (!($badgeentityid = badges_external_get_mapping($sitebackpack->id, OPEN_BADGES_V2_TYPE_BADGE, $badgeid))) {
$response = $api->put_badgeclass($issuerentityid, $badge);
if (!$response) {
throw new moodle_exception('invalidrequest', 'error');
if ($issuerexists) {
// Create badge.
$badge = $assertion->get_badge_class(false);
$badgeid = $assertion->get_badge_id();
if (!($badgeentityid = badges_external_get_mapping($sitebackpack->id, OPEN_BADGES_V2_TYPE_BADGE, $badgeid))) {
$response = $api->put_badgeclass($issuerentityid, $badge);
if ($response) {
$badgeentityid = $response->id;
badges_external_create_mapping(
$sitebackpack->id,
OPEN_BADGES_V2_TYPE_BADGE,
$badgeid,
$badgeentityid,
);
}
}
$badgeentityid = $response->id;
badges_external_create_mapping($sitebackpack->id, OPEN_BADGES_V2_TYPE_BADGE, $badgeid,
$badgeentityid);
}
// Create assertion (Award the badge!).
$assertionentityid = badges_external_get_mapping(
$sitebackpack->id,
OPEN_BADGES_V2_TYPE_ASSERTION,
$assertionid
);
if ($assertionentityid && strpos($sitebackpack->backpackapiurl, 'badgr')) {
$assertionentityid = badges_generate_badgr_open_url(
$sitebackpack,
OPEN_BADGES_V2_TYPE_ASSERTION,
$assertionentityid
);
}
// Create an assertion for the recipient in the issuer's account.
if (!$assertionentityid) {
$response = $api->put_badgeclass_assertion($badgeentityid, $assertiondata);
if (!$response) {
throw new moodle_exception('invalidrequest', 'error');
}
$assertionentityid = badges_generate_badgr_open_url($sitebackpack, OPEN_BADGES_V2_TYPE_ASSERTION, $response->id);
$badgeadded = true;
badges_external_create_mapping($sitebackpack->id, OPEN_BADGES_V2_TYPE_ASSERTION, $assertionid,
$response->id);
} else {
// An assertion already exists. Make sure it's up to date.
$internalid = badges_external_get_mapping(
// Create assertion (Award the badge!).
$assertionentityid = badges_external_get_mapping(
$sitebackpack->id,
OPEN_BADGES_V2_TYPE_ASSERTION,
$assertionid,
'externalid'
$assertionid
);
$response = $api->update_assertion($internalid, $assertiondata);
if (!$response) {
throw new moodle_exception('invalidrequest', 'error');
if ($assertionentityid && strpos($sitebackpack->backpackapiurl, 'badgr')) {
$assertionentityid = badges_generate_badgr_open_url(
$sitebackpack,
OPEN_BADGES_V2_TYPE_ASSERTION,
$assertionentityid
);
}
// Create an assertion for the recipient in the issuer's account.
if (!$assertionentityid) {
$response = $api->put_badgeclass_assertion($badgeentityid, $assertiondata);
if ($response) {
$assertionentityid = badges_generate_badgr_open_url(
$sitebackpack,
OPEN_BADGES_V2_TYPE_ASSERTION,
$response->id,
);
$badgeadded = true;
badges_external_create_mapping(
$sitebackpack->id,
OPEN_BADGES_V2_TYPE_ASSERTION,
$assertionid,
$response->id,
);
}
} else {
// An assertion already exists. Make sure it's up to date.
$internalid = badges_external_get_mapping(
$sitebackpack->id,
OPEN_BADGES_V2_TYPE_ASSERTION,
$assertionid,
'externalid'
);
$response = $api->update_assertion($internalid, $assertiondata);
}
}
}
@@ -136,21 +150,61 @@ if (!empty($issuedbadge->recipient->id)) {
// - If a user and site backpack have the same provider we can skip this as Badgr automatically maps recipients
// based on email address.
// - This is only needed when the backpacks are from different regions.
if ($assertionentityid && !badges_external_get_mapping($userbackpack->id, OPEN_BADGES_V2_TYPE_ASSERTION, $assertionid)) {
if (
$assertionentityid
&& (!$issuerexists || !badges_external_get_mapping($userbackpack->id, OPEN_BADGES_V2_TYPE_ASSERTION, $assertionid))
) {
$userapi = new \core_badges\backpack_api($userbackpack, $backpack);
$userapi->authenticate();
$response = $userapi->import_badge_assertion($assertionentityid);
if (!$response) {
throw new moodle_exception('invalidrequest', 'error');
if ($response) {
$assertionentityid = $response->id;
$badgeadded = true;
badges_external_create_mapping(
$userbackpack->id,
OPEN_BADGES_V2_TYPE_ASSERTION,
$assertionid,
$assertionentityid,
);
}
$assertionentityid = $response->id;
$badgeadded = true;
badges_external_create_mapping($userbackpack->id, OPEN_BADGES_V2_TYPE_ASSERTION, $assertionid,
$assertionentityid);
}
$response = $badgeadded ? ['success' => 'addedtobackpack'] : ['warning' => 'existsinbackpack'];
redirect(new moodle_url('/badges/mybadges.php', $response));
if ($badgeadded) {
$message = get_string('addedtobackpack', 'badges');
$messagetype = \core\output\notification::NOTIFY_SUCCESS;
} else {
if (isset($userapi) && !empty($userapi->get_errors())) {
// If the api used to import the badge to the backpack has errors, show them to inform the user.
if (array_filter($userapi->get_errors(), fn($element) => str_contains($element, "DUPLICATE_BADGE"))) {
// Duplicated badges are displayed as a warning.
$message = get_string('existsinbackpack', 'badges');
$messagetype = \core\output\notification::NOTIFY_WARNING;
} else {
// If the userapi has any other errors, we will use those to inform the user.
$message = get_string(
'error:cannotsendtobackpack',
'badges',
implode($userapi->get_errors()),
);
$messagetype = \core\output\notification::NOTIFY_ERROR;
}
} else if (isset($api) && !empty($api->get_errors())) {
// If the api used to create/update the issuer has errors, show them to inform the user.
$errors = $api->get_errors() ?? [get_string('invalidrequest', 'error')];
$message = get_string(
'error:cannotsendtobackpack',
'badges',
implode($errors),
);
$messagetype = \core\output\notification::NOTIFY_ERROR;
}
}
redirect(
url: new moodle_url('/badges/mybadges.php'),
message: $message,
messagetype: $messagetype,
);
} else {
redirect(new moodle_url('/badges/mybadges.php'));
}
+1 -1
View File
@@ -56,7 +56,7 @@ if ($action == 'delete' && $confirm && confirm_sesskey()) {
} else {
$msg = get_string('sitebackpacknotdeleted', 'badges');
}
} else if ($action == 'moveup' || $action == 'movedown') {
} else if (($action == 'moveup' || $action == 'movedown') && confirm_sesskey()) {
// If no backpack has been selected, there isn't anything to move.
if (empty($id)) {
redirect($url);
+14
View File
@@ -668,6 +668,20 @@ class backpack_api {
return backpack_api_mapping::get_authentication_error();
}
/**
* List all errors occurred during the requests to the backpack.
*
* @return array The list of errors.
*/
public function get_errors(): array {
$errors = [];
foreach ($this->mappings as $mapping) {
$errors = array_merge($errors, $mapping->get_errors());
}
return $errors;
}
/**
* Get the list of badges in a collection.
*
+40
View File
@@ -85,6 +85,9 @@ class backpack_api_mapping {
/** @var int OpenBadges version 1 or 2. */
protected $backpackapiversion;
/** @var array Errors encountered during the request. */
protected $errors = [];
/**
* Create a mapping.
*
@@ -150,6 +153,26 @@ class backpack_api_mapping {
return self::$authenticationerror;
}
/**
* Get the errors encountered during the request.
*
* @return array The list of errors.
*/
public function get_errors() {
return $this->errors;
}
/**
* Add an error to the list of errors.
*
* @param string $error The error message.
* @return self This instance for method chaining.
*/
public function add_error(string $error): self {
$this->errors[] = $error;
return $this;
}
/**
* Does the action match this mapping?
*
@@ -372,6 +395,23 @@ class backpack_api_mapping {
$response = $curl->put($url, $post, $options);
}
$response = json_decode($response);
if ($response === null) {
$this->add_error(get_string('invalidrequest', 'error'));
return null;
}
if (isset($response->status) && isset($response->status->success) && $response->status->success != true) {
// If the response wasn't successful, store the errors and return null.
if (isset($response->validationErrors)) {
$error = implode(', ', $response->validationErrors);
} else if (isset($response->status->description)) {
$error = $response->status->description;
} else {
$error = get_string('invalidrequest', 'error');
}
$this->add_error($error);
return null;
}
if (isset($response->result)) {
$response = $response->result;
}
@@ -56,13 +56,13 @@
<td> {{{backpackweburl}}} </td>
<td>
{{#canmoveup}}
<a href="{{baseurl}}?id={{id}}&action=moveup">{{#pix}}t/up, core,{{#str}}moveup{{/str}}{{/pix}}</a>
<a href="{{baseurl}}?id={{id}}&sesskey={{sesskey}}&action=moveup">{{#pix}}t/up, core,{{#str}}moveup{{/str}}{{/pix}}</a>
{{/canmoveup}}
{{^canmoveup}}
{{#pix}}spacer, moodle{{/pix}}
{{/canmoveup}}
{{#canmovedown}}
<a href="{{baseurl}}?id={{id}}&action=movedown">{{#pix}}t/down, core,{{#str}}movedown{{/str}}{{/pix}}</a>
<a href="{{baseurl}}?id={{id}}&sesskey={{sesskey}}&action=movedown">{{#pix}}t/down, core,{{#str}}movedown{{/str}}{{/pix}}</a>
{{/canmovedown}}
{{^canmovedown}}
{{#pix}}spacer, moodle{{/pix}}
+16 -6
View File
@@ -15,7 +15,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Script to let a user edit the properties of a particular RSS feed.
* Script to let a user view the output of a particular RSS feed.
*
* @package block_rss_client
* @copyright 2009 Tim Hunt
@@ -26,9 +26,6 @@ require_once(__DIR__ . '/../../config.php');
require_once($CFG->libdir .'/simplepie/moodle_simplepie.php');
require_login();
if (isguestuser()) {
throw new \moodle_exception('guestsarenotallowed');
}
$returnurl = optional_param('returnurl', '', PARAM_LOCALURL);
$courseid = optional_param('courseid', 0, PARAM_INT);
@@ -46,6 +43,11 @@ if ($courseid) {
$PAGE->set_context($context);
}
$managesharedfeeds = has_capability('block/rss_client:manageanyfeeds', $context);
if (!$managesharedfeeds) {
require_capability('block/rss_client:manageownfeeds', $context);
}
$urlparams = array('rssid' => $rssid);
if ($courseid) {
$urlparams['courseid'] = $courseid;
@@ -56,10 +58,18 @@ if ($returnurl) {
$PAGE->set_url('/blocks/rss_client/viewfeed.php', $urlparams);
$PAGE->set_pagelayout('popup');
$rssrecord = $DB->get_record('block_rss_client', array('id' => $rssid), '*', MUST_EXIST);
if ($managesharedfeeds) {
$select = 'id = :id AND (userid = :userid OR shared = 1)';
} else {
$select = 'id = :id AND userid = :userid';
}
$rssrecord = $DB->get_record_select('block_rss_client', $select, [
'id' => $rssid,
'userid' => $USER->id,
], '*', MUST_EXIST);
$rss = new moodle_simplepie($rssrecord->url);
if ($rss->error()) {
debugging($rss->error());
throw new \moodle_exception('errorfetchingrssfeed');
+26 -17
View File
@@ -34,15 +34,21 @@ $PAGE->set_url(new moodle_url('/blog/external_blogs.php'));
require_capability('moodle/blog:manageexternal', $context);
$delete = optional_param('delete', null, PARAM_INT);
$confirm = optional_param('confirm', false, PARAM_BOOL);
$strexternalblogs = get_string('externalblogs', 'blog');
$straddnewexternalblog = get_string('addnewexternalblog', 'blog');
$strblogs = get_string('blogs', 'blog');
$message = null;
if ($delete && confirm_sesskey()) {
$externalblog = $DB->get_record('blog_external', array('id' => $delete));
if ($externalblog->userid == $USER->id) {
$PAGE->set_title("{$strblogs}: {$strexternalblogs}");
$PAGE->set_pagelayout('standard');
if ($delete) {
$externalblog = $DB->get_record('blog_external', ['id' => $delete, 'userid' => $USER->id], '*', MUST_EXIST);
if ($confirm) {
require_sesskey();
// Delete the external blog.
$DB->delete_records('blog_external', array('id' => $delete));
@@ -60,23 +66,28 @@ if ($delete && confirm_sesskey()) {
$event = \core\event\blog_external_removed::create($eventparms);
$event->add_record_snapshot('blog_external', $externalblog);
$event->trigger();
$message = get_string('externalblogdeleted', 'blog');
redirect($PAGE->url, get_string('externalblogdeleted', 'blog'));
} else {
echo $OUTPUT->header();
echo $OUTPUT->heading("{$strexternalblogs}: " . s($externalblog->name), 2);
echo $OUTPUT->confirm(
get_string('deleteexternalblog', 'blog'),
new moodle_url($PAGE->url->out_omit_querystring(), ['delete' => $delete, 'confirm' => 1]),
$PAGE->url,
);
echo $OUTPUT->footer();
die;
}
}
$blogs = $DB->get_records('blog_external', array('userid' => $USER->id));
$PAGE->set_heading(fullname($USER));
$PAGE->set_title("$strblogs: $strexternalblogs");
$PAGE->set_pagelayout('standard');
echo $OUTPUT->header();
echo $OUTPUT->heading($strexternalblogs, 2);
if (!empty($message)) {
echo $OUTPUT->notification($message);
}
echo $OUTPUT->box_start('generalbox boxaligncenter');
if (!empty($blogs)) {
@@ -99,10 +110,8 @@ if (!empty($blogs)) {
$editurl = new moodle_url('/blog/external_blog_edit.php', array('id' => $blog->id));
$editicon = $OUTPUT->action_icon($editurl, new pix_icon('t/edit', get_string('editexternalblog', 'blog')));
$deletelink = new moodle_url('/blog/external_blogs.php', array('delete' => $blog->id, 'sesskey' => sesskey()));
$action = new confirm_action(get_string('externalblogdeleteconfirm', 'blog'));
$deleteicon = $OUTPUT->action_icon($deletelink, new pix_icon('t/delete', get_string('deleteexternalblog', 'blog')),
$action);
$deletelink = new moodle_url('/blog/external_blogs.php', ['delete' => $blog->id]);
$deleteicon = $OUTPUT->action_icon($deletelink, new pix_icon('t/delete', get_string('deleteexternalblog', 'blog')));
$table->data[] = new html_table_row(array($blog->name,
$blog->url,
@@ -55,11 +55,11 @@ class cohorts extends system_report {
"{$entitymainalias}.component");
// Check if report needs to show a specific category.
$contextid = $this->get_parameter('contextid', 0, PARAM_INT);
$showall = $this->get_parameter('showall', true, PARAM_BOOL);
if (!$showall) {
if (!$this->get_context() instanceof context_system || !$this->get_parameter('showall', false, PARAM_BOOL)) {
$paramcontextid = database::generate_param_name();
$this->add_base_condition_sql("{$entitymainalias}.contextid = :$paramcontextid", [$paramcontextid => $contextid]);
$this->add_base_condition_sql("{$entitymainalias}.contextid = :{$paramcontextid}", [
$paramcontextid => $this->get_context()->id,
]);
}
// Now we can call our helper methods to add the content we want to include in the report.
@@ -77,14 +77,7 @@ class cohorts extends system_report {
* @return bool
*/
protected function can_view(): bool {
$contextid = $this->get_parameter('contextid', 0, PARAM_INT);
if ($contextid) {
$context = context::instance_by_id($contextid, MUST_EXIST);
} else {
$context = context_system::instance();
}
return has_any_capability(['moodle/cohort:manage', 'moodle/cohort:view'], $context);
return has_any_capability(['moodle/cohort:manage', 'moodle/cohort:view'], $this->get_context());
}
/**
@@ -98,10 +91,8 @@ class cohorts extends system_report {
public function add_columns(cohort $cohortentity): void {
$entitymainalias = $cohortentity->get_table_alias('cohort');
$showall = $this->get_parameter('showall', false, PARAM_BOOL);
// Category column. An extra callback is appended in order to extend the current column formatting.
if ($showall) {
if ($this->get_context() instanceof context_system && $this->get_parameter('showall', false, PARAM_BOOL)) {
$this->add_column_from_entity('cohort:context')
->add_callback(static function(string $value, stdClass $cohort): string {
$context = context::instance_by_id($cohort->contextid);
@@ -195,10 +186,11 @@ class cohorts extends system_report {
*/
protected function add_actions(): void {
$contextid = $this->get_parameter('contextid', 0, PARAM_INT);
$showall = $this->get_parameter('showall', true, PARAM_BOOL);
$returnurl = (new moodle_url('/cohort/index.php',
['id' => ':id', 'contextid' => $contextid, 'showall' => $showall]))->out(false);
$returnurl = (new moodle_url('/cohort/index.php', [
'id' => ':id',
'contextid' => $this->get_context()->id,
'showall' => $this->get_parameter('showall', false, PARAM_BOOL),
]))->out(false);
// Hide action. It will be only shown if the property 'visible' is true and user has 'moodle/cohort:manage' capabillity.
$this->add_action((new action(
+1 -2
View File
@@ -104,8 +104,7 @@ if ($editcontrols = cohort_edit_controls($context, $baseurl)) {
echo $OUTPUT->render($editcontrols);
}
$reportparams = ['contextid' => $context->id, 'showall' => $showall];
$report = system_report_factory::create(cohorts::class, $context, '', '', 0, $reportparams);
$report = system_report_factory::create(cohorts::class, $context, '', '', 0, ['showall' => $showall]);
// Check if it needs to search by name.
if (!empty($searchquery)) {
+35 -10
View File
@@ -941,6 +941,8 @@ class core_course_external extends external_api {
$params = self::validate_parameters(self::create_courses_parameters(),
array('courses' => $courses));
$courseconfig = get_config('moodlecourse');
$availablethemes = core_component::get_plugin_list('theme');
$availablelangs = get_string_manager()->get_list_of_translations();
@@ -967,6 +969,14 @@ class core_course_external extends external_api {
throw new moodle_exception('errorinvalidparam', 'webservice', '', 'shortname');
}
// Make sure start/end date are correctly set.
if (!array_key_exists('startdate', $course)) {
$course['startdate'] = usergetmidnight(time());
}
if (!array_key_exists('enddate', $course) && $courseconfig->courseenddateenabled) {
$course['enddate'] = $course['startdate'] + $courseconfig->courseduration;
}
// Make sure lang is valid
if (array_key_exists('lang', $course)) {
if (empty($availablelangs[$course['lang']])) {
@@ -988,6 +998,8 @@ class core_course_external extends external_api {
}
}
$course['showactivitydates'] = $courseconfig->showactivitydates;
//force visibility if ws user doesn't have the permission to set it
$category = $DB->get_record('course_categories', array('id' => $course['categoryid']));
if (!has_capability('moodle/course:visibility', $context)) {
@@ -995,7 +1007,6 @@ class core_course_external extends external_api {
}
//set default value for completion
$courseconfig = get_config('moodlecourse');
if (completion_info::is_enabled_for_site()) {
if (!array_key_exists('enablecompletion', $course)) {
$course['enablecompletion'] = $courseconfig->enablecompletion;
@@ -4252,7 +4263,7 @@ class core_course_external extends external_api {
self::validate_context($usercontext);
if ($userid != $USER->id and !has_capability('moodle/user:viewdetails', $usercontext)) {
if ($userid != $USER->id && !has_capability('moodle/user:viewalldetails', $usercontext)) {
return array();
}
@@ -4302,22 +4313,28 @@ class core_course_external extends external_api {
* @param int $groupid Group id from which the users will be obtained
* @param bool $onlyactive Whether to return only the active enrolled users or all enrolled users in the course.
* @return array List of users
* @throws invalid_parameter_exception
*/
public static function get_enrolled_users_by_cmid(int $cmid, int $groupid = 0, bool $onlyactive = false) {
global $PAGE;
global $PAGE;
$warnings = [];
self::validate_parameters(self::get_enrolled_users_by_cmid_parameters(), [
'cmid' => $cmid,
'groupid' => $groupid,
'onlyactive' => $onlyactive,
[
'cmid' => $cmid,
'groupid' => $groupid,
'onlyactive' => $onlyactive,
] = self::validate_parameters(self::get_enrolled_users_by_cmid_parameters(), [
'cmid' => $cmid,
'groupid' => $groupid,
'onlyactive' => $onlyactive,
]);
list($course, $cm) = get_course_and_cm_from_cmid($cmid);
$coursecontext = context_course::instance($course->id);
self::validate_context($coursecontext);
course_require_view_participants($coursecontext);
$enrolledusers = get_enrolled_users($coursecontext, '', $groupid, 'u.*', null, 0, 0, $onlyactive);
$users = array_map(function ($user) use ($PAGE) {
@@ -4596,9 +4613,17 @@ class core_course_external extends external_api {
$coursecontext = context_course::instance($courseid);
self::validate_context($coursecontext);
$activeplugin = get_config('core', 'activitychooseractivefooter');
// The active plugin must be set, and be present on the site.
$activeplugin = clean_param(
get_config('core', 'activitychooseractivefooter'),
PARAM_COMPONENT,
);
if ($activeplugin !== COURSE_CHOOSER_FOOTER_NONE) {
if (
$activeplugin !== COURSE_CHOOSER_FOOTER_NONE &&
!empty($activeplugin) &&
core_component::get_component_directory($activeplugin) !== null
) {
$footerdata = component_callback($activeplugin, 'custom_chooser_footer', [$courseid, $sectionid]);
return [
'footer' => true,
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -422,8 +422,10 @@ export default class {
* @param {array} cmIds the list of course modules ids
* @param {bool} complete the new completion value
*/
cmCompletion(stateManager, cmIds, complete) {
async cmCompletion(stateManager, cmIds, complete) {
const newState = (complete) ? 1 : 0;
const action = (newState == 1) ? 'cm_complete' : 'cm_uncomplete';
const logEntry = this._getLoggerEntry(stateManager, action, cmIds);
stateManager.setReadOnly(false);
cmIds.forEach((id) => {
const element = stateManager.get('cm', id);
@@ -433,6 +435,7 @@ export default class {
}
});
stateManager.setReadOnly(true);
stateManager.addLoggerEntry(await logEntry);
}
/**
+3
View File
@@ -362,6 +362,9 @@ class stateactions {
// We need to get the latest modinfo on each iteration because the section numbers change.
$modinfo = get_fast_modinfo($course);
$section = $modinfo->get_section_info_by_id($sectionid, MUST_EXIST);
if (!course_can_delete_section($course, $section)) {
continue;
}
// Send all activity deletions.
if (!empty($modinfo->sections[$section->section])) {
foreach ($modinfo->sections[$section->section] as $modnumber) {
@@ -150,47 +150,3 @@ Feature: Course index completion icons
| 1 | False |
When I am on the "C1" "Course" page logged in as "student1"
And "Done" "icon" should exist in the "courseindex-content" "region"
@javascript
Scenario: Activities with custom completion rules could fail
Given the following "activity" exists:
| activity | scorm |
| course | C1 |
| name | Music history |
| packagefilepath | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip |
| maxattempt | 1 |
| latattemptlock | 1 |
# Add requirements
| completion | 2 |
| completionscorerequired | 90 |
Given I am on the "Music history" "scorm activity" page logged in as student1
# We need a little taller window because Firefox is, apparently, unable to auto-scroll within
# an iframe, so we need to ensure that the "Save changes" button is visible in the viewport.
And I change window size to "large"
And I press "Enter"
And I switch to the main frame
And I click on "Par?" "list_item"
And I switch to "scorm_object" iframe
And I wait until the page is ready
And I switch to the main frame
And I click on "Keeping Score" "list_item"
And I switch to "scorm_object" iframe
And I wait until the page is ready
And I switch to the main frame
And I click on "Other Scoring Systems" "list_item"
And I switch to "scorm_object" iframe
And I wait until the page is ready
And I switch to the main frame
And I click on "The Rules of Golf" "list_item"
And I switch to "scorm_object" iframe
And I wait until the page is ready
And I switch to the main frame
And I click on "Playing Golf Quiz" "list_item"
And I switch to "scorm_object" iframe
And I wait until the page is ready
And I click on "[id='question_com.scorm.golfsamples.interactions.playing_1_1']" "css_element"
And I press "Submit Answers"
And I wait until "Score: 20" "text" exists
And I switch to the main frame
And I click on "Exit activity" "link"
And "Failed" "icon" should exist in the "courseindex-content" "region"
+120
View File
@@ -0,0 +1,120 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
declare(strict_types=1);
namespace core_courseformat\external;
defined('MOODLE_INTERNAL') || die();
use core_courseformat\stateactions;
use core_courseformat\stateupdates;
global $CFG;
require_once($CFG->dirroot . '/webservice/tests/helpers.php');
/**
* Tests for the delete section test class.
*
* @package core_courseformat
* @copyright 2025 Laurent David <laurent.david@moodle.com>
* @category test
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @coversDefaultClass \core_courseformat\stateactions
*/
final class delete_section_test extends \externallib_advanced_testcase {
/**
* Setup to ensure that fixtures are loaded.
*/
public static function setupBeforeClass(): void { // phpcs:ignore
global $CFG;
require_once($CFG->dirroot . '/course/format/tests/fixtures/format_theunittestdelete.php');
}
/**
* Test the webservice can execute the section_delete action.
*
* @covers ::section_delete
* @dataProvider section_delete_provider
* @param int $sectionum
* @param string $format
* @param array $formatoptions
* @param int $expectedsectionum
*
* @throws \moodle_exception
*/
public function test_delete_section(int $sectionum, string $format, array $formatoptions, int $expectedsectionum): void {
$this->resetAfterTest();
$course =
$this->getDataGenerator()->create_course(array_merge(
['numsections' => $sectionum, 'format' => $format],
$formatoptions,
));
$teacher = $this->getDataGenerator()->create_and_enrol($course, 'editingteacher');
// Execute the method.
$courseformat = course_get_format($course->id);
$updates = new stateupdates($courseformat);
$modinfo = get_fast_modinfo($course);
$sections = $modinfo->get_section_info_all();
$sectionsid = array_map(function ($section) {
return $section->id;
}, $sections);
$actions = new stateactions();
$this->setUser($teacher);
$actions->section_delete(
$updates,
$course,
$sectionsid
);
// Check result.
$modinfo = get_fast_modinfo($course);
$sections = $modinfo->get_section_info_all();
$this->assertCount($expectedsectionum, $sections);
if ($format == 'theunittestdelete') {
$this->assertDebuggingCalled();
}
}
/**
* Data provider for the test_delete_section method.
*
* @return array
*/
public static function section_delete_provider(): array {
return [
'format topic' => [
'sectionum' => 4,
'format' => 'topics',
'formatoptions' => [],
'expectedsectionum' => 1,
],
'format theunittestdelete' => [
'sectionum' => 4,
'format' => 'theunittestdelete',
'formatoptions' => [],
'expectedsectionum' => 5,
],
'format theunittestdelete can delete' => [
'sectionum' => 4,
'format' => 'theunittestdelete',
'formatoptions' => ['can_delete_sections' => true],
'expectedsectionum' => 1,
],
];
}
}
@@ -0,0 +1,70 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
defined('MOODLE_INTERNAL') || die();
require_once(__DIR__ . '/format_theunittest.php');
/**
* Fixture for fake course format testing course format API.
*
* @package core_courseformat
* @copyright 2025 Laurent David <laurent.david@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class format_theunittestdelete extends format_theunittest {
/**
* Definitions of the additional options that format uses
*
* @param bool $foreditform
* @return array of options
*/
public function course_format_options($foreditform = false) {
static $courseformatoptions = false;
if ($courseformatoptions === false) {
$courseformatoptions = parent::course_format_options(true);
$courseformatoptionsadditional = [
'can_delete_sections' => [
'default' => false,
'type' => PARAM_BOOL,
],
];
$courseformatoptions = array_merge_recursive($courseformatoptions, $courseformatoptionsadditional);
}
return $courseformatoptions;
}
/**
* Whether this format allows to delete sections
*
* Here for test purpose we just can delete one section every two sections
*
* Do not call this function directly, instead use course_can_delete_section()
*
* @param int|stdClass|section_info $section
* @return bool
*/
public function can_delete_section($section) {
return $this->get_format_options()['can_delete_sections'] ?? false;
}
/**
* Returns true if this course format uses sections
*/
public function uses_sections() {
return true;
}
}
+8 -1
View File
@@ -1156,7 +1156,14 @@ class core_course_renderer extends plugin_renderer_base {
// This is a request for the course information.
$courseid = required_param('courseid', PARAM_INT);
$course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST);
$course = $DB->get_record('course', ['id' => $courseid], '*', IGNORE_MISSING);
if ($course === false) {
throw new \moodle_exception('invalidcourseid');
}
$coursecontext = context_course::instance($course->id, MUST_EXIST);
if ($course->visible == 0 && !has_capability('moodle/course:viewhiddencourses', $coursecontext)) {
throw new \moodle_exception('invalidcourseid');
}
$chelper = new coursecat_helper();
$chelper->set_show_courses(self::COURSECAT_SHOW_COURSES_EXPANDED);
+12
View File
@@ -3850,6 +3850,12 @@ final class externallib_test extends externallib_advanced_testcase {
$this->assignUserCapability('moodle/user:viewdetails', $usercontext, $teacherroleid);
// Sorted by course id DESC.
// User without moodle/user:viewalldetails capability will not be able to see the course details.
$result = core_course_external::get_recent_courses($student->id);
$this->assertCount(0, $result);
// User with moodle/user:viewalldetails capability will be able to see the course details.
$this->assignUserCapability('moodle/user:viewalldetails', $usercontext, $teacherroleid);
$result = core_course_external::get_recent_courses($student->id);
$this->assertCount(1, $result);
$this->assertEquals($courses[0]->id, array_shift($result)->id);
@@ -3953,6 +3959,12 @@ final class externallib_test extends externallib_advanced_testcase {
$this->assertEquals(2, count($users['users']));
$this->assertEquals($expectedusers, $users);
// Prohibit the capability for viewing course participants.
$this->unassignUserCapability('moodle/course:viewparticipants', null, null, $course1->id);
$this->expectException(required_capability_exception::class);
$this->expectExceptionMessage('Sorry, but you do not currently have permissions to do that (View participants)');
core_course_external::get_enrolled_users_by_cmid($forum1->cmid);
}
/**
+10 -1
View File
@@ -84,11 +84,20 @@ function filter_tex_sanitize_formula(string $texexp): string {
'\afterassignment', '\expandafter', '\noexpand', '\special',
'\let', '\futurelet', '\else', '\fi', '\chardef', '\makeatletter', '\afterground',
'\noexpand', '\line', '\mathcode', '\item', '\section', '\mbox', '\declarerobustcommand',
'\ExplSyntaxOn', '\pdffiledump',
'\ExplSyntaxOn', '\pdffiledump', '\mathtex',
];
$allowlist = ['inputenc'];
// Add encoded backslash (&#92;) versions of backslashed items to deny list.
$encodedslashdenylist = array_map(function($value) {
$encoded = str_replace('\\', '&#92;', $value);
// Return an encoded slash version if a slash is found, otherwise null so we can filter it off.
return $encoded != $value ? $encoded : null;
}, $denylist);
$encodedslashdenylist = array_filter($encodedslashdenylist);
$denylist = array_merge($denylist, $encodedslashdenylist);
// Prepare the denylist for regular expression.
$denylist = array_map(function($value){
return '/' . preg_quote($value, '/') . '/i';
@@ -203,7 +203,7 @@ class fetch extends external_api {
$definitionid,
'remark',
$filling['remark'],
(int) $filling['remarkformat']
(int) FORMAT_HTML
);
}
+5 -2
View File
@@ -857,16 +857,19 @@ class gradingform_guide_instance extends gradingform_instance {
parent::update($data);
foreach ($data['criteria'] as $criterionid => $record) {
// Hardcoding/defaulting to html format for new/existing record
$record['remarkformat'] = FORMAT_HTML;
if (!array_key_exists($criterionid, $currentgrade['criteria'])) {
$newrecord = array('instanceid' => $this->get_id(), 'criterionid' => $criterionid,
'score' => $record['score'], 'remarkformat' => FORMAT_MOODLE);
'score' => $record['score'], 'remarkformat' => $record['remarkformat']);
if (isset($record['remark'])) {
$newrecord['remark'] = $record['remark'];
}
$DB->insert_record('gradingform_guide_fillings', $newrecord);
} else {
$newrecord = array('id' => $currentgrade['criteria'][$criterionid]['id']);
foreach (array('score', 'remark'/*, 'remarkformat' TODO */) as $key) {
foreach (array('score', 'remark', 'remarkformat') as $key) {
if (isset($record[$key]) && $currentgrade['criteria'][$criterionid][$key] != $record[$key]) {
$newrecord[$key] = $record[$key];
}
@@ -196,7 +196,7 @@ class fetch extends external_api {
$definitionid,
'remark',
$filling['remark'],
(int) $filling['remarkformat']
(int) FORMAT_HTML
);
}
+5 -2
View File
@@ -863,16 +863,19 @@ class gradingform_rubric_instance extends gradingform_instance {
$currentgrade = $this->get_rubric_filling();
parent::update($data);
foreach ($data['criteria'] as $criterionid => $record) {
// Hardcoding/defaulting to html format for new/existing record
$record['remarkformat'] = FORMAT_HTML;
if (!array_key_exists($criterionid, $currentgrade['criteria'])) {
$newrecord = array('instanceid' => $this->get_id(), 'criterionid' => $criterionid,
'levelid' => $record['levelid'], 'remarkformat' => FORMAT_MOODLE);
'levelid' => $record['levelid'], 'remarkformat' => $record['remarkformat']);
if (isset($record['remark'])) {
$newrecord['remark'] = $record['remark'];
}
$DB->insert_record('gradingform_rubric_fillings', $newrecord);
} else {
$newrecord = array('id' => $currentgrade['criteria'][$criterionid]['id']);
foreach (array('levelid', 'remark'/*, 'remarkformat' */) as $key) {
foreach (array('levelid', 'remark', 'remarkformat') as $key) {
// TODO MDL-31235 format is not supported yet
if (isset($record[$key]) && $currentgrade['criteria'][$criterionid][$key] != $record[$key]) {
$newrecord[$key] = $record[$key];
+10
View File
@@ -115,6 +115,16 @@ class gradingform_rubric_renderer extends plugin_renderer_base {
$descriptiontdparams['aria-label'] = get_string('criterion', 'gradingform_rubric', s($criterion['description']));
}
// Default value for criterion ids.
// Edge case: submitting empty grade when remark field is disabled.
// Reason: we need the criteria keys for the clear_attempt to clear the rubric fillings.
if ($mode == gradingform_rubric_controller::DISPLAY_EVAL) {
$criteriontemplate .= html_writer::empty_tag('input', [
'type' => 'hidden',
'name' => '{NAME}[criteria][{CRITERION-id}][]',
]);
}
// Description cell.
$criteriontemplate .= html_writer::tag('td', $description, $descriptiontdparams);
+1
View File
@@ -77,6 +77,7 @@ class grade_import_form extends moodleform {
$mform->addElement('text', 'iprestriction', get_string('keyiprestriction', 'userkey'), array('size'=>80));
$mform->addHelpButton('iprestriction', 'keyiprestriction', 'userkey');
$mform->setDefault('iprestriction', getremoteaddr()); // own IP - just in case somebody does not know what user key is
$mform->setType('iprestriction', PARAM_RAW_TRIMMED);
$mform->addElement('date_time_selector', 'validuntil', get_string('keyvaliduntil', 'userkey'), array('optional'=>true));
$mform->addHelpButton('validuntil', 'keyvaliduntil', 'userkey');
@@ -140,17 +140,21 @@ class provider implements
break;
default:
if (strpos($name, 'grade_report_grader_collapsed_categories') === 0) {
$prefname = 'grade_report_grader_collapsed_categories';
$prefname = $name;
$courseid = substr($name, strlen('grade_report_grader_collapsed_categories'));
$transformedvalue = $value;
$course = get_course($courseid);
$prefdescription = get_string(
'privacy:request:preference:'.$prefname,
'gradereport_grader',
(object) [
'name' => $course->fullname,
]
);
try {
$course = get_course($courseid);
$prefdescription = get_string(
'privacy:request:preference:grade_report_grader_collapsed_categories',
'gradereport_grader',
(object) [
'name' => $course->fullname,
]
);
} catch (\dml_missing_record_exception $exception) {
continue 2;
}
}
}
@@ -90,12 +90,22 @@ final class provider_test extends \core_privacy\tests\provider_testcase {
* Ensure that export_user_preferences returns preferences.
*/
public function test_export_user_preferences_multiple(): void {
// Create a course and add a user preference.
$user = $this->getDataGenerator()->create_user();
$this->setUser($user);
$course = $this->getDataGenerator()->create_course();
$collapsed = serialize(['aggregatesonly' => array(), 'gradesonly' => array()]);
set_user_preference('grade_report_grader_collapsed_categories'.$course->id, $collapsed, $user);
// Set preference for an invalid course.
set_user_preference('grade_report_grader_collapsed_categories42', serialize(['gradesonly' => []]));
// Set preferences for a couple of valid courses.
$courseone = $this->getDataGenerator()->create_course();
$courseonepreferencename = "grade_report_grader_collapsed_categories{$courseone->id}";
$courseonepreferencevalue = serialize(['aggregatesonly' => [], 'gradesonly' => []]);
set_user_preference($courseonepreferencename, $courseonepreferencevalue);
$coursetwo = $this->getDataGenerator()->create_course();
$coursetwopreferencename = "grade_report_grader_collapsed_categories{$coursetwo->id}";
$coursetwopreferencevalue = serialize(['gradesonly' => [], 'aggregatesonly' => []]);
set_user_preference($coursetwopreferencename, $coursetwopreferencevalue);
// Validate exported data.
provider::export_user_preferences($user->id);
@@ -104,10 +114,22 @@ final class provider_test extends \core_privacy\tests\provider_testcase {
$writer = writer::with_context($context);
$this->assertTrue($writer->has_any_data());
$prefs = $writer->get_user_preferences('gradereport_grader');
$this->assertCount(1, (array) $prefs);
$this->assertCount(2, (array) $prefs);
$this->assertEquals($courseonepreferencevalue, $prefs->{$courseonepreferencename}->value);
$this->assertEquals(
get_string('privacy:request:preference:grade_report_grader_collapsed_categories', 'gradereport_grader', ['name' => $course->fullname]),
$prefs->grade_report_grader_collapsed_categories->description
get_string('privacy:request:preference:grade_report_grader_collapsed_categories', 'gradereport_grader', [
'name' => $courseone->fullname,
]),
$prefs->{$courseonepreferencename}->description,
);
$this->assertEquals($coursetwopreferencevalue, $prefs->{$coursetwopreferencename}->value);
$this->assertEquals(
get_string('privacy:request:preference:grade_report_grader_collapsed_categories', 'gradereport_grader', [
'name' => $coursetwo->fullname,
]),
$prefs->{$coursetwopreferencename}->description,
);
}
}
+2
View File
@@ -107,6 +107,7 @@ switch ($itemtype) {
// display the user select zero state.
if (is_null($itemid) || !array_key_exists($itemid, grade_report::get_gradable_users($courseid, $currentgroup))) {
$itemtype = 'user_select';
unset($SESSION->gradereport_singleview["useritem-{$context->id}"]);
}
break;
case 'grade_select':
@@ -129,6 +130,7 @@ switch ($itemtype) {
// The item id (grade item id) cannot be defined, display the grade select zero state.
if (is_null($itemid) || !array_key_exists($itemid, $gtree->get_items())) {
$itemtype = 'grade_select';
unset($SESSION->gradereport_singleview["gradeitem-{$context->id}"]);
}
break;
}
@@ -237,6 +237,9 @@ Feature: We can use Single view
When I navigate to "View > Single view" in the course gradebook
Then I should see "Search for a user to view all their grades" in the "region-main" "region"
And I should not see "Gronya,Beecham" in the "region-main" "region"
# edge case coverage: to ensure session variable not causing error upon second visit
And I reload the page
And I should see "Search for a user to view all their grades" in the "region-main" "region"
Scenario: Teacher does not see his last viewed user report if that user is no longer enrolled in the course.
Given I navigate to "View > Single view" in the course gradebook
@@ -247,6 +250,9 @@ Feature: We can use Single view
When I am on the "Course 1" "grades > Single view > View" page
Then I should see "Search for a user to view all their grades" in the "region-main" "region"
And I should not see "Gronya,Beecham" in the "region-main" "region"
# edge case coverage: to ensure session variable not causing error upon second visit
And I reload the page
And I should see "Search for a user to view all their grades" in the "region-main" "region"
Scenario: Teacher does not see his last viewed grade item report if the item no longer exists in the course.
Given I navigate to "View > Single view" in the course gradebook
@@ -258,3 +264,6 @@ Feature: We can use Single view
When I navigate to "View > Single view" in the course gradebook
Then I should see "Select a grade item above" in the "region-main" "region"
And I should not see "Test grade item" in the "region-main" "region"
# edge case coverage: to ensure session variable not causing error upon second visit
And I reload the page
And I should see "Select a grade item above" in the "region-main" "region"
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+3 -3
View File
@@ -20,11 +20,11 @@
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
* {@link https://moodledev.io/general/projects/api/amos}) using the
* list of strings defined in install/stringnames.txt file.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();

Some files were not shown because too many files have changed in this diff Show More