Compare commits

...

1118 Commits

Author SHA1 Message Date
Huong Nguyen 1a1d59ef61 Moodle release 3.9.25 2023-12-08 09:21:37 +07:00
Sara Arjona a2c785e795 weekly release 3.9.24+ 2023-12-07 16:22:24 +01:00
Paul Holden 9badb9eab5 MDL-79980 mod_survey: remove responses link if user cannot access. 2023-12-07 12:10:16 +01:00
Brendan Heywood c142ad2370 MDL-80309 tasks: Clean up mtrace logs 2023-12-07 12:07:12 +08:00
Paul Holden 6ebae3663e MDL-79980 mod_survey: respect activity group mode getting report. 2023-12-07 09:12:26 +08:00
Stephan Robotta 39c6bfbfdb MDL-41465 reports: In separate group mode, limit to same group users 2023-12-06 13:47:54 +07:00
Huong Nguyen bcd17420a8 MDL-79759 repository_url: Remove types properties 2023-12-05 08:48:00 +07:00
David Woloszyn 8fcbfe5218 MDL-79759 repository_url: Limit css imports and remove fragments
There are checks to urls that attempt to limit recurrsion when
parse_file is called. This is problematic for css import urls that
can call an indefinite amount of nested import urls. An import limit
has been introduced to address this. Fragments have also been removed.
2023-12-04 15:07:36 +07:00
Stevani Andolo e1c1ff4be3 MDL-80174 tool_log: ensure "other" data is safely unserialized. 2023-12-04 13:42:39 +07:00
Paul Holden 031220a009 MDL-80268 badges: require capability to view awarded badges. 2023-12-04 10:16:24 +07:00
Paul Holden acb2ce417f MDL-79797 backup: ensure block config is safely unserialized. 2023-12-01 06:17:20 +01:00
Ilya Tregubov 89ec99bfa3 weekly release 3.9.24+ 2023-12-01 13:12:52 +08:00
Ilya Tregubov a30aece8ad Merge branch 'MDL-79603-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-11-28 13:55:32 +08:00
Huong Nguyen 2d08bba8ab weekly release 3.9.24+ 2023-11-24 12:24:05 +07:00
Huong Nguyen 8c7fcbf590 Merge branch 'MDL-78496-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2023-11-23 09:24:45 +07:00
Andrew Nicols ea2f0af064 MDL-78496 environment: Moodle 4.4 requirements
The only changes to requirements since Moodle 4.3 are increases to:

* the minimum PHP version required; and
* the minimum required Moodle version.
2023-11-17 21:50:16 +08:00
Sara Arjona 1eae36faf6 weekly release 3.9.24+ 2023-11-16 16:23:03 +01:00
Sara Arjona fa60800431 Merge branch 'MDL-79981-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2023-11-15 17:13:32 +01:00
Angelia Dela Cruz e564206e33 MDL-79603 mod_scorm: Behat coverage for Scorm package display options 2023-11-15 13:16:29 +08:00
Ilya Tregubov c046a86fa5 weekly release 3.9.24+ 2023-11-10 09:17:37 +08:00
Ilya Tregubov c02f5c7391 Merge branch 'MDL-80029-39' of https://github.com/junpataleta/moodle into MOODLE_39_STABLE 2023-11-09 09:37:27 +08:00
Andrew Nicols aa335a7aba MDL-79981 core: Add ability to manually run and filter phpunit on GHA 2023-11-08 12:57:00 +08:00
Jun Pataleta 857507ce09 MDL-80029 grade: Behat test fixes
* Feature: We can use a minimum grade different than zero
  - Use correct minimum input values.
  - Use data generators for faster test execution.
* Scenario: Disable category overriding
  - Use the field name to ensure that the correct field is being tested.

Cherry-picked from MDL-79062.
2023-11-07 20:46:28 +08:00
Jun Pataleta f14576473d weekly release 3.9.24+ 2023-10-27 09:43:26 +08:00
Jun Pataleta 475702b9ef Merge branch 'MDL-79768-39-fix' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-10-26 23:04:39 +08:00
Angelia Dela Cruz 9be29c8ded MDL-79768 fix: Fixed random failing Behat due to time difference 2023-10-26 17:23:08 +08:00
Jun Pataleta f574806a9a Merge branch 'MDL-79768-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-10-26 10:40:46 +08:00
Angelia Dela Cruz 8622c37ecc MDL-79768 mod_data: Test for student can see upcoming data activity 2023-10-23 08:40:51 +08:00
Sara Arjona 0a4c70d7c2 weekly release 3.9.24+ 2023-10-20 12:16:49 +02:00
Huong Nguyen decc44fb26 Merge branch 'MDL-79689-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-10-19 10:06:49 +07:00
Angelia Dela Cruz 151fd4caf9 MDL-79689 mod_assign: Behat for enabling anonymous submissions 2023-10-18 12:36:07 +08:00
Ilya Tregubov ca1da020ee Merge branch 'MDL-79691-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-10-17 10:30:48 +08:00
Angelia Dela Cruz 4756608dbe MDL-79691 mod_h5pactivity: Behat coverage for H5P activity grades reset 2023-10-16 18:13:38 +08:00
Huong Nguyen 8176483e0a Merge branch 'MDL-79698-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2023-10-16 11:41:48 +07:00
Huong Nguyen 4fe25d925f Merge branch 'MDL-79653-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-10-16 10:57:01 +07:00
Andrew Nicols f1a34c2ea0 MDL-79698 core: Correct duplicate array key in test provider 2023-10-13 15:44:56 +08:00
Ilya Tregubov b611b74e33 weekly release 3.9.24+ 2023-10-13 13:40:05 +08:00
Angelia Dela Cruz 6f6d548cfa MDL-79653 gradingform_guide: Behat coverage for deleting marking guide 2023-10-13 12:31:05 +08:00
Huong Nguyen ed0f8f1de4 Merge branch 'MDL-79638-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2023-10-12 11:09:37 +07:00
Andrew Nicols 09b8347175 MDL-79638 phpunit: Add unit test for increment resets 2023-10-11 00:10:33 +08:00
Andrew Nicols ab65333718 MDL-79638 phpunit: Remove mysql/mariadb hack
This hack was introduced to work around a bug in MySQL 5.6.14 and
MariaDB at the time.

https://bugs.mysql.com/bug.php?id=69882

It was addressed a few months later in 5.6.16, and 5.7.4.
MariaDB merged version 5.6.16 of MySQL's InnoDB engine in MariaDB
10.0.11 and got hte patch from there.

Moodle has required MariaDB 10.2.29 since Moodle 3.9 and it is therefore
safe to remove these hacks for MariaDB.
MySQL is also affected for version 5.7.0 >= MySQL < 5.7.4.
2023-10-11 00:05:55 +08:00
Jun Pataleta 71b5149443 Moodle release 3.9.24 2023-10-07 11:30:09 +08:00
Sara Arjona 4e98ec5ba5 weekly release 3.9.23+ 2023-10-06 14:02:48 +02:00
Paul Holden 083a7f5914 MDL-79310 enrol: restrict searched users to those user can view. 2023-10-04 14:32:36 +08:00
Paul Holden 29a84a66db MDL-79310 forumreport_summary: report only on users who can be viewed. 2023-10-04 14:32:36 +08:00
Paul Holden 280eee89d4 MDL-79310 mod_forum: ensure only visible users can be exported. 2023-10-04 14:32:35 +08:00
Mikel Martín b0f1c1afe4 MDL-79509 mod_wiki: Improve comment editing 2023-10-04 02:07:15 +02:00
Paul Holden ec07126d1b MDL-72249 message: stricter cleaning of processor type parameter. 2023-10-04 02:07:15 +02:00
Paul Holden 8cc1b41173 MDL-79426 gradeimport_csv: safely preview CSV content during import. 2023-10-04 02:07:15 +02:00
Paul Holden 2023e58e7b MDL-79455 tool_uploadcourse: clean course data fields individually. 2023-10-04 02:07:15 +02:00
Paul Holden 031f5f372b MDL-79455 tool_uploadcourse: safe preview of uploaded course data. 2023-10-04 02:07:15 +02:00
Paul Holden 0ae5ee6dfe MDL-79409 mod_imscp: appropriate unserialization of package structure. 2023-10-04 02:07:15 +02:00
Paul Holden 7f2b1cba3d MDL-79408 mod_lesson: safer unserializing/comparison of properties. 2023-10-04 02:07:15 +02:00
David Woloszyn 64ac84fdb5 MDL-77846 core: Make endpoint revision number checks stricter
In some places we prevented cache poisoning, in others we did not. We
also did not place any restriction on the minimum value for a revision.

This change introduces a new set of functions for configonly endpoints
which validates the revision numbers passed in. If the revision is
either too old, or too new, it is rejected and the file content is not
cached. The content is still served, but caching headers are not sent,
and any local storage caching is prevented.

The current time is used as the maximum version, with 60 seconds added
to allow for any clock skew between cluster nodes. Previously some
locations used one hour, but there should never be such a large clock
skew on a correctly configured system.

Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2023-10-04 02:07:15 +02:00
Huong Nguyen 1c2bdf454a MDL-66730 core_course: Improve permission check for category moving
Co-authored-by: Erica Bithell <egb10@cam.ac.uk>
2023-10-04 02:07:15 +02:00
Paul Holden c22b94aea7 MDL-78820 h5p: use fullname of current user as the xAPI actor name. 2023-10-04 02:07:15 +02:00
meirzamoodle ead9bafb54 MDL-78969 oauth2: remove auto-login after successful confirmation
With the new flow, users can go to the login page from the confirmed page,
and if the user successfully logs in, the user will be directed to the confirmed page.
To avoid that, the confirmed page can only be seen by users who are not logged in.
2023-10-04 02:07:15 +02:00
Jun Pataleta 8b4d9a91b5 weekly release 3.9.23+ 2023-10-04 07:49:31 +08:00
Huong Nguyen 37a1692b83 Merge branch 'MDL-79247_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2023-10-03 09:59:20 +07:00
Eloy Lafuente (stronk7) c9d73621ce MDL-79247 forum: Workaround same-time discussion modified dates bug
Within the forum_get_discussion_neighbours() function of forum
when the discussions timemodified (last post) is the same, there
is a bug that does strange things when calculating the prev and
next discussions.

Note that, in real life, this is really hard to achieve, but in tests,
when multiple discussions and post can be created by generators in the
same second (specially when the test machine is quick), chances of
facing that problem are higher.

By adding 1 second wait, we ensure that the discussions won't have
the same timemodified (last post) and workaround the problem.

No mater of that, the problem deserves an issue to be created
so we guarantee from code that it also works ok when the same
timemodified (last post) situation happens.
2023-10-01 23:47:58 +02:00
Eloy Lafuente (stronk7) 3f47f814a6 MDL-79247 forum: Make discussion list ordering deterministic
Note that normally this doesn't matter much, but there are situations
when we want the discussion list ordering fully consistent /
deterministic.

Specifically, when discussions (or forum posts )are created in the
same second, or when the discussion titles are repeated, or 2
discussions have the same number of votes... (any criteria in general),
in the context of testing, we don't want the order
to be non-consistent, so we need to provide an extra sorting
criterion to make it fully deterministic.

So, in this case, we are adding a sort by discussion.id <<DIRECTION>>
that is an unique value, primary key... so cheap to calculate and,
that way, when the 1st sorting column has repeated values, the id
will decide.
2023-10-01 23:47:58 +02:00
Jun Pataleta ea288b3af7 weekly release 3.9.23+ 2023-09-29 22:07:36 +08:00
Ilya Tregubov 853a350a7c Merge branch 'MDL-79360/39' of https://github.com/skodak/moodle into MOODLE_39_STABLE 2023-09-28 09:40:11 +08:00
Sara Arjona d03b556a1c weekly release 3.9.23+ 2023-09-15 17:34:34 +02:00
Petr Skoda 179af9b420 MDL-79360 filter: fix nolink tag regression from MDL-77525 2023-09-15 12:46:22 +02:00
Ilya Tregubov 79dfe05dfe Merge branch 'MDL-79220-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-09-14 17:45:05 +08:00
Ilya Tregubov 2c2173b9b8 Merge branch 'MDL-79195-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-09-14 09:39:27 +08:00
Ilya Tregubov 0761ab0be8 Merge branch 'MDL-78806-39' of https://github.com/junpataleta/moodle into MOODLE_39_STABLE 2023-09-13 10:56:56 +08:00
Eloy Lafuente (stronk7) 5cfdea895c weekly release 3.9.23+ 2023-09-12 18:54:22 +02:00
Angelia Dela Cruz 13bda1114f MDL-79195 core_course: Activity and resource description display behat 2023-09-12 13:08:32 +08:00
Huong Nguyen a59dec1555 Merge branch 'MDL-79246-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2023-09-12 08:52:49 +07:00
Jun Pataleta 4139a83154 MDL-78806 mod_assign: Use new Behat step for checking page title 2023-09-10 23:35:13 +08:00
Jun Pataleta 4533cb81a4 MDL-78806 behat: Create a step that for checking the page title
Create a Behat step "the page title should contain ':title'" to check
the page title.
2023-09-10 23:35:13 +08:00
Jun Pataleta 3bfc3bfd28 weekly release 3.9.23+ 2023-09-08 22:35:28 +08:00
Angelia Dela Cruz 437bab80d3 MDL-79220 mod_glossary: Behat for glossary entry with attachment 2023-09-07 11:04:27 +08:00
Ilya Tregubov cb57109bb4 Merge branch 'MDL-76459_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2023-09-06 10:04:34 +08:00
Andrew Nicols 156bf56f94 MDL-79246 gradingform_rubric: Use i_click_on for behat clicks 2023-09-04 09:13:25 +08:00
Eloy Lafuente (stronk7) c0388ff317 MDL-76459 xmldb: Add environmental check to verify $CFG->prefix
While, right now, sites using long (> 10 chars) $CFG->prefix
can continue working (because we still don't have any table
> 28 chars), as soon as some new table with long name is added,
it won't work with PostgreSQL anymore (if the 63 limit is raised).

Hence, this environmental check will verify on both install and
upgrade that the $CFG->prefix is always <= 10 chars.

Sites with longer prefixes will need to rename all their tables
(and maybe other objects, depending on the dbtype) to use a shorter
prefix.
2023-09-02 09:22:52 +02:00
Andrew Nicols 433bf40d3e weekly release 3.9.23+ 2023-09-02 08:18:48 +08:00
Andrew Nicols 8f3917ade6 Merge branch 'MDL-77831-39' of https://github.com/mickhawkins/moodle into MOODLE_39_STABLE 2023-09-01 10:39:10 +08:00
Jun Pataleta b4d8fb4aac Merge branch 'MDL-79017-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2023-08-31 20:31:36 +08:00
Michael Hawkins 5852121094 MDL-77831 core: Updated security.txt expiry and added additional info 2023-08-31 18:30:17 +08:00
Huong Nguyen 9fb9f4a2cc Merge branch 'MDL-79207-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-08-31 12:28:24 +07:00
Angelia Dela Cruz e678f15d15 MDL-79207 core_course: Behat coverage for activity and resource deletion 2023-08-31 11:46:45 +08:00
Jun Pataleta a422cf3d29 weekly release 3.9.23+ 2023-08-26 11:03:41 +08:00
Jun Pataleta 96df425cdb Merge branch 'MDL-79015-39-fix' of https://github.com/lameze/moodle into MOODLE_39_STABLE 2023-08-25 10:04:21 +08:00
Simey Lameze 05fb0e844c MDL-79015 behat: make verification step more specific 2023-08-25 09:07:16 +08:00
Sara Arjona ae675a315a Merge branch 'MDL-78965-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-08-24 16:39:30 +02:00
Jun Pataleta 23eb16a684 Merge branch 'MDL-79015-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-08-24 15:53:34 +08:00
Angelia Dela Cruz 4079e743ac MDL-78965 mod_quiz: Behat coverage for quiz with certainty-based marking 2023-08-24 15:34:49 +08:00
Angelia Dela Cruz 23589ac78d MDL-79015 mod_lesson: Behat coverage for lesson with access restriction 2023-08-24 13:56:06 +08:00
Jun Pataleta 647c3293d3 Merge branch 'MDL-78941-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-08-24 13:05:21 +08:00
Angelia Dela Cruz b9e8c673a8 MDL-78941 mod_quiz: Behat coverage for student flagging quiz questions 2023-08-24 12:04:12 +08:00
Huong Nguyen bbe934e819 Merge branch 'MDL-78843-39' of https://github.com/lameze/moodle into MOODLE_39_STABLE 2023-08-24 08:59:24 +07:00
Paul Holden 54e0b7c8f2 MDL-79017 core: re-factor method to unserialize array.
We can use the existing helper for object unserialization as the
base for this method, rather than manual string parsing.
2023-08-21 21:02:53 +01:00
Ilya Tregubov b8ecb227bb weekly release 3.9.23+ 2023-08-18 11:24:12 +08:00
Eloy Lafuente (stronk7) 016ba38ab9 Merge branch 'MDL-78684-39-fix-2' of https://github.com/lameze/moodle into MOODLE_39_STABLE 2023-08-17 19:59:08 +02:00
Simey Lameze 1a144ec3b1 MDL-78684 behat: fix behat failures 2023-08-17 21:16:39 +08:00
Jun Pataleta 8ea9583992 Merge branch 'MDL-78938-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2023-08-17 09:56:56 +08:00
Andrew Nicols d74575f458 Merge branch 'MDL-77695-39' of https://github.com/lameze/moodle into MOODLE_39_STABLE 2023-08-16 23:23:58 +08:00
Andrew Nicols 6625857af9 Merge branch 'MDL-78684-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-08-16 22:45:33 +08:00
Andrew Nicols 70fbb57e42 MDL-78938 report_progres: Wrap completion status update in pending 2023-08-16 22:11:43 +08:00
Simey Lameze 8296126e99 MDL-77695 behat: use automatic completion to award badges 2023-08-16 21:17:48 +08:00
Shamim Rezaie 416ab81b32 Moodle release 3.9.23 2023-08-11 23:20:26 +10:00
Huong Nguyen 71f0e78e57 weekly release 3.9.22+ 2023-08-10 22:51:06 +07:00
meirzamoodle 57a5029f44 MDL-78685 auth_oauth2: Added logged-in status check 2023-08-10 18:46:55 +07:00
Jun Pataleta 38d0400ef5 MDL-78620 auth_cas: Pass base service URL for the CAS client
Since phpCAS v1.6.0, a required base service URL parameterneeds to be
passed to phpCAS::client(). This is basically the protocol, hostname,
and port number (optional) of the site connecting to the CAS server
in order for it to perform service URL discovery.
2023-08-10 18:46:55 +07:00
Jun Pataleta 6900cda827 MDL-78620 auth_cas: Bump thirdpartylibs version to 1.6.0 2023-08-10 18:46:55 +07:00
Jun Pataleta c87e62895e MDL-78620 auth_cas: Update phpCAS to v1.6.0 2023-08-10 18:46:55 +07:00
David Woloszyn 58ae182d8f MDL-78620 lib: Set Moodle files after phpCAS upgrade 2023-08-10 18:46:55 +07:00
David Woloszyn 48808e9859 MDL-78620 lib: Upgrade phpCAS to 1.5.0 2023-08-10 18:46:55 +07:00
cescobedo 1a04745bd4 MDL-78620 auth_cas: Set Moodle files after phpCAS upgrade 2023-08-10 18:46:54 +07:00
cescobedo 2d7946a0f7 MDL-78620 auth_cas: Upgrade phpCAS to 1.4.0 2023-08-10 18:46:54 +07:00
Michael Hawkins 6b8b0fe780 MDL-78763 tool_policy: Initialise returnurl as a moodle_url in viewall 2023-08-10 18:46:54 +07:00
Paul Holden 8164c8f419 MDL-78792 message: access checks in processor fragment callback. 2023-08-10 18:46:54 +07:00
raortegar 7aa1ba7ffc MDL-74289 lib: Improve the proxy bypass matching 2023-08-10 18:46:48 +07:00
Simey Lameze a60977e766 MDL-78843 behat: update get_forum_id to search for idnumber or name
This commit also converts manual steps to create discussions on the
Annoucements forum to data generator.
2023-08-10 10:15:31 +08:00
Paul Holden 3d0bff0e98 MDL-78647 files: safer unserializing of file reference data. 2023-08-09 06:37:17 +02:00
Shamim Rezaie ad6f1e4e4d MDL-66212 tool_lpimport: properly check capabilities
The moodle/competency:competencymanage capability should be checked
before showing the import and export pages.
2023-08-09 06:37:17 +02:00
Matt Porritt 7032c8b5ed MDL-78340 Blocks: Dashboards now respect block permission overrides
Patch makes user dashboard respect permission overrides
that have been set on individual blocks on the system
dashboard (indexsys.php). When a user dashboard is created
either when the user visits their dashboard for the first
time or after an admin reset. When blcoks are copied to
the new dashbaord overriden permissions are also copied.
2023-08-09 06:37:17 +02:00
Rajneel Totaram 6cb39c5f5c MDL-71728 mod_quiz: check if user can access this page 2023-08-09 06:37:17 +02:00
David Woloszyn 3f435c0b64 MDL-74544 lib: Set Moodle files after JQuery UI upgrade 2023-08-09 12:27:14 +08:00
David Woloszyn d1604d2783 MDL-74544 lib: Upgrade JQuery UI to 1.13.2 2023-08-09 12:27:13 +08:00
Sara Arjona af934a7ad6 weekly release 3.9.22+ 2023-08-04 12:40:23 +02:00
Jun Pataleta b15e7d4dfc MDL-78498 mod_forum: Prevent race condition in forum recent activity
* Using the generator to create the forum discussions, the timecreated
of a discussion can be set before the user's last course access which
will prevent forum_print_recent_activity() from including this generated
discussion in the recent activity results. To work around this, generate
the forum discussion 1 second after the current time to make sure that
the user's last course access will always be before the discussion's
creation time.
* This patch also includes some optimisations by:
  - Removing the unnecessary @javascript tag for the
    `Time limit expires` scenario
  - Bringing the discussion generation to each scenario to allow each
    scenario to customise the data passed to the generator like for the
    `Time limit expires` scenario.
  - Navigating directly to the forum instance.
2023-08-03 11:33:52 +08:00
Jun Pataleta d4b73402e6 Merge branch 'MDL-78498-39' of https://github.com/lameze/moodle into MOODLE_39_STABLE 2023-08-02 11:22:32 +08:00
Sara Arjona cc5ce27223 Merge branch 'MDL-78703-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2023-08-01 13:45:42 +02:00
Simey Lameze 53546c597b MDL-78498 behat: add support for private replies
This commit adds support for private replies in the
'the following forum replies exist in course' custom step.
2023-08-01 19:15:41 +08:00
Angelia Dela Cruz eeb6c426ed MDL-78498 Behat: Use data generators for forum posts and replies
This commit does few things:
* Replace manual forum posts and replies to use data generator.
* It also changes the code to handle social forums.
* Other behat clean-ups and optimization.

Co-authored-by: Simey Lameze <simey@moodle.com>
2023-08-01 19:15:39 +08:00
Angelia Dela Cruz 4c6b06ff3d MDL-78684 Behat: Replace gradebook navigation to use page resolvers
This commit also does other things such as:
- Replace manual steps to setup gradebook by data generators
- Added support for outcomes and scales page resolvers
- Behat clean up
2023-08-01 15:47:56 +08:00
Huong Nguyen 0c38d3be9d weekly release 3.9.22+ 2023-07-21 20:56:45 +07:00
Paul Holden 6ea1f21676 MDL-78703 behat: fix HTTP GET method capitalization on redirect. 2023-07-15 01:00:16 +01:00
Ilya Tregubov 49333fe8da weekly release 3.9.22+ 2023-07-14 09:25:53 +08:00
Eloy Lafuente (stronk7) 89e704402f Merge branch 'MDL-78673-39-fix' of https://github.com/sarjona/moodle into MOODLE_39_STABLE 2023-07-12 19:02:12 +02:00
Sara Arjona e6fcc1e59a MDL-78673 behat: Replace arrow function 2023-07-12 18:45:08 +02:00
Sara Arjona 88a8b20b96 Merge branch 'MDL-78673-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2023-07-12 18:18:51 +02:00
Andrew Nicols 2f738b98a9 Merge branch 'MDL-77450-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-07-13 00:11:08 +08:00
Sara Arjona 8dc304db03 Merge branch 'MDL-78455-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-07-12 17:37:47 +02:00
Andrew Nicols b97eddca18 MDL-78673 grade: Switch test to use generators 2023-07-11 22:23:00 +08:00
Andrew Nicols f8e98de36a MDL-78673 grade: Switch to behat navigation steps 2023-07-11 22:23:00 +08:00
Andrew Nicols 0644236d5b MDL-78673 grade: Address random failure due to toast 2023-07-11 22:22:59 +08:00
Angelia Dela Cruz d07b0f16a9 MDL-77450 Behat: Behat cleanup and optimisation 2023-07-11 15:45:22 +08:00
Andrew Nicols 470ce4eae7 MDL-78673 behat: Allow plugins to define their expansion of > 2023-07-10 11:33:38 +08:00
Ilya Tregubov f748f6ac20 weekly release 3.9.22+ 2023-07-07 11:52:44 +08:00
Andrew Nicols 409d3dbc72 Merge branch 'MDL-78614-39' of https://github.com/noeldemartin/moodle into MOODLE_39_STABLE 2023-07-05 20:31:53 +08:00
Andrew Nicols ff3ed674ac Merge branch 'MDL-78158-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-07-05 10:25:04 +08:00
Angelia Dela Cruz 1fff326c02 MDL-78158 behat: Behat cleanup and optimisation 2023-07-04 10:27:25 +08:00
Angelia Dela Cruz 7df31a7cd0 MDL-78158 Behat: Use data generators to add blocks 2023-07-04 09:42:15 +08:00
Noel De Martin 837d4f6e1c MDL-78614 behat: Remove trailing quotes 2023-07-03 11:19:23 +02:00
Huong Nguyen b82cf9a27d weekly release 3.9.22+ 2023-06-29 22:22:35 +07:00
Jun Pataleta bbec8737ac Merge branch 'MDL-76724_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2023-06-26 19:39:08 +08:00
Eloy Lafuente (stronk7) 68b83a9107 MDL-76724 environment: Moodle 4.3 requirements
Note that there aren't changes since Moodle 4.2
so this is a complete copy of the information
for that version.
2023-06-24 12:30:25 +02:00
Sara Arjona 58dc2a9b07 weekly release 3.9.22+ 2023-06-23 09:00:47 +02:00
Ilya Tregubov b3a15c0143 Merge branch 'MDL-77525/39' of https://github.com/skodak/moodle into MOODLE_39_STABLE 2023-06-20 13:07:54 +08:00
Jun Pataleta 5ee66b955c Merge branch 'MDL-74021-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-06-20 10:13:00 +08:00
Angelia Dela Cruz 3fac2eedbe MDL-74021 behat: Page behat generators use UI
Replace steps that manually add page instances via the UI and use
Behat generators. This improves the speed of Behat test runs.

Co-authored-by: Simey Lameze <simey@moodle.com>
2023-06-19 17:25:40 +08:00
Petr Skoda ed72782eb2 MDL-77525 filter: add filtering stages 2023-06-17 17:13:03 +02:00
Andrew Nicols 1c0efa2aa7 weekly release 3.9.22+ 2023-06-16 12:04:44 +08:00
Angelia Dela Cruz 57b57537e4 MDL-78455 Behat: Behat cleanup and optimisation for blog/tests/behat 2023-06-16 09:32:05 +08:00
Angelia Dela Cruz fcdb1a3fba MDL-78455 Behat: Add Behat for adding, editing and deleting blog entries 2023-06-16 09:30:55 +08:00
Ilya Tregubov 6fb50707a9 Merge branch 'MDL-70152-39-fix' of https://github.com/ilyatregubov/moodle into MOODLE_39_STABLE 2023-06-15 12:11:12 +08:00
Simey Lameze fd0120a5aa MDL-70152 behat: reply to post using data generator 2023-06-15 12:10:10 +08:00
Andrew Nicols 869b67ae7b Merge branch 'MDL-69231-39' of https://github.com/lameze/moodle into MOODLE_39_STABLE 2023-06-15 10:58:18 +08:00
Ilya Tregubov ef1faffca8 Merge branch 'MDL-76733-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2023-06-15 10:26:13 +08:00
Andrew Nicols 2a2fc0813b MDL-76733 mod_assign: Remove JS requirement for time-based tests
Converting these tests to use an onlinetext submission and drop the JS
requirement means that they are much less susceptible to runtime issues,
and not susceptible to those caused by JS at all.
2023-06-15 09:34:49 +08:00
Sara Arjona a8a696193b Merge branch 'MDL-76733-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2023-06-14 16:23:03 +02:00
Ilya Tregubov 75af2c99b7 Merge branch 'MDL-70152-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-06-14 13:26:26 +08:00
Angelia Dela Cruz 5e5a72e630 MDL-70152 behat: Forum behat generators use UI
Behat cleanup and optimisation
2023-06-14 09:52:52 +08:00
Angelia Dela Cruz ab54adb839 MDL-70152 behat: Forum behat generators use UI
Replace steps that manually add forum and forum post instances
via the UI and use Behat generators. This improves the speed of
Behat test runs.
2023-06-14 08:49:00 +08:00
Andrew Nicols c483bc57e8 MDL-70152 forum: Create behat data generator
* Convert track_read_posts.feature to use activity and discussion
data generators as exmaple.

Co-authored-by: Jun Pataleta <jun@moodle.com>
2023-06-14 08:48:59 +08:00
Ilya Tregubov 1c40a5e030 Moodle release 3.9.22 2023-06-10 14:07:36 +08:00
Ilya Tregubov 59e3c69754 weekly release 3.9.21+ 2023-06-09 13:14:40 +08:00
Andrew Nicols bcc6fa863e Merge branch 'wip_MDL-78400_m39' of https://github.com/gjb2048/moodle into MOODLE_39_STABLE 2023-06-08 10:59:44 +08:00
Andrew Nicols 0695bf0d31 Merge branch 'MDL-76406-39' of https://github.com/safatshahin/moodle into MOODLE_39_STABLE 2023-06-08 10:43:41 +08:00
Stevani Andolo 9b7aec5f8f MDL-78215 core: Added support unit test 2023-06-08 09:37:59 +08:00
Stevani Andolo 8e5a14947d MDL-78215 core: support checking if 0.0.0.0 is in subnet 2023-06-08 09:37:59 +08:00
Paul Holden 33c05e98e1 MDL-77193 mnet: correct sorting of access control table. 2023-06-07 09:54:28 +08:00
Gareth Barnard 511c36ae30 MDL-78400 JavaScript: Building JS puts build files in src dir on Win. 2023-06-05 14:44:49 +01:00
Simey Lameze 744c230de6 MDL-69231 behat: remaining work for role capability generator
This commit does few things:
* Unify data generators usage to role short name.
* Replace remaining manual steps to use the new data generator.
* Also replaced other manual steps to set config to use data generators.
* Tidy up of some tests, aligning pipes and splitting one line steps into multiple lines.
* Fixes tests to have one Given/When/Then per scenario.
2023-06-02 12:15:53 +08:00
Andrew Nicols 0602563eb8 MDL-69231 behat: Update tests to use new generator 2023-06-02 12:14:59 +08:00
Andrew Nicols 530fe2f12a MDL-69231 tests: Add role capability setting generator 2023-06-02 12:14:59 +08:00
Andrew Nicols 423e1580d1 MDL-69231 tests: Improve existing role generator
Support definition of context levels and permissions.
2023-06-02 12:14:59 +08:00
Safat b0389d2785 MDL-76406 core: Add environment check for versions not supporting 8.2 2023-06-02 12:10:36 +10:00
Ilya Tregubov d0d7d578c5 weekly release 3.9.21+ 2023-06-02 09:55:57 +08:00
Ilya Tregubov 2c42e4ca95 Merge branch 'MDL-75961-39' of https://github.com/lameze/moodle into MOODLE_39_STABLE 2023-06-01 09:09:59 +08:00
Sara Arjona c60d769026 Merge branch 'MDL-77907-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-05-31 12:18:44 +02:00
Sara Arjona 31f6d9ccc5 weekly release 3.9.21+ 2023-05-26 09:29:11 +02:00
Jun Pataleta 81e5662cb0 Merge branch 'MDL-76065-39' of https://github.com/lameze/moodle into MOODLE_39_STABLE 2023-05-25 11:57:41 +08:00
Andrew Nicols a1428eb9cf Merge branch 'MDL-77995-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2023-05-25 10:00:33 +08:00
Simey Lameze 3860a59298 MDL-75961 behat: review and enhance mod_imscp tests
This commit makes the following improvements to mod_imscp tests:
* Removes unnecessary @javascript and @_file_upload tags from non-JS tests.
* Removes user/enrol data generation from tests that can be performed as admin.
* Removes "I log out" and other unnecessary steps.
2023-05-24 10:52:26 +08:00
Angelia Dela Cruz e6dabb77a2 MDL-75961 behat: IMSCP behat generators use UI
Replace steps that manually add IMSCP instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
2023-05-24 10:51:55 +08:00
Jun Pataleta a353ca34f5 Merge branch 'MDL-76688/39' of https://github.com/skodak/moodle into MOODLE_39_STABLE 2023-05-23 15:21:31 +08:00
Simey Lameze 27c9fe993a MDL-76065 behat: Review and enhance mod_lti Behat tests
In this commit, the following improvements were made to the mod_lti Behat tests:

* Replaced manual steps with data generators to set completion.
* Eliminated unnecessary user and course enrolments data generation as some tests can be performed as an admin.
* Removed the @javascript tag from non-JS tests.
* Updated the LTI data generator to generate an internal Moodle URL in the toolurl field, enabling the use of XML files.
2023-05-23 13:56:23 +08:00
Angelia Dela Cruz d2c98b6b88 MDL-76065 behat: LTI behat generators use UI
Replace steps that manually add LTI instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
2023-05-23 12:36:38 +08:00
Andrew Nicols e936ef3527 MDL-76733 mod_assign: Tidy up availability behat tests
This feature had lots of small issues and it made sense to fix it whilst
investigating a query:

* most of the steps do not require JavaScript
* it uses the UI to set an admin setting, for every scenario:
** only 3-4 of the scenarios actually test that setting
** it is very slow to do it his way when we have a generator step we can use
* we create two assignments in the Background, but each test only uses one of them
* we create the assignments in the Background with a generator, but
  update them to modify various settings in each Scenario using the UI
  when we should just create one assignment for each test and set it up
  correctly for that Scenario
2023-05-23 11:12:27 +08:00
Angelia Dela Cruz e5187812a5 MDL-77907 Behat: Coverage for duplicating competency framework 2023-05-16 09:41:06 +08:00
Petr Skoda dda5919426 MDL-76688 filter_text: prevent LaTeX3 syntax 2023-05-08 10:13:13 +02:00
Sara Arjona 2fa4da9aa4 weekly release 3.9.21+ 2023-05-04 12:43:15 +02:00
Jun Pataleta ba790c87a3 Merge branch 'MDL-76857-39' of https://github.com/sarjona/moodle into MOODLE_39_STABLE 2023-05-02 15:43:12 +08:00
Sara Arjona e8cd8fce88 MDL-76857 filter_displayh5p: Improve behat tests
Although the screenshots in the failures for some of the scenarios in
filter/displayh5p/tests/behat/h5p_filter.feature, like "Render a local
H5P file as teacher" were displaying the expected result, there were
some javascript errors (probably due to behat is quicker and the
iframes were not always ready).
I've added one extra step before accessing the iframe to give more
time to the H5P player to load and confirm the page is displayed
properly.
2023-04-27 12:04:38 +02:00
Paul Holden d8d09c9465 MDL-77995 javascript: more precise path matching building JS. 2023-04-24 10:53:11 +01:00
Jun Pataleta b90b0e6a8a Moodle release 3.9.21 2023-04-22 16:22:34 +08:00
Eloy Lafuente (stronk7) 58a55fcd40 weekly release 3.9.20+ 2023-04-21 19:19:36 +02:00
Jun Pataleta c37dd0ecbd Merge branch 'MDL-77927-39' of https://github.com/stevandoMoodle/moodle into MOODLE_39_STABLE 2023-04-21 16:51:14 +08:00
Jun Pataleta 84462c3e71 MDL-77927 core: mod_assignment subplugins environment check 2023-04-21 15:58:22 +08:00
Andrew Nicols 129b2186ac Merge branch 'MDL-77128-39' of https://github.com/mackensen/moodle into MOODLE_39_STABLE 2023-04-20 10:22:35 +08:00
Paul Holden 7eb6482266 MDL-77187 mod_wiki: validate external method sort parameters. 2023-04-19 12:57:22 +00:00
Paul Holden 9e4c3f858f Merge branch 'MDL-77960-39' of https://github.com/lameze/moodle into MOODLE_39_STABLE 2023-04-19 13:41:36 +01:00
Paul Holden a7bbba41bf Merge branch 'MDL-77944-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2023-04-19 13:06:44 +01:00
Simey Lameze bfc911b928 MDL-77960 behat: make verification steps more specific 2023-04-19 13:33:59 +08:00
Andrew Nicols 9766906cc5 weekly release 3.9.20+ 2023-04-18 22:28:25 +08:00
Charles Fulton 0864e3adb3 MDL-77128 upgrade: Fix incompatible check in upgrade to match docs
Backport of MDL-72324
2023-04-18 09:07:34 -04:00
Andrew Nicols 86de73cb14 Merge branch 'MDL-77829-39' of https://github.com/stevandoMoodle/moodle into MOODLE_39_STABLE 2023-04-18 12:33:14 +08:00
Andrew Nicols b3e6ce7cfe MDL-77944 behat: Rename chrome options for w3c support
From Selenium 4.8.0, support for non-w3c browser control has ended.

We only use W3C browser control these days, and this was missed as part
of the move to W3C. All browser options must be vendor-prefixed.
2023-04-18 09:40:16 +08:00
Sara Arjona 94836d56b6 weekly release 3.9.20+ 2023-04-14 10:50:22 +02:00
Sara Arjona 3477b9c1c5 Merge branch 'MDL-73610_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2023-04-12 18:20:10 +02:00
Sara Arjona 6ee405e107 Merge branch 'MDL-77837-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2023-04-11 12:13:38 +02:00
Stevani Andolo 869b26f3e3 MDL-77829 core: Added environment check for mod_assignment
Decided to add an environment check before uninstalling the
mod_assignment plugin to prevent data lost.
2023-04-10 13:56:09 +08:00
Andrew Nicols d1f085a771 MDL-77837 core: Improve usage docs for cron_setup_user 2023-04-06 23:21:29 +08:00
Andrew Nicols 22ac74f686 MDL-77837 phpunit: Ensure that the cron user setter is used
When running an adhoc task in a unit test we should use the cron variant
of the set user method to mimic the behaviour of a real cron run.
2023-04-06 23:21:29 +08:00
Andrew Nicols 72a51148e9 MDL-77837 cron: Ensure user is set when running tasks
We should be proactive in ensuring that the environment is clean when
running a task. We already ensure that we have a clean renderer and
other parts of the output chain, but we were not setting a clean user.

This change adds a call to setup the cron user before each task is
actually executed.
2023-04-06 23:21:29 +08:00
Eloy Lafuente (stronk7) 7e6d3caab7 MDL-73610 nodejs: Small updates to required packages
The main goal of this issue is to avoid scanners (Dependabot
and friends), reporting about security issues with the current
xmldom 0.6.0 package.

Note that this doesn't affect prod at all, because it's a dev
dependency, hardly exploitable. So it's not a security fix, just
a security_benefit, if something.

So here, we are updating from xmldom 0.6.0 to @xmldom/xmldom 0.8.7
(note that the package was renamed in 0.7.0, so it's the very same)

Also, when proceeding with the changes, it was detected that we
are incorrectly declaring @babel/eslint-parser as a normal dependency
instead of a development one, so we are also fixing that little detail.

The commands executed to get the changes above applied have been:

- nvm use
- npm install @xmldom/xmldom@^0.8.7 --save-dev
- npm uninstall xmldom
- npm install @babel/eslint-parser@^7.17.0 --save-dev

(we haven't run a complete re-install because we only want to modify
the minimum possible at this stage).
2023-04-06 15:00:14 +02:00
Sara Arjona 0b15830a44 weekly release 3.9.20+ 2023-04-06 14:02:40 +02:00
Andrew Nicols 6c34850db6 Merge branch 'MDL-77584-39' of https://github.com/ewallah/moodle into MOODLE_39_STABLE 2023-04-04 12:08:26 +08:00
Paul Holden ed81c8df64 Merge branch 'MDL-75906-39' of https://github.com/mickhawkins/moodle into MOODLE_39_STABLE 2023-04-03 14:54:07 +01:00
Michael Hawkins efa1cab75a MDL-75906 core: Updated security.txt expiry 2023-04-03 17:28:04 +08:00
Paul Holden aa99d2ebac weekly release 3.9.20+ 2023-03-31 18:12:03 +01:00
Sara Arjona 9c4d90cb52 Merge branch 'MDL-77761-39' of https://github.com/junpataleta/moodle into MOODLE_39_STABLE 2023-03-30 17:53:39 +02:00
Jun Pataleta 6a15f3890e Merge branch 'MDL-77333_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2023-03-30 19:03:17 +08:00
Jun Pataleta 4a4bf70e8b MDL-77761 core_form: Add label for editor format selector 2023-03-28 23:35:24 +08:00
Eloy Lafuente (stronk7) 3aba658a40 MDL-77333 mod_resource: fixes generator uploading files + tests
MDL-76499 revealed a few problems with resource generators:

1. We were not covering with unit tests the upload of files from disk
   (and here it's where the problem was).
2. There was a little of confusion between disk paths (only needed
   to upload files) and file_area paths (the generator only creates
   or uploads files to the root directory of the file area.
3. It was possible to request the upload of a file to the generator
   without that file effectively existing.

This commit fixes those points  and covers 99% of the generator code.
2023-03-26 11:45:05 +02:00
Sara Arjona ed154e71b0 weekly release 3.9.20+ 2023-03-24 13:59:44 +01:00
Jun Pataleta 06d46b875b Merge branch 'MDL-77669-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2023-03-24 11:50:48 +08:00
Paul Holden 478b7146e5 Merge branch 'MDL-77691-39' of https://github.com/roland04/moodle into MOODLE_39_STABLE 2023-03-23 11:43:45 +00:00
Mikel Martín 5febdbe6a2 MDL-77691 behat: Add step to navigate to profile page directly
Co-authored-by: Simey Lameze <simey@moodle.com>
2023-03-23 08:28:43 +01:00
Ilya Tregubov 09e068e8bb weekly release 3.9.20+ 2023-03-22 09:37:21 +08:00
Meirza d17d7263fd MDL-77669 dml: Added extrainfo in the DB options config.
extrainfo is an extra information for the DB driver, e.g. SQL Server,
has additional configuration according to its environment,
which the administrator can specify to alter and override any connection options.

Co-authored-by: LukeCarrier <luke@carrier.im>

This is a backport of MDL-64153.
2023-03-21 08:48:08 +08:00
Sara Arjona 0afaaad6dd Merge branch 'MDL-77574-39' of https://github.com/lameze/moodle into MOODLE_39_STABLE 2023-03-20 17:06:41 +01:00
info@eWallah.net 556cdde71a MDL-77584 currencies: Fix outdated ISO 4217 code for Zambian Kwacha
On 2013-01-01 the ZMK code got replaced by the new ZMW code.

AMOS BEGIN
 MOV [ZMK,core_currencies],[ZMW,core_currencies]
AMOS END
2023-03-16 19:53:28 +01:00
Eloy Lafuente (stronk7) f24eb73cc5 weekly release 3.9.20+ 2023-03-14 16:07:54 +01:00
Jun Pataleta 01576f2100 Merge branch 'MDL-76680/39' of https://github.com/skodak/moodle into MOODLE_39_STABLE 2023-03-14 11:56:45 +08:00
Simey Lameze f39e564141 MDL-77574 myoverview: wait until next button exists before clicking 2023-03-13 14:19:10 +08:00
Petr Skoda ef1ecd2ad3 MDL-76680 core: disable $USER->ignoresesskey on next page 2023-03-11 10:37:56 +01:00
Jun Pataleta c7e549cda4 Moodle release 3.9.20 2023-03-11 13:10:32 +08:00
Jun Pataleta 5ab0e5351b weekly release 3.9.19+ 2023-03-10 22:10:07 +08:00
Ilya Tregubov 1eacff88b1 Merge branch 'MDL-77429-39-fix' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2023-03-10 14:49:32 +08:00
Andrew Nicols e3189a8d18 MDL-77429 course: Change course date to previous day
When a test runs just after midnight, and the user time zone is not the
same as the server timezone, and the course is created using a generator
(which runs in server time zone) but the UI presented in the user
timezone, the course start time is still in the future.

We need to create the course a day earlier to ensure that the "This
week" indicator is in the correct day.
2023-03-10 14:11:23 +08:00
Andrew Nicols c7a9221ef2 Merge branch 'MDL-77429-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-03-09 22:13:06 +08:00
Andrew Nicols c95773e2e3 Merge branch 'MDL-77463-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-03-09 22:06:03 +08:00
Jun Pataleta b61fae245c Merge branch 'MDL-77559-39-2' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2023-03-09 15:43:24 +08:00
Angelia Dela Cruz a69cf7f929 MDL-77429 Behat: Add coverage for changing course format as teacher 2023-03-09 14:31:30 +08:00
Angelia Dela Cruz 147b16d552 MDL-77463 Behat: Coverage for assign submission notification to teacher 2023-03-09 12:47:32 +08:00
Andrew Nicols ce1a7659bc MDL-77559 js: Rebuild all JS with Node 16 2023-03-09 08:22:29 +08:00
Andrew Nicols 6c7b5a35a6 MDL-77559 js: Revert "MDL-75012 core: Bump NodeJS version requirements"
This reverts commit f6559c6eaf.
2023-03-09 08:21:19 +08:00
Andrew Nicols 601e5c6d83 MDL-77559 js: Revert "MDL-75012 js: Bump standard dependencies"
This reverts commit 0872d00857.
2023-03-09 08:21:15 +08:00
Andrew Nicols 89b16e0bef MDL-77559 js: Revert "MDL-75012 js: Remove grunt-contrib-uglify"
This reverts commit d6ac705d63.
2023-03-09 08:21:12 +08:00
Andrew Nicols dc1d2cbc73 MDL-77559 js: Revert "MDL-75012 js: Bump stylelint and components"
This reverts commit 2cfb12db0e.
2023-03-09 08:21:07 +08:00
Andrew Nicols 6be0f7be06 MDL-77559 js: Revert "MDL-75012 js: Update browserslist"
This reverts commit 4f2e19bb73.
2023-03-09 08:21:03 +08:00
Andrew Nicols 78fd0486c8 MDL-77559 js: Revert "MDL-75012 js: Bump node-sass"
This reverts commit daa7fe6afa.
2023-03-09 08:20:57 +08:00
Andrew Nicols 88e822b7aa MDL-77559 js: Revert "MDL-75012 js: Audit fix"
This reverts commit e2c7dd3d43.
2023-03-09 08:20:53 +08:00
Andrew Nicols ba484e50c8 MDL-77559 js: Revert "MDL-75012 js: Bump shifter to new version"
This reverts commit 3bf5ec446f.
2023-03-09 08:20:49 +08:00
Andrew Nicols 3667cf8429 MDL-77559 js: Revert "MDL-75012 js: Put shifter on a diet"
This reverts commit 7d58caa23a.
2023-03-09 08:20:45 +08:00
Andrew Nicols 6de86a8a2b MDL-77559 js: Revert "MDL-75012 js: Remove unused babel-preset-minify"
This reverts commit 8ed6cc973c.
2023-03-09 08:20:42 +08:00
Andrew Nicols 3521e03fd2 MDL-77559 js: Revert "MDL-75012 js: Bump Babel dependencies"
This reverts commit bf99f67aae.
2023-03-09 08:20:13 +08:00
Ilya Tregubov 16534d538e Merge branch 'MDL-77414-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-03-08 17:06:48 +08:00
Angelia Dela Cruz 5c32629d04 MDL-77414 Behat: Coverage for "Require all group members submit" setting 2023-03-08 14:57:18 +08:00
Petr Skoda f99ae1651a MDL-77524 filter_algebra: fix error message 2023-03-08 11:27:53 +08:00
Paul Holden d4389e4a0e MDL-75517 report_participation: filter report by viewable roles only. 2023-03-08 10:38:51 +08:00
Michael Hawkins 11acdd8532 MDL-77204 mod_wiki: Clean filename in Moodle1 backup 2023-03-08 10:34:44 +08:00
Paul Holden 5a9cc63733 MDL-77046 availability: validate profile field in condition. 2023-03-08 10:24:52 +08:00
Paul Holden 1632e59179 MDL-76809 gradereport_history: pre-filter report userids filter.
Ensure current user is able to access each of the provided userids.
2023-03-08 10:01:55 +08:00
Ilya Tregubov 1056e8ba25 Merge branch 'MDL-77446-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-03-08 09:20:38 +08:00
Petr Skoda bb7163fc2b MDL-76645 filter_data: fix link title attribute 2023-03-07 14:55:07 +00:00
Lars Bonczek eb5037adaf MDL-75659 core: Don't render component argument twice in mustache pix helper 2023-03-07 14:55:07 +00:00
Angelia Dela Cruz e25151c437 MDL-77446 Behat: Add coverage for changing uploaded file details 2023-03-07 16:15:44 +08:00
Jun Pataleta 9d3320dd6f Merge branch 'MDL-77428-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-03-03 16:34:44 +08:00
Jake Dallimore 2f8fd40195 weekly release 3.9.19+ 2023-03-03 11:08:50 +08:00
Angelia Dela Cruz 72f1926ed9 MDL-77428 Behat: Add coverage for forum post word count 2023-03-02 13:50:04 +08:00
Jun Pataleta 121012741d Merge branch 'MDL-75012-39-5' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2023-03-02 12:22:35 +08:00
Jake Dallimore 457d2b5e2e Merge branch 'MDL-77461-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2023-03-02 11:43:33 +08:00
Andrew Nicols c696306936 MDL-77461 behat: Use get_course_id instead of DB fetch 2023-03-02 11:08:12 +08:00
Jun Pataleta ef80cb5890 Merge branch 'MDL-77413-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-03-02 09:45:35 +08:00
Jun Pataleta 5ecae9254a Merge branch 'MDL-77417_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2023-03-01 23:52:58 +08:00
Andrew Nicols 05f35b612d Merge branch 'MDL-72727-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2023-03-01 10:48:20 +08:00
Andrew Nicols 45947bca5f MDL-75012 js: Full build of all grunt things 2023-02-28 23:30:56 +08:00
Andrew Nicols bf99f67aae MDL-75012 js: Bump Babel dependencies
Please note that whilst some dependencies have higher versions
available, these are not compatible at this time.
2023-02-28 23:19:40 +08:00
Angelia Dela Cruz 6cd8ffb6c0 MDL-77413 Behat: Minor changes to optimise the existing tests 2023-02-28 17:40:49 +08:00
Angelia Dela Cruz b64c2aeb13 MDL-77413 Behat: Add coverage to verify groups can have a picture 2023-02-28 17:39:46 +08:00
Andrew Nicols 8ed6cc973c MDL-75012 js: Remove unused babel-preset-minify 2023-02-28 11:10:35 +08:00
Andrew Nicols 7d58caa23a MDL-75012 js: Put shifter on a diet
This commit switches to a new custom version of Shifter which sees it
put on a massive diet.

Many of the standard Shifter features are totally unused by Moodle, but
they add dependency spaghetti. Some of those dependencies will start to
cause us issues as they have not been updated for a very long time, are
no longer maintained, and are no longer compatible with anything
resembling a recent version of NodeJS.
2023-02-28 11:10:34 +08:00
Andrew Nicols 3bf5ec446f MDL-75012 js: Bump shifter to new version
This resolves an issue identified in 77083 which identified that GitHub
hashes shouldn't be treated as repeatable.

Whilst GitHub have reverted this change, it's still worth making this
change.
2023-02-28 11:10:34 +08:00
Andrew Nicols e2c7dd3d43 MDL-75012 js: Audit fix 2023-02-28 11:10:34 +08:00
Andrew Nicols daa7fe6afa MDL-75012 js: Bump node-sass 2023-02-28 11:10:34 +08:00
Andrew Nicols 4f2e19bb73 MDL-75012 js: Update browserslist 2023-02-28 11:10:34 +08:00
Paul Holden 81ad3f094d MDL-72727 mod_forum: prevent default favourite toggle click event.
Allow the repository call to the web service method to complete before
re-directing, otherwise the call may not complete and/or races against
the page reload causing random Behat errors.
2023-02-27 23:32:23 +00:00
Eloy Lafuente (stronk7) 9f83c03275 MDL-77417 behat: behat_error_handler meets deprecation error types
Right now, any E_DEPRECATED, E_USER_DEPRECATED error type leads
to exception in behat runs, because the behat error handled is
not aware of them. See MDL-38041 for the initial implementation.

We don't want that to happen and they must behave like other "low"
error types (notices, warnings...), that will be reported in logs
or output, but won't trigger any exception, so the test can continue.

This commit just adds those 2 "new" error types to the handler,
providing the very same behaviour for them than the rest.
2023-02-27 09:39:01 +01:00
Andrew Nicols 2cfb12db0e MDL-75012 js: Bump stylelint and components 2023-02-27 15:03:16 +08:00
Andrew Nicols d6ac705d63 MDL-75012 js: Remove grunt-contrib-uglify
We stopped using this when we updated our processes to support ESMs in
MDL-62497. Removal of the dependency was missed at the time.
2023-02-27 15:03:16 +08:00
Andrew Nicols 0872d00857 MDL-75012 js: Bump standard dependencies
This change bumps dependencies which have no impact upon the build
process
2023-02-27 15:03:16 +08:00
Andrew Nicols f6559c6eaf MDL-75012 core: Bump NodeJS version requirements 2023-02-27 15:03:16 +08:00
Jun Pataleta 9ebd08c452 weekly release 3.9.19+ 2023-02-24 15:43:39 +08:00
Matt Porritt e1a05fd2ee MDL-77376 Licensing: Update trademark.txt
Update Trademark policy in TRADEMARK.txt to
be in line with advice from the Moodle HQ
legal team
2023-02-24 12:37:37 +08:00
Andrew Nicols 260d45cdb1 Merge branch 'MDL-76843_39' of https://github.com/timhunt/moodle into MOODLE_39_STABLE 2023-02-23 11:53:45 +08:00
Andrew Nicols 63c3cb0312 Merge branch 'MDL-77271-39' of https://github.com/lameze/moodle into MOODLE_39_STABLE 2023-02-23 11:49:59 +08:00
Tim Hunt 9e1671f1ea MDL-76843 questions behat: enhancements requried to test this issue
* New steps to set up certian sorts of broken test data.
* Fix qtype_essay_question::un_summarise_response().
2023-02-22 15:34:41 +00:00
Simey Lameze a20cab3aad MDL-77271 behat: verify user licence preference is remembered 2023-02-22 09:31:58 +08:00
Ilya Tregubov 687f8a8479 weekly release 3.9.19+ 2023-02-17 09:12:36 +08:00
Ilya Tregubov f3dc49171b Merge branch 'MDL-75230-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-02-15 16:13:56 +08:00
Ilya Tregubov bc72c006b1 Merge branch 'MDL-77189-39' of https://github.com/lameze/moodle into MOODLE_39_STABLE 2023-02-13 13:45:06 +08:00
Simey Lameze 75103c45dc MDL-77189 behat: basic coverage for wikimedia repository 2023-02-13 13:24:10 +08:00
Paul Holden a0e0aaadcc weekly release 3.9.19+ 2023-02-10 13:47:43 +00:00
Angelia Dela Cruz 7f6ea348ef MDL-75230 behat: Lesson Behat tests optimised
Replace steps that manually add Lesson instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
2023-02-10 08:42:16 +08:00
Andrew Nicols 3977956e75 Merge branch 'MDL-76499-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-02-09 10:08:23 +08:00
Jun Pataleta 34d69085c0 Merge branch 'MDL-74905_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2023-02-08 17:19:03 +08:00
Andrew Nicols 88cef90bec Merge branch 'MDL-77132-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2023-02-07 10:47:27 +08:00
Paul Holden f077d83df1 Merge branch 'MDL-77078-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-02-06 13:33:11 +00:00
Angelia Dela Cruz 0a7e544418 MDL-77078 Behat: Coverage for assignment submission statement 2023-02-06 12:36:36 +08:00
Andrew Nicols b235008ebe Merge branch 'MDL-76662-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2023-02-04 21:53:37 +08:00
Eloy Lafuente (stronk7) 9c13055211 MDL-74905 ci: travis and gha, some adjustments
Apply for some of the improvements made for 4.2:
- Use our own moodlehq/mysql-action
- Define the tmpfs size and ensure that binlogs are disabled.
2023-02-03 19:48:20 +01:00
Eloy Lafuente (stronk7) 28bbf01761 MDL-74905 environment: Apply agreed changes:
- PHP 8.0 required.
- Moodle 3.11.8 required (first minor supporting PHP 8.0 officially).
- MySQL 8.0 required.
- MariaDB 10.6.7 required.
- PostgreSQL 13 required.
- php-sodium extension required.
- 64-bit PHP required.
2023-02-03 19:48:20 +01:00
Eloy Lafuente (stronk7) 33467d709c MDL-74905 environment: 4.2 base information
This is a direct copy of the 4.1 information, to
have all the real changes under control in next commit(s).
2023-02-03 19:48:20 +01:00
Paul Holden f3142c10a7 MDL-77132 phpunit: fix data provider method names.
Orginally missed in 1d74ef12 when only the notation was updated,
excluding the actual provider method names.
2023-02-03 10:57:07 +00:00
Jun Pataleta e23d81ca40 weekly release 3.9.19+ 2023-02-03 15:43:51 +08:00
Angelia Dela Cruz 1f81646cbb MDL-76499 behat: Resource Behat tests optimised
Replace steps that manually add resource instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.

Co-authored-by: David Woloszyn <david.woloszyn@moodle.com>
2023-02-03 14:34:42 +08:00
Andrew Nicols 6417d9c239 Merge branch 'MDL-75830-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-02-02 11:59:16 +08:00
Andrew Nicols 398323186d Merge branch 'MDL-76675_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2023-02-02 11:05:03 +08:00
Andrew Nicols 7e0858ce24 Merge branch 'MDL-75912-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-02-02 09:45:20 +08:00
Angelia Dela Cruz 1f0b64e4b8 MDL-75830 behat: Book behat tests optimised
Replace steps that manually add Book instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
Additionally, performed Behat cleanup and optimisation to affected
files.
2023-02-02 08:59:47 +08:00
Paul Holden 2170957e21 Merge branch 'MDL-76658-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-02-01 16:34:47 +00:00
Ilya Tregubov 47c28805bf Merge branch 'MDL-76587-39' of https://github.com/lameze/moodle into MOODLE_39_STABLE 2023-02-01 13:27:30 +08:00
Angelia Dela Cruz 52705b73f5 MDL-75912 behat: Wiki Behat tests optimised
Behat cleanup and optimisation
2023-02-01 11:38:00 +08:00
Angelia Dela Cruz cd4916f0e7 MDL-76658 Behat: Coverage for course cohort enrolment groups
Co-authored-by: Simey Lameze <simey@moodle.com>
2023-01-31 20:04:58 +08:00
Simey Lameze 8f942e6e59 MDL-76587 behat: make grading page wider to avoid 'out of bounds' fail
This is because on classic theme the navigation block pushes the content
to the right and once behat changes the grades the 'Save changes' button
is no longer visible.
2023-01-31 11:21:38 +08:00
Andrew Nicols 2fb08b1a82 Merge branch 'MDL-77040-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2023-01-30 12:28:49 +08:00
Eloy Lafuente (stronk7) f4be9af77e MDL-76675 date: Only test all TZ names with PHPUNIT_LONGTEST enabled
It happens often that some timezone is renamed, split, added to the
IANAs list of timezones (that, for PHP is kept updated by the
php-timezonedb PECL extension).

When the information coming from the extension changes, all the
PHPUnit jobs in the world start failing (that's when CIs update
their PHP images, when devs update their packages, ...).

So, what we are doing here is to move that test that check for
every single string existing to be run only when PHPUNIT_LONGTEST
is enabled. That way only places running all tests will run that
one. And every other run just will skip it.

This corresponds to point 1 & 2 of the issue, lower impact in general
and, still be able to enable the tests to run.
2023-01-27 08:50:44 +01:00
Paul Holden 9c06ad7c0e MDL-77040 core: assert types of returned Geoplugin data, not values.
The results we get from these tests are beyond our control, and are
unreliable for use in testing.

See also previous change 215cd2d8 in similar tests.
2023-01-26 13:24:21 +00:00
Paul Holden 98b361c489 MDL-76662 tool_log: correct supported reports test assertions. 2023-01-26 13:08:55 +00:00
Sara Arjona 0f635409c2 weekly release 3.9.19+ 2023-01-26 09:59:25 +01:00
Jun Pataleta b4489cb423 Merge branch 'MDL-76977-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2023-01-25 16:08:22 +08:00
Jun Pataleta c0b23f5e20 Merge branch 'MDL-77036-39' of https://github.com/lameze/moodle into MOODLE_39_STABLE 2023-01-25 16:00:09 +08:00
Simey Lameze 9f5c27e117 MDL-77036 core_iplookup: update test_ipv4 test expectations 2023-01-25 15:27:22 +08:00
Jun Pataleta 9f02db13e2 Merge branch 'MDL-76639-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-01-24 18:59:01 +08:00
Jun Pataleta 3cd414a328 Merge branch 'MDL-76655-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2023-01-24 18:26:39 +08:00
Angelia Dela Cruz e675506687 MDL-76655 behat: Coverage for workshop grading strategies 2023-01-24 10:21:53 +08:00
Paul Holden b460bbc0c5 MDL-76977 phpunit: ensure unique data provider keys in mustache test. 2023-01-20 17:31:32 +00:00
Ilya Tregubov cf48a979ae weekly release 3.9.19+ 2023-01-20 09:41:53 +08:00
Ilya Tregubov 873fbf39c7 Merge branch 'MDL-76870-39' of https://github.com/lameze/moodle into MOODLE_39_STABLE 2023-01-19 11:17:12 +08:00
Andrew Nicols 138ff31ef0 Merge branch 'MDL-76841-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2023-01-19 08:56:02 +08:00
Andrew Nicols d8e2154b8c Merge branch 'MDL-70070-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2023-01-19 08:51:57 +08:00
Paul Holden b3da8767ad MDL-76841 tool_mobile: improve potential config issues test.
Avoid certificate checking of the default test site (`example.com`),
and update the assertion so we get clearer failures in the future.
2023-01-16 08:30:23 +00:00
Paul Holden 1d74ef1255 MDL-70070 phpunit: correct data provider method names.
They should not be prefixed `test_` because that's how actual
test methods containing assertions are identified by PHPUnit.
2023-01-16 08:28:14 +00:00
Jun Pataleta fc01a52823 Moodle release 3.9.19 2023-01-14 14:16:56 +08:00
Simey Lameze 70bb1b7d0a MDL-76870 question: change assertion to assertEqualsCanonicalizing
By using that assertion the arrays will be sorted before comparison
preventing any Oracle sorting related failures.

Credits for the solution go to Tim Hunt!
2023-01-13 18:13:32 +08:00
Angelia Dela Cruz 871e392987 MDL-76639 behat: Add Behat test coverage for quiz with limited attempts 2023-01-13 16:34:59 +08:00
Jun Pataleta d84283e8cc weekly release 3.9.18+ 2023-01-13 10:52:29 +08:00
Jake Dallimore 9f1768c098 MDL-76862 user: Unit test for setting user home page preferences 2023-01-12 11:25:57 +08:00
Paul Holden 4babd8cdb7 MDL-76862 user: ensure user can only update own preferred start page. 2023-01-12 11:17:25 +08:00
Tim Hunt 312318201b MDL-76810 redirect handling: ensure return URLs are properly sanitised 2023-01-11 11:44:41 +08:00
Paul Holden 3d9ac7137e Merge branch 'MDL-76811-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2023-01-10 16:40:08 +00:00
Andrew Nicols 838e230d54 MDL-76811 mod_data: Remove duplicate tests 2023-01-10 11:19:14 +08:00
Andrew Nicols c26ac2e85d MDL-76811 mod_data: strpos check should be strict 2023-01-10 11:19:13 +08:00
Andrew Nicols ee3504f673 MDL-76811 mod_data: Generator test cleanup 2023-01-10 11:19:13 +08:00
Paul Holden 31256fae74 weekly release 3.9.18+ 2023-01-05 10:53:18 +00:00
Sara Arjona 0c91f5a454 Merge branch 'MDL-76375-39' of https://github.com/lucaboesch/moodle into MOODLE_39_STABLE 2023-01-04 16:22:07 +01:00
Luca Bösch 1ab21607a5 MDL-76375 quiz generator: Allow more than one attempt by Behat tests. 2023-01-04 15:15:57 +01:00
Sara Arjona 05fc7360c9 Merge branch 'MDL-76760-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2023-01-02 12:27:59 +01:00
Sara Arjona 4c3211871d weekly release 3.9.18+ 2022-12-29 12:58:01 +01:00
Sara Arjona 95f7d16801 Merge branch 'MDL-76399-patch-39' of https://github.com/ilyatregubov/moodle into MOODLE_39_STABLE 2022-12-29 09:13:54 +01:00
Ilya Tregubov 400b2086ff MDL-76399 behat: switch to appropriate Behat step for selects. 2022-12-29 14:33:55 +07:00
Ilya Tregubov 7ef99eb8cf Merge branch 'MDL-76399-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2022-12-29 09:44:59 +07:00
Paul Holden ab4b2404c7 MDL-76760 tool_behat: defer library loading until service execution.
Ensures that API documentation can be generated without requiring
the presence of the `vendor/` directory.
2022-12-28 10:47:59 +00:00
Ilya Tregubov d859c2875c Merge branch 'MDL-76731_39' of https://github.com/PhilippImhof/moodle into MOODLE_39_STABLE 2022-12-28 15:15:31 +07:00
Philipp Imhof d14ff96dfa MDL-76731 behat: add steps to check for version
Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2022-12-22 17:10:57 +01:00
Ilya Tregubov bc53f961e7 weekly release 3.9.18+ 2022-12-22 19:16:44 +07:00
Andrew Nicols 91b2170fdb MDL-75105 tool_behat: Coding style fixes 2022-12-22 12:34:07 +07:00
Andrew Nicols fadadf8a64 Merge branch 'MDL-75105_39_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_39_STABLE 2022-12-22 12:34:07 +07:00
Mark Johnson 65be624c43 MDL-75105 tool_behat: List available data generators
This will find all data generators that can be used in behat via the
'the following "something" exist:' step, and display them in a select
list on the step definitions page.

When a generator is selected, it will fetch the required fields for that
generator and display them on the page.
2022-12-21 08:38:49 +00:00
Paul Holden 3e5d4ba208 MDL-76399 question: switch to appropriate Behat step for selects. 2022-12-16 13:14:02 +00:00
Paul Holden dfea1a4f0d MDL-76399 behat: improvements to "should exist in" thrown exception. 2022-12-16 12:29:06 +00:00
Andrew Nicols 2409994d32 weekly release 3.9.18+ 2022-12-16 09:06:07 +08:00
Sara Arjona 05dd1161a4 Merge branch 'MDL-76674_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2022-12-14 18:35:14 +01:00
Eloy Lafuente (stronk7) 7ed61f310b MDL-76674 core_lang: Add string for new America/Ciudad_Juarez 2022-12-14 15:52:36 +01:00
Paul Holden 15b8b5cdf0 Merge branch 'MDL-76666_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2022-12-14 13:22:11 +00:00
Eloy Lafuente (stronk7) e6eb619c08 MDL-76666 local_langimport: Better handling of long locales
Under some linux versions, and depending of the configured
locale categories, it's possible to get a current locally
which length > 255 when calling to setlocale(LC_ALL, 0).

Later, if that long locale is tried to be restored, there
is a "setlocale(): Specified locale name is too long" warning
error.

When that happens we need to split the long locale into
individual chunks and set all the (six) locale categories
supported one by one.

Covered with tests, note that, in practice, this only
happens with linux because it supports 12 locale categories
@ OS level. Both BSD (6) and Windows (5) hardly can reach the limit.

No matter of that, the tests have been designed to ensure that
they pass on all OSs, just the new code only will be executed
on linux.
2022-12-14 12:40:38 +01:00
Andrew Nicols 8826294d5d Merge branch 'MDL-76398-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2022-12-11 20:21:33 +08:00
Sara Arjona cf2780d5c2 weekly release 3.9.18+ 2022-12-09 08:57:16 +01:00
Jun Pataleta 154bf3d9f5 Merge branch 'MDL-73017-M39_add-environment-check-for-versions-not-supporting-php-8-1' of https://github.com/ziegenberg/moodle into MOODLE_39_STABLE 2022-12-07 13:47:35 +08:00
Ilya Tregubov 768d683beb Merge branch 'MDL-76490-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2022-12-06 13:11:31 +03:00
Andrew Nicols 7f8aca035d Merge branch 'MDL-75446-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2022-12-06 15:21:49 +08:00
Paul Holden 8db1cdf462 MDL-76490 behat: use defined step for interaction with autocomplete. 2022-12-05 14:27:46 +00:00
Marina Glancy 48dc7ef01e MDL-76490 behat: correct step for opening autocomplete in container. 2022-12-05 14:22:08 +00:00
Daniel Ziegenberg d782e76640 MDL-73017 env: Moodle 3.9.x, 3.11.x and 4.0.x do not support PHP 8.1
This commit adds an additional environment check for the unsupported
PHP 8.1 version to Moodle 3.9.x, 3.11.x and 4.0.x.

It also updates the lang string for unsupported PHP version.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2022-12-05 11:44:03 +01:00
Angelia Dela Cruz e693c811f0 MDL-75446 behat: Workshop behat generators use UI
Replace steps that manually add Workshop instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
2022-12-05 17:56:43 +08:00
Sara Arjona d2f37aab56 weekly release 3.9.18+ 2022-12-01 16:08:12 +01:00
Jun Pataleta 8d08094ac3 Merge branch 'MDL-76429_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2022-11-30 10:52:21 +08:00
Andrew Nicols 8483f7adef Merge branch 'MDL-75960-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2022-11-29 17:06:06 +08:00
info@eWallah.net 4cffe42b56 MDL-65939 phpunit: Maildigest tests can query a wrong adhoc task 2022-11-29 15:43:45 +08:00
Andrew Nicols 84935b9585 Merge branch 'MDL-76058-39' of https://github.com/lameze/moodle into MOODLE_39_STABLE 2022-11-29 15:38:39 +08:00
Angelia Dela Cruz bf8f9164c0 MDL-75960 behat: Survey behat generators use UI
Replace steps that manually add Survey instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
2022-11-28 10:22:29 +08:00
Eloy Lafuente (stronk7) 64b5af4b58 MDL-76429 composer: Bump to phpwebdriver 1.2.1 for php81 compat
This fix is really only required for Moodle 4.1 and up, that will
be the one supporting php81, but we always apply composer changes
to all branches (supported and security), so we keep them running
the same stuff.

Note this comes with a bunch of other small updates, all them
pretty minor and should not be problematic. Better we get them
than keeping them apart.
2022-11-25 16:27:39 +01:00
Ilya Tregubov 959721b58a weekly release 3.9.18+ 2022-11-25 15:38:36 +03:00
Jun Pataleta 746fa817c1 Merge branch 'MDL-76340-39' of https://github.com/stevandoMoodle/moodle into MOODLE_39_STABLE 2022-11-25 08:21:32 +08:00
Stevani Andolo cfce223e9b MDL-76340 VideoJS: Fix video controls not showing
- Fixed the menu item not being displayed as expected
2022-11-24 22:57:30 +08:00
Paul Holden 375d8ffb56 MDL-76398 behat: broader action menu partial matching by element.
For action menu elements whose trigger element isn't plain text
(e.g. a pix icon), we should be able to match via the title of
that element.
2022-11-21 16:59:31 +00:00
Jun Pataleta f89a47eff8 Moodle release 3.9.18 2022-11-12 12:55:12 +08:00
Sara Arjona 6a16596f78 weekly release 3.9.17+ 2022-11-11 15:02:06 +01:00
Mathew May 7e22b75c28 MDL-71920 libraries: Migrate LTI lib away from pure curl 2022-11-11 12:55:19 +08:00
Mathew May 7d547f726f MDL-71920 core: update filelib opt name definition 2022-11-11 12:55:19 +08:00
Paul Holden 75c9e608ce MDL-75862 backup: omit sesskey for continue buttons using get method.
It's automatically added by the rendered single_button instance when
using post method, so no need to add it unconditionally.
2022-11-10 10:17:50 +08:00
Jun Pataleta fa8591ea3e Merge branch 'MDL-76054_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2022-11-09 20:08:49 +08:00
David Woloszyn ae8c5e16e9 MDL-76091 lib: Add additional check to local URLs params 2022-11-09 19:24:56 +08:00
Simey Lameze 4fe95b0e61 MDL-76058 behat: send message using data generator 2022-11-09 09:52:22 +08:00
Eloy Lafuente (stronk7) 5425233b37 MDL-76054 environment: Remove the php-xmlrpc extension check
For Moodle 4.1 and up, the php-xmlrpc is not needed anymore:
- All the MNet stuff has been moved to use php library (MDL-76055).
- The webservice/xmlrpc has been moved from core to contrib (MDL-76052).

So we just remove the check here. Starting with 4.1, it's not
needed for any core functionality.

No lang string changes in this branch, only in master (4.1dev).
2022-11-08 16:47:53 +01:00
Stevani Andolo dcc561762b MDL-75278 VideoJS: Update VideoJS to use validation helper 2022-11-08 13:57:20 +00:00
Víctor Déniz 6307f8dd89 weekly release 3.9.17+ 2022-11-08 13:44:57 +00:00
Jun Pataleta 1a3e679835 Merge branch 'MDL-76207-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2022-11-08 10:25:12 +08:00
Andrew Nicols 6cfdd1bbae Merge branch 'MDL-75880_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2022-11-07 21:57:45 +08:00
Andrew Nicols 56a368facf MDL-76207 contentbank: Switch to opened window 2022-11-06 21:00:33 +08:00
Eloy Lafuente (stronk7) 4842ae967c MDL-75880 phpunit: fix all @coversDefaultClass missing @covers
Because @coversDefaultClass doesn't indicate any coverage (it's
just an alias to avoid having to write the class name in @covers),
this commit fixes all the files that were using that annotation
and missing any @covers.

Basically, replacing one by the other and done.
2022-11-04 16:51:36 +01:00
Sara Arjona 6f62e05a96 weekly release 3.9.17+ 2022-11-04 14:52:11 +01:00
Jun Pataleta 6f23e028dd Merge branch 'MDL-76103-39' of https://github.com/junpataleta/moodle into MOODLE_39_STABLE 2022-11-04 11:34:02 +08:00
Marina Glancy ff013438d6 MDL-76103 search: skip solr behat tests if solr is not installed 2022-11-04 11:22:27 +08:00
Jun Pataleta 3e0941fb5b Merge branch 'MDL-76072-39' of https://github.com/lameze/moodle into MOODLE_39_STABLE 2022-11-04 10:37:19 +08:00
Simey Lameze e667c191f8 MDL-76072 tool_lp: only init inlineGrader module if user can grade 2022-11-04 08:04:30 +08:00
Sara Arjona 4566a44f14 Merge branch 'MDL-76169-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2022-11-03 17:06:28 +01:00
Andrew Nicols 8b2c0d969d MDL-76169 behat: Normalise exception message in should (not) steps
These steps have accepted a NodeElement instance as an argument for some
time, but were trying to cast it to string when formulating exception
messages, making it harder to debug and, in the case of the 'should see'
step, not work at all.

This patch introduces a new function to produce a consistent naming for
them.
2022-11-03 13:28:51 +08:00
Andrew Nicols 32d337a934 MDL-76169 behat: Add improved steps for using action menus
This commit adds new steps related to action menus to support:
* Choosing an item in a named action menu
* Choosing an item in a named action menu within a container
* Confirming that an action menu item does or does not exist in a named
  action menu
* Confirming that an action menu item does or does not exist in a named
  action menu within a container

The existing action menu steps were insufficient as they assume that
there is only one action menu within he container, which is not
necessarily the case.

The existing action menu steps are not non-JS friendly and will error if
JS is disabled, without providing any fallback when one is easily
available.

Unfortunately these steps cannot be used to replace the existing steps
without manual intervention.
2022-11-03 13:28:51 +08:00
Sara Arjona 4e1d36c8bc weekly release 3.9.17+ 2022-10-28 14:09:25 +02:00
Víctor Déniz 87c2aae85c Merge branch 'MDL-75969-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2022-10-27 15:45:39 +01:00
Jun Pataleta 8c6831f0fe weekly release 3.9.17+ 2022-10-25 17:17:19 +08:00
Andrew Nicols 5dbc672825 Merge branch 'MDL-76049_39' of https://github.com/timhunt/moodle into MOODLE_39_STABLE 2022-10-25 11:50:46 +08:00
Ilya Tregubov b97d313c11 weekly release 3.9.17+ 2022-10-21 15:33:55 +03:00
Tim Hunt ee0b0b4fc8 MDL-76049 quiz generator: update calendar events for new overrides 2022-10-20 23:44:54 +01:00
Andrew Nicols 5b707aa422 MDL-75985 behat: Return newline character for \n
Somehow part of this commit was lost during the push and/or squash.
2022-10-19 22:02:55 +08:00
Sara Arjona 519ba9e103 Merge branch 'MDL-76010_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2022-10-19 12:56:39 +02:00
Jun Pataleta c3a318e16a Merge branch 'MDL-75985-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2022-10-19 10:55:28 +08:00
Eloy Lafuente (stronk7) faf63d076d MDL-76010 behat: New scenario to verify that manual attempts work
This is basically the manual background that was removed in the
previous commit, with 4 attempts here. Note it includes the 2
waits that are REQUIRED to make it pass in too-quick environments.

If they are removed, they begin to fail because it seems that
the attempts need a minimum of separation between them.
2022-10-18 14:28:14 +02:00
Eloy Lafuente (stronk7) b1fe51cf0d MDL-76010 behat: Move feature to use attempts generator
This moves away from manual attempts and uses the activity
attempts generator instead. Quicker and not exposed to the
problems with clicks, refreshes and missing attempts.

Note that there is a small change in the attempt generator
so, now, when a new attempt is created, if the activity has
tracking enabled, the final result / grades are recalculated.

That's the real behaviour when the activity settings are
changes in the edition form and it's natural to get them
recalculated without having to visit the form. Specifically,
this allows the 1st scenario to pass, because in that scenario
no changes to the form are being performed.

Also, little detail, amend a dupe scenario name.
2022-10-18 14:28:14 +02:00
Sara Arjona 651a97efc0 weekly release 3.9.17+ 2022-10-18 13:10:01 +02:00
Víctor Déniz cd8af2d23a Merge branch 'MDL-75983_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2022-10-18 01:09:35 +01:00
Sara Arjona 8b75bb1772 Merge branch 'MDL-72836-39' of https://github.com/mickhawkins/moodle into MOODLE_39_STABLE 2022-10-17 16:40:07 +02:00
Andrew Nicols b672263e04 MDL-75969 behat: Allow the editor field to request a save
Some editors do not immediately store their content to the textarea they
represent and only do so when the form is submitted or they are
requested to.

This change adds to the existing API to allow an (optional)
`store_current_value` function to be defined for the editor type so that
it can use the JavaScript API to persist any current content to the
editor.
2022-10-14 23:46:25 +08:00
Andrew Nicols 1b506c9639 MDL-75985 behat: Standardise HTML output when comparing editor content
This commit adds a standardise_html function and updates the matches
function to compare normalised content.

This allows for a wider variety of valid editor output to be handled
using the standard value matching steps in Behat, thus supporting
editors other than Atto better.
2022-10-14 23:44:11 +08:00
Eloy Lafuente (stronk7) c463d72821 MDL-75983 gha: Update used actions to be node16 compatible
Node12 is being deprecated in github for actions:

https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/

So we need to ensure we are using node16 actions.
2022-10-14 13:28:33 +02:00
Sara Arjona 162053448e weekly release 3.9.17+ 2022-10-14 12:49:26 +02:00
Sara Arjona 2034d440af Merge branch 'MDL-75959-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2022-10-13 16:03:50 +02:00
Jun Pataleta 70f7efe0fe Merge branch 'MDL-75887-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2022-10-12 09:22:17 +08:00
Simey Lameze f1447db751 MDL-75887 behat: Add ability to set value regardless of the editor
Prior to this commit, the behat_form_editor integration was hard-coded
to use Atto.

This change allows other editors to be used to set editor values, and
breaks that hard bond. Following this change, any editor is able to
define a behat_editor_[name].php file defining a function which meets
the following signature:

  set_editor_value(string $editorid, string $value): void

Each editor is responsible for checking whether its own API is available
and calling any relevant functions to force the editor to set the
content.

Please note: Behat is unable to determine the current editor in use on
the page automatically.
2022-10-12 06:44:30 +08:00
Andrew Nicols 7fc01a94e2 MDL-75959 customfield: Correct inappropriate class import
I suspect this was an incorrect tab completion import by an IDE which
was missed.
2022-10-12 06:40:26 +08:00
Jun Pataleta 568e72e7dc weekly release 3.9.17+ 2022-10-11 23:16:45 +08:00
Jun Pataleta 5d4db3dce3 Merge branch 'MDL-75909-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2022-10-10 18:07:58 +08:00
Jun Pataleta e5c7b50d85 Merge branch 'MDL-75922-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2022-10-10 14:54:04 +08:00
Jun Pataleta 9fda41582c Merge branch 'MDL-75910-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2022-10-10 11:06:49 +08:00
Simey Lameze bddacfd5d7 MDL-75922 behat: Apply @editor_atto tag to tests requiring Atto
These steps are currently using Atto-specific UI features and must
therefore make use of the @editor_atto tag to ensure that they continue
to run using Atto.

A new issue will be raised to migrate each of these to be
editor-agnostic.
2022-10-09 20:28:07 +08:00
Michael Hawkins f3d9759375 MDL-72836 core: Updated security.txt expiry and policy URL 2022-10-07 14:12:23 +08:00
Andrew Nicols 1d776476b6 weekly release 3.9.17+ 2022-10-07 13:04:06 +08:00
Simey Lameze fca9778023 MDL-75910 core_form: Allow editor field to set a hidden label
When an editor is used in a form as part of a group, it is missing its
label element.

This happens because there is no inline template for the editor, and
therefore it reverts to using the old `toHtml` function. The legacy
function does not cater to the editor being in a group, and therefore
does not add the hidden label.

In addition, the hiddenLabel attribute was missing from the editor
element. This is a semi-standard element but must be added to each
supporting element.

Both the missing inline template for the editor, and the hidden label
attribute must be present:
- If the hidden label attribute is not present, then the standard inline
  template will add a visible label within the group.
- If the inline editor template is missing, then the label is not shown
  at all.
2022-10-06 22:54:20 +08:00
Andrew Nicols 482de4e370 MDL-75909 mod_data: Make template editor use html editor
When the template editor is configured to use the HTML Editor, it should
indicate this to Behat by setting the `data-fieldtype` to "editor".

This indicates to the behat field manager that the editor is in use,
which ensures that the correct value setting can take place.

This is important in the context of MDL-75887.
2022-10-06 21:49:08 +08:00
Shamim Rezaie 91f43dd47f Merge branch 'MDL-75886-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2022-10-06 12:25:07 +11:00
Andrew Nicols fa9ba48533 MDL-75886 atto: Always use Atto for @atto tests
This change, which should be easy to mimic for other editors.

This will ensure that the correct editor is used for tests relating to
that editor, or its subplugins.
2022-10-05 09:57:54 +08:00
Jake Dallimore 141657a483 weekly release 3.9.17+ 2022-09-30 10:17:43 +08:00
Jun Pataleta c8be5a9ab3 Merge branch 'MDL-75559-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2022-09-29 10:53:14 +08:00
Jun Pataleta 507f737266 Merge branch 'MDL-75726_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2022-09-28 08:12:26 +08:00
Jun Pataleta 6d75761b94 Merge branch 'MDL-75776_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2022-09-28 08:06:32 +08:00
Eloy Lafuente (stronk7) 52a9113c6d MDL-75726 ci: Bump GHA to Ubuntu 22.04
Have tried to also bump Travis to 22.04 (jammy) but it
was not working ok, with problems trying to find both
PHP and PostgreSQL versions.

Surely that's because 22.04 support is really new (Sep 9, 2022):

https://blog.travis-ci.com/22-9-9-ubuntujammy

So we'll have to wait a little more before being able to, also,
bump Travis to use 22.04
2022-09-22 17:45:23 +02:00
Eloy Lafuente (stronk7) 94f703e1d1 MDL-75776 composer: minor updates
In stables, just minors updates to components.

Generated using the instructions @ https://docs.moodle.org/dev/Composer
and using PHP 7.2 (always the min version supported) to generate the
lock file.
2022-09-22 17:44:51 +02:00
Eloy Lafuente (stronk7) d9ceef45de weekly release 3.9.17+ 2022-09-22 17:05:56 +02:00
Jun Pataleta 1ad332bbde Merge branch 'MDL-75757_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2022-09-19 13:01:43 +08:00
Eloy Lafuente (stronk7) d23efa1ff2 MDL-75757 phpunit: Add some tolerance to a few failing assertions
Recently, PHPUnit (all versions) did some changes about how the
comparators worked and this has caused some float comparisons
to stop working.

We need to move them to assertEqualsWithDelta(), allowing a small
tolerance to workaround the floats comparison problem.

0.00001 has been decided. And applied to all the similar assertions
within the unittest function, so if more cases are added to them
better be copied with the agreed tolerance.
2022-09-18 16:02:18 +02:00
Andrew Nicols bf1ebf3b44 MDL-75559 behat: Sort behat_hooks to top of context list 2022-09-12 12:33:46 +08:00
Eloy Lafuente (stronk7) 33e9b8c394 Moodle release 3.9.17 2022-09-10 12:15:47 +02:00
Jun Pataleta 5bb0f00c0e weekly release 3.9.16+ 2022-09-09 08:36:54 +08:00
Paul Holden 670b636c47 MDL-72012 mod_h5pactivity: respect user access when getting report. 2022-09-08 21:17:57 +08:00
Paul Holden e48460c8cc MDL-75695 mod_h5pactivity: add group filter to attempts report.
This is a backport from MDL-71662.
2022-09-08 17:14:00 +04:00
Michael Hawkins ad5bc5b5ca MDL-68066 output: Apply disable lambda rendering to Mustache renderer 2022-09-07 23:57:05 +08:00
Lars Bonczek 013cb2fb64 MDL-68066 output: Mustache - Add option to disable lambda rendering
This commit is based on an outstanding pull request to the Mustache repo
2022-09-07 23:57:05 +08:00
stevando c4df60bb8d MDL-75283 admin: Update admin user fetching to use sort helper 2022-09-07 13:18:55 +08:00
Paul Holden 786a4956dd MDL-75405 block_html: safer unserialize during old block conversion. 2022-09-06 17:57:15 +02:00
Jun Pataleta 323e272c85 Merge branch 'MDL-75231-39' of https://github.com/lameze/moodle into MOODLE_39_STABLE 2022-09-06 23:49:01 +08:00
Sara Arjona 6e769797fd Merge branch 'MDL-75550-39' of https://github.com/mickhawkins/moodle into MOODLE_39_STABLE 2022-09-05 08:57:43 +02:00
Jun Pataleta 0a48ddad8f Merge branch 'MDL-75641_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2022-09-05 14:37:02 +08:00
Eloy Lafuente (stronk7) c939cd4b6d MDL-75641 core_lang: Add string for new Europe/Kyiv timezone
With IANA TZDB (timezone database) release 2022b, Europe/Kiev
has been renamed to Europe/Kyiv. So we need to add this string
to our list to keep tests passing.

Note that the old Europe/Kiev continues working (is an alias) and,
also, there are places in core where we are using it. Just we cannot
remove/replace those uses in core until we ensure that everybody is
using PHP 8.0.23 (TZDB 2022b) or more recent versions. Hence,
not changing those uses now.
2022-09-04 10:06:39 +02:00
Ilya Tregubov fd27acfcb1 weekly release 3.9.16+ 2022-09-02 08:49:23 +04:00
Jun Pataleta 9ae0e4a58b Merge branch 'MDL-75019-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2022-08-31 20:24:37 +08:00
Ilya Tregubov 874472a85d Merge branch 'MDL-74861-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2022-08-31 11:51:54 +04:00
Michael Hawkins 5f893f890f MDL-75550 lib: Update Mustache const to reflect correct version
Mustache version 2.14.1 is already included, but the VERSION const
incorrectly listed 2.14.0 in the tagged Mustache release. A later
upstream commit corrected this in the library, which this now matches.
2022-08-31 15:29:59 +08:00
Simey Lameze 69e03eacba MDL-75231 files: make bucket calculations more precise
This commit changes changes the unit test calculations to
keep track of the time the bucket starts/finishes bursting
and use milliseconds instead of seconds to have a precise
time to sleep.
2022-08-22 14:24:09 +08:00
Sara Arjona d369112db4 Moodle release 3.9.16 2022-08-19 09:50:36 +02:00
Sara Arjona 62d603a054 weekly release 3.9.15+ 2022-08-18 14:54:24 +02:00
Laurent David 4cb39164fa MDL-75210 mod_quiz: fix sequential quiz access
* As a student I should only be able to access the next question or the current question
* The API should not show more than the current question
* Once the quiz is previewed we can see the question in any order (existing behaviour)
* Related to ticket MDL-71728

Co-authored-by: Rajneel Totaram <rjnlfj@yahoo.com>
Co-authored-by: Tim Hunt <t.j.hunt@open.ac.uk>
2022-08-18 08:08:50 +04:00
Sara Arjona d5e8561011 Merge branch 'MDL-72178-39' of https://github.com/NoelDeMartin/moodle into MOODLE_39_STABLE 2022-08-16 16:58:50 +02:00
Mark Johnson 944455bcce MDL-75388 lib: Update mustache to 2.14.1
MDL-67114 local change removed as it is now available upstream.
2022-08-12 04:17:17 +02:00
Petr Skoda ee888615ea MDL-75237 core: improve PARAM_SAFEPATH docs 2022-08-12 04:17:17 +02:00
Petr Skoda 3f58d35337 MDL-75237 qformat_blackboard_six: sanitise blackboard import file paths 2022-08-12 04:17:17 +02:00
Petr Skoda 6983a17fc0 MDL-75237 core: Revert MDL-72029
This reverts commit 9f270d956e.
2022-08-12 04:17:17 +02:00
Petr Skoda ce2d88a951 MDL-75237 qformat_blackboard_six: Revert MDL-72029
This reverts commit 47c211ba0e.
2022-08-12 04:17:17 +02:00
Shamim Rezaie 5a4f73d144 weekly release 3.9.15+ 2022-08-12 11:53:00 +10:00
Noel De Martin 1c8396e2b5 MDL-72178 feedback: Implement behat generators
Based on Andrew's WIP from https://github.com/andrewnicols/moodle/commit/b3d40cb20d1f0edf0bf21077c8f94bce5dec56db

Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2022-08-11 10:59:09 +02:00
Jun Pataleta 5668055015 Merge branch 'MDL-74636_39' of https://github.com/timhunt/moodle into MOODLE_39_STABLE 2022-08-09 11:01:00 +08:00
Angelia Dela Cruz 1dfd13841a MDL-74861 behat: H5P behat generators use UI
Replace steps that manually add H5Pactivity instances via the UI
and use Behat generators. This improves the speed of the Behat test
runs.

Co-authored-by: Simey Lameze <simey@moodle.com>
2022-08-08 12:54:02 +08:00
Jun Pataleta 405cd4fb35 Merge branch 'MDL-74211-39' of https://github.com/lameze/moodle into MOODLE_39_STABLE 2022-08-08 11:15:15 +08:00
Ilya Tregubov 2f4b6bd2d7 Merge branch 'MDL-74475-39' of https://github.com/aanabit/moodle into MOODLE_39_STABLE 2022-08-05 13:21:21 +04:00
Ilya Tregubov acf70635c6 weekly release 3.9.15+ 2022-08-05 13:06:07 +04:00
Angelia Dela Cruz 5d15e96a98 MDL-75019 behat: Folder behat generators use UI
Replace steps that manually add Folder instances via the UI and
use Behat generators. This improves the speed of the Behat test
runs.
2022-08-05 15:53:57 +08:00
Marina Glancy e3b1e103bd MDL-74502 behat: when setting a field value it may not be visible
for example in case of editor field, the textarea element is hidden by wysiwyg widget but we still need to be able to set it
2022-08-04 11:10:43 +08:00
Andrew Nicols 8d1867cdcc Merge branch 'MDL-75080-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2022-08-04 10:45:25 +08:00
Simey Lameze 2cfa9817b1 MDL-74211 behat: convert few more steps to use new data generators 2022-08-04 10:43:36 +08:00
Andrew Nicols 641b8c31ee Merge branch 'MDL-74655-39' of https://github.com/NoelDeMartin/moodle into MOODLE_39_STABLE 2022-08-04 10:09:22 +08:00
Noel De Martin 6ce1d39f4e MDL-74655 competency: Implement behat generators 2022-08-03 10:49:41 +02:00
Amaia Anabitarte 9d4fb0a3ad MDL-74475 core_badges: Behat test using new step 2022-08-03 10:30:53 +02:00
Amaia Anabitarte 4110054b51 MDL-74475 behat: Option to jump to course edit page 2022-08-03 10:30:53 +02:00
Tim Hunt dd4d110c9b MDL-74636 behat: step to skip this scenario if a plugin isn't installed 2022-07-29 09:50:56 +01:00
Simey Lameze 017f8ff6bf MDL-74211 behat: replace steps to use new categories page type 2022-07-29 13:24:44 +08:00
Simey Lameze 1ff7beef8f MDL-74211 behat: add course question categories page type 2022-07-29 13:24:35 +08:00
Simey Lameze 35783784b3 MDL-74211 quiz: make use of question data generators 2022-07-29 13:13:46 +08:00
Angelia Dela Cruz 194ca4970a MDL-75080 behat: Chat behat generators use UI
Replace steps that manually add Chat instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
2022-07-29 11:51:46 +08:00
Jun Pataleta d4f3852dd2 weekly release 3.9.15+ 2022-07-29 10:56:51 +08:00
Andrew Nicols 3fbbc7a86b Merge branch 'MDL-73788-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2022-07-26 11:39:02 +08:00
Jun Pataleta 7cff4e8bc1 Merge branch 'MDL-74057-39-fix' of https://github.com/junpataleta/moodle into MOODLE_39_STABLE 2022-07-26 11:11:23 +08:00
Jun Pataleta 827803ea3d MDL-74057 mod_scorm: Fix unnecessary whitespaces at the end of the file 2022-07-26 11:09:00 +08:00
Jun Pataleta ccb639002f Merge branch 'MDL-74057-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2022-07-26 11:01:37 +08:00
Angelia Dela Cruz df62f09a4c MDL-74057 behat: SCORM behat generators use UI
Replace steps that manually add SCORM instances via the UI and use
Behat generators. This improves the speed of Behat test runs.
2022-07-25 18:01:00 +08:00
Angelia Dela Cruz 7c0a982958 MDL-73788 behat: URL behat generators use UI
Replace steps that manually add URL instances via the UI and use
Behat generators. This improves the speed of Behat test runs.
2022-07-19 09:18:53 +08:00
Víctor Déniz 940e4da0fa weekly release 3.9.15+ 2022-07-14 12:06:16 +01:00
Jun Pataleta ae531ae852 Merge branch 'MDL-71747_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2022-07-12 10:51:13 +08:00
Jake Dallimore 84d3ae1b08 Moodle release 3.9.15 2022-07-08 11:28:28 +08:00
Eloy Lafuente (stronk7) d51f307ffa MDL-71747 environment: Ensure that check_xmlrpc_usage is in >=39
This is a partial backport of MDL-73270 to ensure that the
check_xmlrpc_usage custom check is present in all the supported
branches and it's applied to all branches able to run php80:

- MOODLE_311_STABLE
- MOODLE_400_STABLE
- master (aka, 4.1 and up)

Note that the whole patch has not been backported, only the
environmental check (xml file and check implementation).
2022-07-07 23:44:36 +02:00
Eloy Lafuente (stronk7) a4018fbcdd MDL-71747 environment: Apply agreed changes
- PHP 7.4 required.
- Moodle 3.9 required.
- MariaDB 10.4 required.
- PostgreSQL 12 required.
- Oracle 19c required.
2022-07-07 19:19:57 +02:00
Eloy Lafuente (stronk7) 2dd34c5ae4 MDL-71747 environment: 4.1 base information
This is a direct copy of the 4.0 information, to
have the changes under control in the next commit.
2022-07-07 19:19:57 +02:00
Jun Pataleta 71f83af13c weekly release 3.9.14+ 2022-07-07 21:33:14 +08:00
Víctor Déniz d587d8b242 Merge branch 'MDL-74835-M39_update-nodejs-version-in-travis-integration-to-lts-gallium' of https://github.com/ziegenberg/moodle into MOODLE_39_STABLE 2022-07-06 12:13:40 +01:00
stevando f1b1570b02 MDL-72171 tool_mobile: Ensure auto login URL is always local 2022-07-06 14:29:10 +08:00
Mihail Geshoski f9ca67a78d MDL-71921 scorm: Sanitize element names before outputting track details 2022-07-01 12:47:18 +02:00
Alex Morris c8f9140e70 MDL-75044 assignfeedback_editpdf: Add SAFER option to GS command
Adds the SAFER option to the Ghostscript command to limit interaction
with IO and OS commands
2022-07-01 12:47:18 +02:00
Huong Nguyen 47c211ba0e MDL-72029 Lesson: Prevent arbitrary file read when importing lesson questions in blackboard format 2022-07-01 12:47:18 +02:00
Huong Nguyen 9f270d956e MDL-72029 lib: Prevent path traversal for clean_param with PARAM_SAFEPATH 2022-07-01 12:47:18 +02:00
Laurent David 32ee8e3d34 MDL-74473 core_analytics: Upgrade ML Backend to 2.6.6 2022-07-01 12:47:18 +02:00
Jake Dallimore 77a1413fa0 MDL-72299 mod_lti: fix html escaping when reposting cross site posts 2022-07-01 12:47:18 +02:00
Víctor Déniz 14760d9787 weekly release 3.9.14+ 2022-07-01 11:28:53 +01:00
Jun Pataleta 03b6b93589 Merge branch 'MDL-74613-39' of https://github.com/NoelDeMartin/moodle into MOODLE_39_STABLE 2022-06-30 20:23:48 +08:00
Noel De Martin 47402416fd MDL-74613 grade: Fix undefined behat step 2022-06-30 11:32:35 +02:00
Andrew Nicols 0087cede97 Merge branch 'MDL-75084-39' of https://github.com/NoelDeMartin/moodle into MOODLE_39_STABLE 2022-06-30 11:14:09 +08:00
Andrew Nicols 264c405192 Merge branch 'MDL-74613-39' of https://github.com/NoelDeMartin/moodle into MOODLE_39_STABLE 2022-06-30 11:05:38 +08:00
Andrew Nicols 1742e0c27c Merge branch 'MDL-74220-39' of https://github.com/NoelDeMartin/moodle into MOODLE_39_STABLE 2022-06-30 11:00:59 +08:00
Andrew Nicols 7371cb4838 Merge branch 'MDL-74744-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2022-06-30 10:56:19 +08:00
Andrew Nicols c1512e8d89 Merge branch 'MDL-74841-39' of https://github.com/andelacruz/moodle into MOODLE_39_STABLE 2022-06-30 10:45:12 +08:00
Jake Dallimore e5aaeed609 Merge branch 'MDL-74674-39' of https://github.com/alfonso-salces/moodle into MOODLE_39_STABLE 2022-06-29 16:45:23 +08:00
Alfonso Salces a950ed04a7 MDL-74674 core: create notification generators 2022-06-29 10:29:33 +02:00
Noel De Martin 964c98c8d9 MDL-75084 blog: Implement behat generators 2022-06-29 09:38:55 +02:00
Jake Dallimore 635389b235 Merge branch 'MDL-74864-39' of https://github.com/dpalou/moodle into MOODLE_39_STABLE 2022-06-29 13:41:31 +08:00
Dani Palou 1385e3bc09 MDL-74864 forum: Allow specifying group in discussions generator 2022-06-28 07:00:18 +02:00
Jun Pataleta 2dc581f717 weekly release 3.9.14+ 2022-06-17 15:30:38 +08:00
Víctor Déniz 4f8369c3f1 Merge branch 'MDL-74242-39-randomize_update_check' of https://github.com/mudrd8mz/moodle into MOODLE_39_STABLE 2022-06-14 09:48:51 +01:00
Jun Pataleta 730b405d68 Merge branch 'MDL-74816-39' of https://github.com/dpalou/moodle into MOODLE_39_STABLE 2022-06-14 13:58:29 +08:00
Angelia Dela Cruz 87c04f1e0b MDL-74841 behat: Label behat generators use UI
Replace steps that manually add Label instances via the UI and use
Behat generators. This improves the speed of Behat test runs.
2022-06-10 13:58:46 +08:00
Andrew Nicols f4df13fb6c weekly release 3.9.14+ 2022-06-03 11:06:38 +08:00
Paul Holden 4a8abf77ac MDL-71276 message_email: include alternate email in privacy export. 2022-06-01 18:48:11 +02:00
Noel De Martin 7e48ec1820 MDL-74613 grade: Add missing generators 2022-05-31 18:15:23 +02:00
Jake Dallimore 05087afd40 weekly release 3.9.14+ 2022-05-27 10:02:16 +08:00
Noel De Martin 56afed9678 MDL-74220 data: Implement behat generators 2022-05-26 10:39:38 +02:00
Paul Holden af8c168f78 MDL-73801 backup: set predictably ordered backup next start time.
Prior to this change, the testcase would assert ordering based on
identical fields which could lead to random failures. Set distinct
next start time of course backup, and also remove random ordering
by sorting on defined course order (all other fields being equal).
2022-05-26 12:10:49 +08:00
Dani Palou 4c52746b41 MDL-74816 mod_resource: Allow specify default file name in generator 2022-05-25 10:41:43 +02:00
Angelia Dela Cruz 7768a35366 MDL-74744 behat: Quiz behat generators use UI
Replace steps that manually add Quiz instances via the UI and use
Behat generators. This improves the speed of Behat test runs.
2022-05-24 11:23:21 +08:00
Daniel Ziegenberg 05847affc1 MDL-74835 ci: Update nodejs version in travis integration to lts/gallium
In MDL-73915 the nodejs version was switched to lts/gallium but the
travis integration was not updated.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2022-05-22 23:55:08 +02:00
Jun Pataleta a63efe42d1 Moodle release 3.9.14 2022-05-07 19:34:47 +08:00
Eloy Lafuente (stronk7) f4b45aa02c weekly release 3.9.13+ 2022-05-06 15:58:44 +02:00
Víctor Déniz 0a2fdafe37 Merge branch 'MDL-74612-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2022-05-05 13:27:03 +01:00
Jake Dallimore fa855204af MDL-73736 core_auth: Fix concurrency issue in login_attempt_failed()
This patch wraps the login_failed_count logic in a resource lock and
forces a user preferences cache reload. Each thread must wait for the
lock and must fetch the current count before incrementing it. This
ensures that login_failed_count is correct across threads and that the
lockout threshold is correctly honoured.

Co-Authored-By: Sujith Haridasan <sujith@moodle.com>
2022-05-04 16:27:58 +06:00
Michael Hawkins 70cf2159d4 MDL-74333 badges: Check profile criteria valid when reviewing 2022-05-04 12:58:43 +08:00
Ferran Recio 55e08c48c7 MDL-71623 core_search: fix user document visibility 2022-05-02 16:42:02 +06:00
Amaia Anabitarte 8f954b91f4 MDL-74318 core_user: Description field as hidden on profile 2022-05-02 12:27:15 +02:00
Paul Holden bbd4540075 MDL-74204 mod_assign: escape identity fields in allocate marker form. 2022-05-02 12:27:15 +02:00
Víctor Déniz 780a8aa0aa Merge branch 'MDL-73951-39' of https://github.com/mickhawkins/moodle into MOODLE_39_STABLE 2022-05-02 11:13:46 +01:00
Paul Holden c55b5aa305 MDL-74612 cohort: use data generator for populating cohort members. 2022-04-29 16:23:43 +01:00
Michael Hawkins bb822f465a MDL-73951 core: Updated security.txt expiry date
Also updated expiry date format to meet latest standard.
2022-04-29 19:03:10 +08:00
Ilya Tregubov ec1282cd7f weekly release 3.9.13+ 2022-04-08 16:39:57 +06:00
Víctor Déniz 9d0ac7d6ed Merge branch 'MDL-74189-39' of https://github.com/mihailges/moodle into MOODLE_39_STABLE 2022-04-06 22:57:26 +01:00
Mihail Geshoski 9164c896c4 MDL-74189 tool_moodlenet: Add upgrade step to remove irrelevant data
Upgrade step to identify all existing cases where users have linked
their MoodleNet profile on the site and remove the related data from
the database. Due to some recent changes on the MoodleNet platform,
this data is now irrelevant and can no longer be used to authenticate
on the MoodleNet platform.
2022-04-06 23:40:49 +08:00
Mihail Geshoski 398bcbce55 MDL-74189 tool_moodlenet: Update language strings
Updates the existing language strings in order to provide more accurate
instructions on how users can link existing their MoodleNet profile on
the site.
2022-04-06 23:40:49 +08:00
Sara Arjona 7890567fad weekly release 3.9.13+ 2022-04-05 13:24:53 +02:00
Jun Pataleta 41b456e1a2 Merge branch 'MDL-70014_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2022-04-04 13:56:00 +08:00
Jun Pataleta ce9c32a016 Merge branch 'MDL-74096-39' of https://github.com/ilyatregubov/moodle into MOODLE_39_STABLE 2022-04-04 13:05:21 +08:00
Ilya Tregubov 600b2f01fa MDL-74096 mlbackend_python: Update mlbackend version. 2022-04-04 09:16:44 +06:00
Eloy Lafuente (stronk7) c94868ba12 MDL-70014 tool_customlang: Workaround to make behat happier
This is a BEHAT_RUNNING only hack, so it doesn't affect normal
operations at all. What it achieves is to reduce the number of
strings loaded when customising a lang pack from current 31K ones
to the just needed ones for Behat testing purposes.

That way we avoid the random failures that are happening more and
more (while the "en" lang pack grows) and also save some precious
minutes in every behat run.

Also, unrelated, a couple of tiny changes:
- Modified constant (that was really outdated) to current number
  of lang strings (so the progress bar behaves better).
- Remove an elseif occurrence because it was hurting my eyes.
2022-04-01 23:57:26 +02:00
Sara Arjona db6f627bad weekly release 3.9.13+ 2022-04-01 16:40:51 +02:00
Andrew Nicols c61c666667 Merge branch 'MDL-72446_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2022-03-31 22:34:20 +08:00
Eloy Lafuente (stronk7) b41d588695 MDL-72446 behat: Ensure that the day reset happens on enabled element
Before this change we were setting the month day to 1 unconditionally
and that was working ok for enabled by default elements.

But in a number or cases we were doing that against disabled elements
so the day reset was not happening. Now we wait for the element to
be enabled and only then proceed with the day reset.

Backed with tests using disabled form elements, so we have now
both enabled and disabled fields covered.
2022-03-31 12:22:52 +02:00
Víctor Déniz 48b4929c23 weekly release 3.9.13+ 2022-03-25 15:00:37 +00:00
Sara Arjona 501a4fc35c MDL-74184 behat: Unrelated, remove the @skip_interim tag
This commit is UNRELATED to the MDL-74184, but we need the
@skip_interim tag removed to a couple of scenarios that were
causing lots of noise and failures @ci infrastructure.
MDL-74265 was created to deal with this issue but these jobs
are now passing, and nothing has been changed...

So we are using MDL-74184 (this extra commit) to remove that
tag (sorry for the noise).
2022-03-22 17:24:08 +01:00
David Mudrák f652a2b613 MDL-74242 task: Fix calculation of random minute in the task schedule
The random minute was incorrectly set to a random value from the range
0 - 23 instead of 0 - 59 due to this copy & paste mistake.

This is a backport of MDL-73765 already present in 3.11.
2022-03-20 17:06:51 +01:00
David Mudrák 04d4cbde78 MDL-74242 admin: Check for available updates daily on random time
It's been a mistake to make every Moodle site out there to check for
available update every two hours, on the hour. We are experiencing
server load peaks that are harder and harder to deal with.

The patch addresses this by (1) checking for available updates just once
a day and (2) distributing the checking times randomly around the clock.

This is a backport of MDL-73748 already present in 3.11.
2022-03-20 17:06:51 +01:00
Sara Arjona e9f0baf90e weekly release 3.9.13+ 2022-03-18 16:28:22 +01:00
Sara Arjona 9ce9388c8d MDL-74116 behat: Unrelated, add the @skip_interim tag
This commit is UNRELATED to the MDL-74116, but we need the
@skip_interim tag added to a couple of scenarios that are
causing lots of noise and failures  @CI infrastructure.
MDL-74265 has been created to deal with this issue.

So we are using MDL-74116 (this extra commit) to add that tag
(sorry for the noise).
2022-03-18 13:46:49 +01:00
Eloy Lafuente (stronk7) 497f4ee8b9 Merge branch 'MDL-74116-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2022-03-16 22:19:50 +01:00
Andrew Nicols 6955a9b618 MDL-74116 behat: Fix browser instantiation for Selenium 4 2022-03-16 22:28:29 +08:00
Sara Arjona b75b238591 Merge branch 'MDL-74130_39' of https://github.com/timhunt/moodle into MOODLE_39_STABLE 2022-03-15 12:19:35 +01:00
Jun Pataleta 4e2c4bfaed Moodle release 3.9.13 2022-03-12 12:39:22 +08:00
Ilya Tregubov 7c52eaaf18 weekly release 3.9.12+ 2022-03-11 16:19:54 +06:00
Tim Hunt 47acac9180 MDL-74130 question behat: Update tests to use the new navigation steps 2022-03-10 12:13:44 +00:00
Tim Hunt 351ad0c0e9 MDL-74130 question behat: support I am on ... page or key qbank pages 2022-03-10 09:31:59 +00:00
Jake Dallimore 7c1a3ed76f Merge branch 'MDL-73899-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2022-03-10 15:35:26 +08:00
Amaia Anabitarte 1cdc2e81f8 MDL-74075 core_badges: Check accepted criterias 2022-03-09 12:31:56 +01:00
Michael Hawkins 5f1b314b50 MDL-74074 badges: Ensure profile criteria exists before completion check 2022-03-08 12:09:16 +00:00
Paul Holden 861b56413f MDL-72972 tool_uploaduser: observe capability to delete users. 2022-03-01 17:24:23 +01:00
cescobedo adad13e029 MDL-71722 h5plib_v124: Add required changes after lib upgrade 2022-02-28 17:29:20 +01:00
cescobedo 0681ffb33a MDL-71722 h5plib_v124: Upgrade ckeditor to 4.17.1 2022-02-28 17:29:20 +01:00
Ilya Tregubov 600029a98c MDL-71703 lib: update phpmailer to 6.5.3 2022-02-25 18:27:16 +01:00
Ilya Tregubov 5adfd0fa46 weekly release 3.9.12+ 2022-02-25 19:23:46 +02:00
Jun Pataleta 62031a875b Merge branch 'MDL-73915-39-terser' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2022-02-24 16:44:42 +08:00
Andrew Nicols 3140ab71b8 MDL-73899 behat: Fix coding style issues to change third-party status
This commit removes the moodle-behat-extension from the list of
third-party libraries.

In order to do this properly, all pending coding-style issues are fixed.
In addition the following niceties have also been included:
* convert long form array() syntax to short form
* alphabetically sort class imports (use)
* remove unused class imports
* correct documentation
* Normalise whitespace in concat operators
* Remove unnecessary file docblocks
2022-02-23 08:19:30 +08:00
Sara Arjona 6ce5070675 weekly release 3.9.12+ 2022-02-22 11:12:56 +01:00
Andrew Nicols 34638813f1 MDL-73915 js: Switch amd minification to terser
Unfortunately the babel minify-mangle plugin seems to be abandoned and
in certain circumstances can be very buggy. The only safe options are to
disable it, or to switch to a different minification library.

Not minifying our javascript is not ideal, so this commit updates the
javascript tasks to use a rollup, combined with babel, and terser.

Babel still converts code from ES/UMD/AMD to AMD modules with the
relevant browser support, whilst terser minifies the code.

The rollup bundler handles tracking and creation of sourcemaps, and
supports better parallelisation of the tasks.

Since the upgrade to Node LTS/Gallium requires an upgrade to @babel/core
and eslint, which change the built files anyway, this seems like the
ideal time to make this change.
2022-02-22 14:00:41 +08:00
Sara Arjona 44de681d9e Merge branch 'MDL-73883-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2022-02-21 15:35:33 +01:00
Andrew Nicols 466ca1079d MDL-73915 js: Upgrade babel and eslint 2022-02-18 08:52:45 +08:00
Andrew Nicols 97e9f81aa0 MDL-73915 js: Upgrade packages 2022-02-18 08:41:02 +08:00
Andrew Nicols de97a73ede MDL-73915 js: Switch to nodejs lts/gallium 2022-02-18 08:26:17 +08:00
Andrew Nicols bd7971aca9 MDL-73915 js: Upgrade node-sass 2022-02-18 08:21:01 +08:00
Andrew Nicols 9f40a833fb MDL-73883 behat: Display actual step during testing
Because of the way in which we check for exceptions, we always show the
following string during behat pretty output:

    behat_hooks::i_look_for_exceptions()

We can easily modify this to only show this value when the
i_look_for_exceptions() test itself fails, but otherwise to show the
actual step that is run.
2022-02-15 15:01:36 +08:00
Sara Arjona bb743c2358 weekly release 3.9.12+ 2022-02-04 18:18:34 +01:00
Jun Pataleta 3c2dc443a6 Merge branch 'MDL-73711_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2022-02-03 11:14:58 +08:00
Eloy Lafuente (stronk7) 97f2585ea4 MDL-73711 behat: Bump to Behat 3.10.x
Generated with php72, following the instructions at:

https://docs.moodle.org/dev/Composer
2022-01-29 16:20:40 +01:00
Ilya Tregubov 392abd6324 weekly release 3.9.12+ 2022-01-28 20:17:03 +02:00
Sara Arjona b72afc29a0 Merge branch 'MDL-73588_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2022-01-27 17:05:58 +01:00
Eloy Lafuente (stronk7) 18a85f8cbd MDL-73588 phpunit: Fix assertion to PHPUnit 8.5 one
This issue was backported from 311_STABLE that uses
PHPUnit 9.5, were the regexp assertion was renamed.

This just moves it back to the 8.5 one for 39 and 310 stables.
2022-01-27 16:23:20 +01:00
Frode Petterson e3240e8431 MDL-73588 curl: Fix expected CURLOPT_FILE behavior
After cbf9dfb the CURLOPT_FILE no longer behaves as expected. All
redirect responses are appended to the same stream resource.  This fix
reverts back to the old behavior by setting the stream pointer back to
the beginning for each subsequent redirect.
2022-01-27 12:18:52 +01:00
Sara Arjona 3bd1f38249 weekly release 3.9.12+ 2022-01-21 15:00:55 +01:00
Jun Pataleta 1c283d1105 Merge branch 'MDL-73021-39' of git://github.com/andelacruz/moodle into MOODLE_39_STABLE 2022-01-21 11:18:15 +08:00
Eloy Lafuente (stronk7) 983c94d341 Moodle release 3.9.12 2022-01-15 12:14:18 +01:00
Sara Arjona d340080d73 weekly release 3.9.11+ 2022-01-14 11:14:08 +01:00
Paul Holden d6aeb11f74 MDL-72772 gradereport_overview: account for users with parent roles. 2022-01-12 14:20:04 +01:00
Paul Holden 311d7ce594 MDL-72772 gradereport_overview: access checks for viewing grades. 2022-01-12 13:44:21 +08:00
Paul Holden 3f91f38f54 MDL-72367 badges: require sesskey to remove badge alignment. 2022-01-11 14:37:16 +01:00
Dongsheng Cai f64e54a2f3 MDL-71239 calendar: disallow manager role users edit user events 2022-01-11 14:37:16 +01:00
Jun Pataleta e03a5c24ca weekly release 3.9.11+ 2022-01-11 21:29:53 +08:00
Jun Pataleta 9a993a7bed Merge branch 'MDL-69061-39' of https://github.com/junpataleta/moodle into MOODLE_39_STABLE 2022-01-11 11:56:29 +08:00
Adam Pawełczak 63abb48e56 MDL-69061 core: Fix admin path replacement with path to $CFG->admin 2022-01-11 11:33:38 +08:00
Shamim Rezaie 6c70a26c41 Merge branch 'MDL-73272/3.9' of https://github.com/skodak/moodle into MOODLE_39_STABLE 2022-01-07 17:46:42 +11:00
Petr Skoda 99c49bb067 MDL-73272 behat: move behat extension to core 2021-12-31 09:46:30 +13:00
Sara Arjona 504f784ae6 weekly release 3.9.11+ 2021-12-30 11:24:17 +01:00
Víctor Déniz 3b8eb088f3 Merge branch 'MDL-73269/3.9' of https://github.com/skodak/moodle into MOODLE_39_STABLE 2021-12-27 15:26:39 +00:00
Sara Arjona 7e5e4bd6c7 weekly release 3.9.11+ 2021-12-23 16:29:46 +01:00
Jun Pataleta 3adfa34acb Merge branch 'MDL-72701-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-12-23 12:11:15 +08:00
Petr Skoda 61118a9796 MDL-73269 dev: add requirements to composer.json 2021-12-23 07:25:17 +13:00
Angelia Dela Cruz 2cf0f41cba MDL-73021 behat: Use assign generators
Replace steps that manually add assignment instances via the UI
and use Behat generators. This improves the speed of Behat test
runs.
2021-12-22 17:09:44 +08:00
Andrew Nicols 80df50ae38 MDL-72701 unit tests: Fix broken @covers annotations 2021-12-21 09:24:06 +08:00
Shamim Rezaie 8e12159d85 Merge branch 'MDL-73175-39' of https://github.com/NoelDeMartin/moodle into MOODLE_39_STABLE 2021-12-20 11:01:00 +11:00
Noel De Martin 1069559e8f MDL-73175 mod_glossary: Add behat generators 2021-12-17 07:53:03 +01:00
Ilya Tregubov 55a40f54c2 weekly release 3.9.11+ 2021-12-07 14:59:46 +02:00
Jun Pataleta 17cc89b121 Merge branch 'MDL-73202-39' of https://github.com/NoelDeMartin/moodle into MOODLE_39_STABLE 2021-12-07 10:38:48 +08:00
Eloy Lafuente (stronk7) 22bb5242b3 Merge branch 'MDL-73253-39' of https://github.com/vmdef/moodle into MOODLE_39_STABLE 2021-12-03 18:52:59 +01:00
Víctor Déniz e7823df844 MDL-73253 ci: use setup-node action in GHA 2021-12-03 16:07:19 +00:00
Sara Arjona 6b18b86b4b weekly release 3.9.11+ 2021-12-03 10:26:36 +01:00
Andrew Nicols 55dfe56aae Merge branch 'MDL-72846-39' of https://github.com/NoelDeMartin/moodle into MOODLE_39_STABLE 2021-12-03 08:30:38 +08:00
Eloy Lafuente (stronk7) 48b85b536e Merge branch 'MDL-72728-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-12-02 18:57:33 +01:00
Noel De Martin 74a6ebbd7b MDL-72846 testing: Add default block generators 2021-12-02 14:56:20 +01:00
Andrew Nicols cee9f65fa6 Merge branch 'MDL-73070_39' of https://github.com/timhunt/moodle into MOODLE_39_STABLE 2021-12-02 11:25:18 +08:00
Eloy Lafuente (stronk7) a367a3b412 weekly release 3.9.11+ 2021-11-30 19:01:21 +01:00
Noel De Martin f2f320b763 MDL-73202 mod_forum: Add behat generators 2021-11-30 10:08:54 +01:00
Jun Pataleta 0b27697301 Merge branch 'MDL-70274-39-2' of https://github.com/lameze/moodle into MOODLE_39_STABLE 2021-11-29 12:25:37 +08:00
Simey Lameze c80f562a4c MDL-70274 core: fix Validate HTML and WCAG Check links 2021-11-29 12:24:49 +08:00
Paul Holden 43a7584e37 MDL-72728 behat: switch import course steps to native execute method.
The previous iteration using the behat_form_field class directly
didn't explicitly require the file that defines this class, and in
Goutte runs this led to fatal errors (class not found).
2021-11-26 19:07:55 +00:00
Tim Hunt 99611eff5f MDL-73070 Behat: stop using no-longer-existant classes in behat_hooks 2021-11-23 11:00:07 +00:00
Eloy Lafuente (stronk7) 448a2aa60c weekly release 3.9.11+ 2021-11-19 19:15:33 +01:00
Eloy Lafuente (stronk7) a3066f443a Merge branch 'MDL-71882-39' of https://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-11-18 23:52:44 +01:00
Andrew Nicols 3723049a5c MDL-71882 grunt: Replace module names
When a third-party AMD module is provided with an included name we must
replace it with a name that we are able to use.

The structure of an AMD module define function is:

    [name], [dependencies], [callback]
    String, Array,          Function

Each of these is (strangely) optional.

We know that the name is the only String and will always be the first,
and we can use AST to remove a provided name before adding the
Moodle-specific name.

This should be a safe change and not lead to any changes in built code,
but will make it easier to include third-party code.

An additional logging line is also included to inform developers that a
change was made.
2021-11-17 09:21:04 +08:00
Eloy Lafuente (stronk7) be9a8bdacb weekly release 3.9.11+ 2021-11-16 14:00:05 +01:00
Eloy Lafuente (stronk7) 88c0d68ffa Merge branch 'MDL-72096-39' of https://github.com/mickhawkins/moodle into MOODLE_39_STABLE 2021-11-15 19:14:14 +01:00
Michael Hawkins 2abc1a4130 MDL-72096 core: Add safe ORDER BY helpers for db sorting from user input
The new get_safe_orderby() and get_safe_orderby_multiple() methods
provide a centralised safe way for user submitted sorting values to be
incorporated into SQL ORDER BY. They do this by removing the need for
user submitted data to pass in any SQL and not allowing arbitrary
column values, instead using string keys which map to a predefined
list of allowed sortable columns.
2021-11-15 20:10:05 +08:00
Eloy Lafuente (stronk7) 530c2ac613 weekly release 3.9.11+ 2021-11-12 13:40:41 +01:00
Eloy Lafuente (stronk7) a86e2db5bb Merge branch 'MDL-72696-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-11-10 19:21:32 +01:00
Paul Holden 623e72a092 MDL-72696 behat: support inplace editable fields of type select.
If an inplace editable field is using the "select" type, we should
treat it as a select field when setting it's value during scenarios.
2021-11-08 13:12:36 +00:00
Andrew Nicols 64a540241c Merge branch 'MDL-73014-39' of https://github.com/lucaboesch/moodle into MOODLE_39_STABLE 2021-11-08 11:41:45 +08:00
Luca Bösch 1aef32324f MDL-73014 core_lang: Add string for new timezone Pacific/Kanton 2021-11-06 11:33:44 +01:00
Eloy Lafuente (stronk7) b02dd253b8 Moodle release 3.9.11 2021-11-06 10:34:10 +01:00
Ilya Tregubov af1d8d3780 weekly release 3.9.10+ 2021-11-05 19:18:39 +02:00
Huong Nguyen 49c0337a9a MDL-71918 Calendar: Improve capability checks when fetching events 2021-11-05 13:16:15 +08:00
Paul Holden 9bd64d6e0f MDL-70823 qtype_ddwtos: new method for safer feedback unserializing. 2021-11-03 16:58:52 +01:00
Paul Holden a405697840 MDL-70823 mod: safely parse module display options array. 2021-11-03 16:58:52 +01:00
Paul Holden c4010ec81f MDL-70823 blocks: safer unserializing during block restore. 2021-11-03 16:58:52 +01:00
Paul Holden ad524085cd MDL-70823 core: safer alternative for unserializing objects. 2021-11-03 16:58:52 +01:00
Paul Holden 6db35f03c7 MDL-72370 badges: require sesskey to remove related badge. 2021-10-29 17:27:17 +02:00
Ilya Tregubov 2a7beaad88 MDL-70887 mlbackend_python: Update to latest version. 2021-10-29 17:27:17 +02:00
Simey Lameze 9d0d93a9c4 MDL-72571 tool_filetypes: change extension param to PARAM_ALPHANUMEXT 2021-10-29 17:27:17 +02:00
Eloy Lafuente (stronk7) 419ad88eda weekly release 3.9.10+ 2021-10-29 17:10:20 +02:00
Eloy Lafuente (stronk7) 9bf0d5e7d2 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-10-29 17:10:18 +02:00
Shamim Rezaie e6079323bf Merge branch 'MDL-72874-39' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-10-29 03:37:15 +11:00
Eloy Lafuente (stronk7) a800e3135f Merge branch 'MDL-72913-39' of git://github.com/NoelDeMartin/moodle into MOODLE_39_STABLE 2021-10-26 17:22:26 +02:00
Noel De Martin 51a1858ed7 MDL-72913 course: Fix require statement 2021-10-26 08:54:44 +02:00
AMOS bot c3892e8746 Automatically generated installer lang files 2021-10-24 00:07:31 +00:00
Ilya Tregubov 114f603d0b weekly release 3.9.10+ 2021-10-22 12:49:08 +02:00
Ilya Tregubov d39bf19539 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-10-22 12:49:08 +02:00
Andrew Nicols 88908f1730 MDL-72874 behat: Allow behat window sizes to be modified during run
In some situations it is useful to modify the requested screensize by a
modifier. This allows for failing tests to be rerun at a different
screensize, where the original screensize triggered a failure for some
size-related reason.
2021-10-21 10:26:30 +08:00
Eloy Lafuente (stronk7) 28fa7418e8 Merge branch 'MDL-72849-m39' of https://github.com/sammarshallou/moodle into MOODLE_39_STABLE 2021-10-19 22:17:31 +02:00
sam marshall 96aad743ea MDL-72849 tool_behat: Use of xpath name() not compatible with Firefox
The xpath name() function returns upper-case e.g. 'IMG' in Firefox and
lower-case e.g. 'img' in Chrome.
2021-10-19 14:30:48 +01:00
Ilya Tregubov 36e130869d Merge branch 'MDL-71270-39' of git://github.com/mickhawkins/moodle into MOODLE_39_STABLE 2021-10-19 14:47:42 +02:00
Michael Hawkins c0dbeb50ba MDL-71270 core: Updated security.txt expiry 2021-10-18 17:14:28 +08:00
AMOS bot 6d716397d6 Automatically generated installer lang files 2021-10-16 00:07:38 +00:00
Shamim Rezaie 8d38d0cee1 weekly release 3.9.10+ 2021-10-16 00:29:29 +11:00
Shamim Rezaie fea492ca6d Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-10-16 00:29:28 +11:00
Jun Pataleta e586a0e678 Merge branch 'MDL-72623_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-10-15 09:46:51 +08:00
Jun Pataleta 3671ba02a1 Merge branch 'MDL-72807_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-10-15 09:08:09 +08:00
Eloy Lafuente (stronk7) 566b0efb80 MDL-72807 behat: Add a few more @skip_chrome_zerosize tags
This is the 3rd round adding the tags to some scenarios
detected to be failing with zerosize problems lately.

Note that @ MDL-71108, the final solution will happen, say
switching to own webdriver till the upstream one is fixed
or whatever. Our @skip_chrome_zerosize solution is just a
workaround to have all those scenarios detected and ignored
by normal runs.
2021-10-14 16:17:41 +02:00
AMOS bot b0c901e2ee Automatically generated installer lang files 2021-10-13 00:07:27 +00:00
Eloy Lafuente (stronk7) be3202003b MDL-72623 nodejs: Bump from v14.15.0 to v14.18.0
Without modifying any installed package or dependency
because, after trying to do so, the updated stuff is huge
and leads to some JS validation / minimisation problems.
2021-10-08 15:00:19 +02:00
Sara Arjona da908fe1be weekly release 3.9.10+ 2021-10-08 12:43:27 +02:00
Sara Arjona 08da0dbb81 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-10-08 12:43:26 +02:00
AMOS bot 3db0b363bf Automatically generated installer lang files 2021-10-08 00:07:30 +00:00
Eloy Lafuente (stronk7) e7335a9112 Merge branch 'MDL-72621-39' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-10-07 21:11:04 +02:00
AMOS bot b02efb33f4 Automatically generated installer lang files 2021-10-07 00:07:27 +00:00
Andrew Nicols b2d9a6f57e Merge branch 'MDL-72515-39' of git://github.com/marinaglancy/moodle into MOODLE_39_STABLE 2021-10-06 13:21:38 +08:00
Eloy Lafuente (stronk7) bbbed68f9b weekly release 3.9.10+ 2021-10-02 22:05:21 +02:00
Eloy Lafuente (stronk7) daa742888d Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-10-02 22:05:20 +02:00
Eloy Lafuente (stronk7) c63b8134bf Merge branch 'MDL-72714_39' of git://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-10-02 15:30:19 +02:00
Eloy Lafuente (stronk7) 6c32a7872c MDL-72714 behat: Add new @skip_chrome_zerosize labels
With the move from Chrome 93 to 94 a few new "zerosize" cases
have appeared, this just protect us from them, so they
are run apart.
2021-10-02 12:10:10 +02:00
Eloy Lafuente (stronk7) ae39d6ba6a MDL-72714 behat: fix problem with button on the edge and failing
Surprise came with Chrome 94, so applying the usual trick by
changing window size. Hopefully some day we'll be able to
revert all them (Chrome 123).
2021-10-02 11:02:35 +02:00
Andrew Nicols deb231aeaa Merge branch 'MDL-72496-39_assert_tag' of https://github.com/call-learning/moodle into MOODLE_39_STABLE 2021-10-01 07:56:29 +08:00
Víctor Déniz cbbdd85bd8 Merge branch 'MDL-72399_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-09-30 16:10:43 +01:00
Laurent David 0e73be46c0 MDL-72496 question tests: fix assertTag if tag not found
* The basic_test::assertTag method will issue a warning as $tag is not
found, failing the PHP Unit test that uses this method.
* Add tests to check that assertTag is working
2021-09-30 13:13:06 +02:00
AMOS bot d075ff3b0b Automatically generated installer lang files 2021-09-30 00:07:29 +00:00
Andrew Nicols a96d456b63 MDL-72621 admin: Add environment check for admin deprecation 2021-09-29 22:39:32 +08:00
AMOS bot 0f6a06114d Automatically generated installer lang files 2021-09-28 00:07:47 +00:00
AMOS bot 49baa2bc23 Automatically generated installer lang files 2021-09-24 00:07:48 +00:00
Eloy Lafuente (stronk7) c5f328c546 MDL-72399 GHA: Go back to use upstream igbinary extension
With igbinary >=3.2.6 already built, see

https://launchpad.net/~ondrej/+archive/ubuntu/php/+packages?field.name_filter=igbinary&field.status_filter=published

We can revert the temporal workaround applied few weeks ago (that
sometimes is failing). So this is a simple revert of the original commit.

Revert "MDL-72312 GHA: Force use of igbinary working version"

This reverts commit 814c80da13.
2021-09-23 19:38:01 +02:00
Ilya Tregubov 921bc07f2b weekly release 3.9.10+ 2021-09-23 18:21:56 +02:00
Ilya Tregubov b32c766da2 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-09-23 18:21:56 +02:00
AMOS bot 793724ef9f Automatically generated installer lang files 2021-09-23 00:07:44 +00:00
Eloy Lafuente (stronk7) 1195705939 Merge branch 'MDL-72593-39' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-09-22 10:48:37 +02:00
AMOS bot 986440230e Automatically generated installer lang files 2021-09-22 00:07:45 +00:00
Eloy Lafuente (stronk7) e1a3eb2810 Merge branch 'MDL-69364-39-alt' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-09-21 18:19:56 +02:00
Andrew Nicols 6138b34e01 MDL-72593 behat: Improve behat handling of file manager buttons
When using a try/catch for a find if the first match is not met then we
have an implicit 6 second delay waiting for the search to time out.

We can avoid this by combining the searches in a comma-separated
selection.

I have also taken the opportunity to convert the use of ->click() to the
i_click_on function which has the benefit of supporting wait for
pendingJS.
2021-09-21 16:00:59 +08:00
Andrew Nicols bbf30c6751 MDL-72593 behat: Load the Field node content locally for processing
The standard NodeElement functions for getAttribute, getTagName,
getParent, and friends go back to WebDriver and parse the DOM for each
request. This is insanely slow per request, and in the case of forms we
do a lot of checking to determine the field type.

This change modifies the form field detection to copy the entire node
content into a DOMDocument and parse the document locally.

This is significantly faster - in some cases where there are large
documents minutes faster.

I believe that this should be a safe change as the document fetched from
the browser is normalised to match the doctype specified.
2021-09-21 16:00:58 +08:00
Andrew Nicols 96edd40beb MDL-69364 enrol: Improve setting of save button 2021-09-20 12:08:09 +08:00
Andrew Nicols b05a56602c MDL-69364 enrol: Improve cohort test 2021-09-20 12:08:09 +08:00
Ilya Tregubov 7e96939f68 weekly release 3.9.10+ 2021-09-17 08:58:38 +02:00
Ilya Tregubov 1b1ffafaa2 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-09-17 08:58:37 +02:00
Ilya Tregubov 25ba14abdd Merge branch 'MDL-72173-39' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-09-16 15:02:32 +02:00
Andrew Nicols 89fe559d75 MDL-72173 behat: Respect login page preference 2021-09-16 20:47:18 +08:00
Jun Pataleta 2defce84e2 Merge branch 'MDL-72173-39' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-09-16 15:40:01 +08:00
Andrew Nicols 6b7f92954c MDL-72173 behat: Fix typo Logout <> Log out 2021-09-16 15:03:07 +08:00
Jun Pataleta 1ee5d46c3e Merge branch 'MDL-72173-39' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-09-16 12:23:25 +08:00
Andrew Nicols d710bba114 MDL-72173 behat: Add tests for login/logout steps 2021-09-16 12:20:37 +08:00
Andrew Nicols ba46337d52 MDL-72173 behat: Automatically log user out on behat login 2021-09-16 12:13:26 +08:00
Andrew Nicols 9448cb11d2 MDL-72173 behat: Add and use behat logout URL 2021-09-16 12:13:25 +08:00
Jun Pataleta 7ea626b4dd Merge branch 'MDL-72589_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-09-16 09:45:39 +08:00
AMOS bot 131ee1d0f0 Automatically generated installer lang files 2021-09-16 00:07:43 +00:00
Eloy Lafuente (stronk7) 7949d265c7 MDL-72589 behat: Create course with 3 sections (workaround)
With the default 5 sections course, after editing the activities, the
"log out" link is exactly on the edge of the view port. It's one of
those cases where Chrome fails to click/press it (have tried both).

So just make the course to have 3 sections is enough to avoid the
problem. Some day Chrome will fix that problem but, until then...
we cannot do much apart from changing the window size or try to
configure things to show differently.
2021-09-15 20:29:54 +02:00
Eloy Lafuente (stronk7) 48adc21e71 MDL-72589 behat: Add @skip_chrome_zerosize to failing scenarios
All the scenarios failing with Chrome zero-size errors are
getting the @skip_chrome_zerosize to be able to keep them apart from
regular runs. See MDL-71108 for more information about
that error.

They will be run by another job, specifically using that tag to
keep them failing and under control.
2021-09-15 20:29:47 +02:00
Marina Glancy c4614455f2 MDL-72515 admin: do not call curl unnecessary on plugins page 2021-09-15 11:56:58 +02:00
Andrew Nicols c59450fde9 MDL-72173 behat: Switch to behat login URL 2021-09-13 11:20:35 +08:00
gthomas2 962570b2fd MDL-72173 behat: Add alternative login file for behat 2021-09-13 11:14:01 +08:00
Eloy Lafuente (stronk7) 0ec02c2a67 Moodle release 3.9.10 2021-09-12 12:37:18 +02:00
Eloy Lafuente (stronk7) 8a709503ac weekly release 3.9.9+ 2021-09-11 12:12:28 +02:00
Eloy Lafuente (stronk7) 2c7f5745c6 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-09-11 12:12:27 +02:00
Shamim Rezaie 9a18af46d7 MDL-71240 filter_tex: Add allowlist for filter_tex_sanitize_formula 2021-09-10 18:10:52 +02:00
Jun Pataleta e09160b6db Merge branch 'MDL-72494_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-09-10 23:09:22 +08:00
Mikel Martín 884a9b9706 MDL-72494 theme_boost: Use 'scroll-margin-top' for anchor links
Current anchor link offset fix is not working with 'display:flex' elements

Note this is a backport of MDL-71152 exclusively to 39_STABLE because
the original issue already has been applied to 310, 311 and master.

And seems to workaround a bug in Chrome 93 that is hitting Moodle.
2021-09-10 15:31:26 +02:00
AMOS bot 753b2fb53e Automatically generated installer lang files 2021-09-09 00:07:41 +00:00
AMOS bot 7806835569 Automatically generated installer lang files 2021-09-07 00:07:43 +00:00
Paul Holden a937101b06 MDL-71726 course: respect user access when exporting participants.
We should ensure that users being exported are enrolled on the
course being exported from. In courses where the current user can't
access all groups we should ensure that users being exported belong
to the same groups as them.
2021-09-03 17:07:40 +02:00
Sujith Haridasan 8596b6a299 MDL-71160 auth_db: Use strict comaprison
Use strict comparison to avoid type juggling.

Signed-off-by: Sujith Haridasan <sujith@moodle.com>
2021-09-03 17:07:40 +02:00
Paul Holden b5c8188961 MDL-71976 auth_shibboleth: consistent session parsing during logout. 2021-09-03 17:07:40 +02:00
Shamim Rezaie ed3ee9dd5c MDL-71240 filter_tex: Sanitize the whole latex document
LaTeX documents have a preamble section and admins can use a \newcommand
statement to define new commands there (or to give an alias to another
command). This commit makes sure no blocked command can escape
sanitization by being used in a new seemingly harmless command that is
defined in the LaTeX preamble.
2021-09-03 17:07:40 +02:00
Shamim Rezaie 87aaffc3d1 MDL-71240 filter_tex: Support paranoid mode for openin_any in latex 2021-09-03 17:07:40 +02:00
Huong Nguyen 4fae57fc97 MDL-71797 quiz: Improve the checks when fetching user's attempts 2021-09-03 17:07:40 +02:00
Eloy Lafuente (stronk7) 9b9237fde1 Merge branch 'MDL-72478-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2021-09-03 17:03:32 +02:00
Sara Arjona 6f3450ef1e MDL-72478 calendar: Fix PHPUnit failure with offset
Before PHP 8.0.10, the time is lost when datetime->modify() is used
with weekdays. However, with PHP 8.0.10, the time is kept.
In consequence, the test_yearly_every_20th_monday_forever method
started failing.
For fixing it, the offset has been removed and the time has been set
to 00:00, so the behaviour will be the same regardless the PHP
version.
2021-09-03 09:35:11 +02:00
Sara Arjona 089f5bb0ec weekly release 3.9.9+ 2021-09-02 11:51:29 +02:00
Jun Pataleta 0391a4afc7 Merge branch 'MDL-72440_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-09-02 09:52:20 +08:00
Eloy Lafuente (stronk7) 0b26fce0b6 MDL-72440 js: reconcile npm installed stuff
When npm-shrinkwrap.json was regenerated few days ago by MDL-72014
running audit-fix on it, it seems that some checksums in the "lodash"
package were missing.

Now they are properly set and that's leading to npm-shrinkwrap.json
changes when people runs npm install (note npm ci is the recommended
way to install all the dev dependencies).

So, just reconcile the file to include the new checksums.
2021-08-31 11:22:16 +02:00
Andrew Nicols 361070ef5d weekly release 3.9.9+ 2021-08-27 12:00:30 +08:00
Andrew Nicols 81cb18a67c Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-08-27 12:00:29 +08:00
Heena Agheda f4b92ca799 MDL-72187 logstore: record log store's visibility change 2021-08-26 12:57:38 +08:00
sam marshall e563d32ca2 MDL-72152 Behat: No way to test key shortcuts with letter keys
Extends the existing step 'And I press the Shift Left key' so that
it supports letter/other keys: 'And I press the Ctrl C key'.
2021-08-26 11:37:27 +08:00
Andrew Nicols 2575add511 Merge branch 'MDL-72312_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-08-26 11:28:34 +08:00
AMOS bot 61b3c4b453 Automatically generated installer lang files 2021-08-26 00:07:45 +00:00
Andrew Nicols d82d2bd6d6 Merge branch 'MDL-72014_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-08-24 09:17:17 +08:00
Eloy Lafuente (stronk7) a7a8db38aa Merge branch 'MDL-71055-39' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-08-23 23:22:51 +02:00
Eloy Lafuente (stronk7) a4e45e8159 MDL-72312 environment: Add new optional custom check for igbinary
This optional environmental check will look if:

- the site is running php72.
- the site has igbinary extension enabled.
- the igbinary extension version is a buggy one >=3.2.2 <= 3.2.4
- the bug is reproducible.

And will warn if all the conditions are met.
2021-08-23 15:50:18 +02:00
Eloy Lafuente (stronk7) 814c80da13 MDL-72312 GHA: Force use of igbinary working version
And also remove memcached and redis that have dependencies on it.

Versions 3.2.2 - 3.2.4 have a bug returning
arrays with index messed up. This affects
key() and next() operations when reading
information serialised with igbinary.

Notably Moodle's MUC uses igbinary when
available and was leading to some wrong
operations and test failures.

Once a fixed version is used by GHA this
can be reverted. See MDL-72399.

Note this only affects to php72, newer php
versions are not affected.
2021-08-23 15:49:59 +02:00
Andrew Nicols f7ffb41db4 MDL-71055 behat: Update core settings to use generator
These changes have only been applied to settings which were already
using settings names and values, but which were still using the UI.
2021-08-23 12:47:22 +08:00
AMOS bot c9efe1b1ac Automatically generated installer lang files 2021-08-18 00:07:41 +00:00
AMOS bot 82c845d8d3 Automatically generated installer lang files 2021-08-14 00:07:43 +00:00
Eloy Lafuente (stronk7) 30da75a460 MDL-72014 nodejs: audit fix to solve some security reports
Simply run npm audit fix that updates these main packages:

- xmldom 0.6.0
- grunt 1.4.1
- gherkin-lint 4.2.2

(and also a bunch of dependencies)
2021-08-12 20:07:10 +02:00
Ilya Tregubov fdb7aa8035 weekly release 3.9.9+ 2021-08-12 16:50:21 +02:00
Ilya Tregubov 4e14e2631c Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-08-12 16:50:20 +02:00
Eloy Lafuente (stronk7) 2ae147c9af Merge branch 'MDL-72265_39' of https://github.com/timhunt/moodle into MOODLE_39_STABLE 2021-08-12 00:06:21 +02:00
AMOS bot 6cacc0a4a3 Automatically generated installer lang files 2021-08-06 00:07:47 +00:00
Víctor Déniz c66c1a04b5 weekly release 3.9.9+ 2021-08-05 16:27:35 +01:00
Víctor Déniz 06001d9c9d Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-08-05 16:27:34 +01:00
Tim Hunt 9f01ded64e MDL-72265 backup: fix checking of override capabilites on restore
Thanks to Peter Dias <peter@moodle.com> for his help with the unit test.
2021-08-05 15:50:31 +01:00
Víctor Déniz 7bd088e443 Merge branch 'MDL-72262-39' of git://github.com/ilyatregubov/moodle into MOODLE_39_STABLE 2021-08-04 12:44:23 +01:00
Ilya Tregubov f67020d1c2 MDL-72262 behat: Make alias shorter to fix Oracle failures. 2021-08-02 08:26:50 +02:00
AMOS bot 2bc1e50886 Automatically generated installer lang files 2021-07-31 00:07:46 +00:00
Jun Pataleta a2fe75a270 Moodle release 3.9.9 2021-07-29 10:01:07 +08:00
Ilya Tregubov 6b632fef09 weekly release 3.9.8+ 2021-07-28 16:48:25 +02:00
Ilya Tregubov bc3e140d8b Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-07-28 16:48:25 +02:00
Jun Pataleta b53f12d8c9 Merge branch 'MDL-72203-39' of git://github.com/mickhawkins/moodle into MOODLE_39_STABLE 2021-07-28 11:27:48 +08:00
AMOS bot f9c700eb9f Automatically generated installer lang files 2021-07-28 00:07:44 +00:00
Michael Hawkins 0d3495e6b2 MDL-72203 curl: Improve redirect unit testing and update upgrade.txt
lib/upgrade.txt was updated to reflect the fact that all cURL redirects
will be emulated.
2021-07-27 23:27:02 +08:00
David Mudrák 72eac30148 MDL-72203 curl: Remove duplicate unit tests for emulated redirects
Before, we had each redirect test duplicated: one for the native
redirects via native cURL, second for our emulated implementation. Now
all redirects are always emulated so there is no need to have them
tested twice.
2021-07-27 23:22:21 +08:00
David Mudrák e19f451723 MDL-72203 curl: Check each URL in redirect chain to see if it is blocked
The security problem here was that only the first and the last URL in
the redirect chain was checked by the security helper. This patch forces
the curl wrapper to always emulate cURL redirects and check every
redirect URL in the chain before actually visiting it.
2021-07-27 23:22:21 +08:00
David Mudrák db0073291b MDL-72203 curl: Warn if someone actually started to use $maxredirects
The new parameter of curl_security_helper::url_is_blocked() introduced
in MDL-71916 became part of the API. Even if we reverted it quickly,
someone can use a released Moodle version that has that parameter in
place. For that reason and also to avoid potential troubles in the
future (e.g. when yet another argument would be added to this method),
we need to make it clear that the second parameter of this method should
never be used again.

Poor $maxredirects, you did not live long with us. Oh well.
2021-07-27 23:22:21 +08:00
David Mudrák 984e3fc510 MDL-72203 curl: Revert original fix of redirects to blocked URLs
This reverts the original fix introduced in MDL-71916. It introduced an
extra native cURL call inside curl_security_helper to check if the given
URL triggers a redirect to a blocked URL or not.

Shortly after the release, a couple of regressions were reported as a
result of the integrated solution. It was agreed to revert the fix and
progress with implementing an alternative approach.
2021-07-27 23:22:21 +08:00
Ilya Tregubov 698142b1f5 Merge branch 'MDL-72179-39' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-07-27 12:39:02 +02:00
Andrew Nicols 8669b0ebb7 MDL-72179 behat: Make use of page resolvers 2021-07-24 18:56:38 +08:00
Andrew Nicols 2204ea8afe MDL-72179 behat: Add page resolvers for activity roles/perms 2021-07-23 20:44:26 +08:00
Andrew Nicols 142e12bee7 MDL-72179 behat: Add page resolver for activity names 2021-07-23 20:32:44 +08:00
Andrew Nicols 2bdebbf6e7 MDL-72179 behat: Add activity editing page resolution 2021-07-23 20:32:15 +08:00
Andrew Nicols f47ec5d0a9 MDL-72179 behat: Fix page resolvers to remove ambiguity
The simple pattern matches were conflicting in some situations. To make
this backwards compatable we need to convert it to a Regex pattern match
instead, and provide the quoted and unquoted variants.
2021-07-23 20:31:45 +08:00
Andrew Nicols 52da2d6eaa MDL-72179 behat: Correct course category page resolving
There were two issues here:
* I am on the [categoryname] category page page (duplicated page)
* the wrong URL was being used

Since an incorrect URL was used I felt it safe to rename the step from
'category page page' to 'category page'.
2021-07-23 20:28:15 +08:00
Andrew Nicols 78b0f6e204 MDL-72179 behat: Lowercase all page instance resolvers 2021-07-23 20:28:14 +08:00
Andrew Nicols 7030fa5972 MDL-72179 behat: Improve core page resolvers
This commit makes the following improvements to core page resolverss:
* allows for mixed case naming (course, Course, etc.)
* allows fields other than the idnumber to be specified:
** course: idnumber, shortname, fullname
** course category: idnumber, name

Whilst some of these fields are not unique, they will typically be
unique in most test scenarios. Where they are not then the idnumber
should be used in preference.
2021-07-23 20:28:10 +08:00
Ilya Tregubov 2bd53efc1b weekly release 3.9.8+ 2021-07-23 11:31:05 +02:00
Ilya Tregubov 9ccb3a2af9 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-07-23 11:31:04 +02:00
AMOS bot 3354f46fd6 Automatically generated installer lang files 2021-07-22 00:07:52 +00:00
Ilya Tregubov 9fb1e3d300 Merge branch 'MDL-72125-39' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-07-21 08:02:52 +02:00
Andrew Nicols e4b11bf852 MDL-72125 mod_assign: Use assign submission data generators 2021-07-21 07:37:59 +08:00
Andrew Nicols 28cf3f9119 MDL-72125 mod_assign: Add data generator for assign submissions 2021-07-20 21:38:47 +08:00
Andrew Nicols 1a885a1756 MDL-72125 testing: Make global $CFG available when including generators
This will remove the requirement to add the global $CFG call to the top
of generator scripts.
2021-07-20 21:38:47 +08:00
Andrew Nicols 753035e090 MDL-72125 behat: Add get_activity_id() behat generators helper 2021-07-20 21:38:46 +08:00
Andrew Nicols cb98541563 MDL-72125 testing: Set a default idnumber when creating activities
The activity generator currently requires an idnumber when creating
activities, but this is not a requirement when creating the same
activity through the UI. The requirement comes because we want to
provide a way to refer to activities in subsequent steps.

This commit modifies the behaviour such that the generator uses the name
of the activity as the default idnumber.

This has two  main benefits:
1. it simplfies generation of activities; and
2. it makes the language used when writing behat tests much more natural.

With this change, steps will refer to the activity by its idnumber/title
in all cases, rather than sometimes by an idnumber which bears no
relevance to the title.
2021-07-20 21:38:46 +08:00
Andrew Nicols 2729301721 MDL-72125 testing: Add helper to run generators as a user 2021-07-20 21:38:46 +08:00
abgreeve 54a2d7df22 weekly release 3.9.8+ 2021-07-16 10:16:44 +08:00
abgreeve 59f97a627f Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-07-16 10:16:43 +08:00
AMOS bot 362c67f84d Automatically generated installer lang files 2021-07-16 00:07:46 +00:00
Eloy Lafuente (stronk7) cbe5ec5a51 Merge branch 'MDL-72139-39' of git://github.com/cescobedo/moodle into MOODLE_39_STABLE 2021-07-14 14:50:10 +02:00
cescobedo 201eff4d98 MDL-72139 core_message: Fix encoding UTF-8 in prevent unclosed tags 2021-07-14 07:41:33 +02:00
Sara Arjona 22e52ebb55 Merge branch 'MDL-71782_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-07-13 16:44:53 +02:00
Jun Pataleta 493d3c218e Merge branch 'MDL-72036-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2021-07-13 16:04:57 +08:00
Sara Arjona 97ff875c83 MDL-72036 atto_h5p: Random error with external URL
After a major upgrade was done in h5p.com, some random errors appeared
in the "H5P options are ignored for H5P URLs" scenario.
They have been fixed replacing the URL for different (which should
load quicker). As we're checking external content, no other improvement
can be done on the Moodle site.
2021-07-13 08:37:57 +02:00
AMOS bot 8a5601722d Automatically generated installer lang files 2021-07-11 00:07:43 +00:00
Eloy Lafuente (stronk7) 68aa19ba73 Moodle release 3.9.8 2021-07-10 18:55:57 +02:00
Eloy Lafuente (stronk7) c8d12c3217 MDL-71782 behat: Ensure page after saving changes is there
A similar approach was followed @ MDL-67935, although the
case doesn't seem to be the same.

In any case, it's curious that all local execution are
100% passing and only CIs fail so often. Just guessing if,
maybe, there is some Chrome version factor around (we
are running older, sticky, versions @ CIs.
2021-07-10 15:51:07 +02:00
AMOS bot f9d08701fb Automatically generated installer lang files 2021-07-09 00:07:52 +00:00
Eloy Lafuente (stronk7) 324e1fbb78 weekly release 3.9.7+ 2021-07-08 23:44:00 +02:00
Eloy Lafuente (stronk7) b58a4e8da4 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-07-08 23:43:58 +02:00
Jun Pataleta e7c0ddb942 Merge branch 'MDL-71919-39-fix' of https://github.com/cescobedo/moodle into MOODLE_39_STABLE 2021-07-08 23:34:54 +02:00
Jun Pataleta e9d63ac29c Merge branch 'MDL-70594_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-07-08 23:34:54 +02:00
cescobedo fce440eeed MDL-71919 core_message: Fix tests in message_send 2021-07-08 23:34:54 +02:00
Huong Nguyen 5fae2fc7a1 MDL-71922 file: Enhance endless recursion requests protection 2021-07-08 23:34:54 +02:00
cescobedo 913eb31830 MDL-71919 core_message: Fix unclosed html tags in email notification 2021-07-08 23:34:54 +02:00
Paul Holden 68fbcaf303 MDL-71957 auth_shibboleth: safer session retrieval during logout. 2021-07-08 23:34:54 +02:00
Dongsheng Cai 20403e0e43 MDL-71978 core_calendar: only allow owner to edit user subscriptions 2021-07-08 23:34:54 +02:00
Adrian Greeve 2740e06920 Merge branch 'MDL-71887-39' of https://github.com/snake/moodle into MOODLE_39_STABLE 2021-07-08 23:34:53 +02:00
Mihail Geshoski a84b51046a MDL-58393 core: Remove firstname argument from emailconfirmation string 2021-07-08 23:34:53 +02:00
Sujith Haridasan a19092e71c MDL-71241 course: Validate and sanitize sort arguments
Signed-off-by: Sujith Haridasan <sujith@moodle.com>
2021-07-08 23:34:39 +02:00
Mihail Geshoski b41a748a98 MDL-71242 core_course: Fix failing unit test 2021-07-08 23:34:39 +02:00
Mihail Geshoski cd96cb300e MDL-71242 core_course: Test the validation of the sort value
Adds new unit test, test_course_get_recent_courses_sort_validation(),
which is reponsible for testing the validation of the sort value in
course_get_recent_courses().
2021-07-08 23:34:39 +02:00
Mihail Geshoski e3c031023f MDL-71242 core_course: Update test_course_get_recent_courses() unit test
Adds additional assertions in test_course_get_recent_courses() test to
ensure that the sort funcionality works as expected.
2021-07-08 23:34:39 +02:00
Mihail Geshoski c5b4da7257 MDL-71242 core_course: Validate the value of the sort argument
This change validates the value of the sort argument in
course_get_recent_courses().
2021-07-08 23:34:26 +02:00
Claude Vervoort 7edc33a8ce MDL-71887 mod_lti: repost when no cookie due to crosssite request 2021-07-07 14:19:00 +08:00
Michael Hawkins 61e9318339 MDL-71916 lib: Check cURL redirects for blocked URLs before following 2021-07-06 23:45:24 +02:00
cescobedo f254b2b88f MDL-71917 core_message: Use $USER in WS delete_message_for_all_users 2021-07-06 13:32:08 +08:00
Paul Holden 264fe69743 MDL-71981 user: escape identity fields if writer supports HTML. 2021-07-06 09:29:44 +08:00
Paul Holden 80e2f8473e MDL-71981 dataformat: indicate HTML support in writer callback. 2021-07-06 09:29:44 +08:00
Eloy Lafuente (stronk7) b9b5f4b489 MDL-70594 environment: Apply agreed changes
- PostgreSQL 10 required.
- Exif PHP extension recommended.
2021-07-01 22:42:30 +02:00
Eloy Lafuente (stronk7) dc871f251e MDL-70594 environment: 4.0 base information
This is a direct copy of the 3.11 branch to have
the changes under control in next commits.
2021-07-01 22:42:30 +02:00
AMOS bot f972485484 Automatically generated installer lang files 2021-06-23 00:07:48 +00:00
AMOS bot 1f9488ccb5 Automatically generated installer lang files 2021-06-19 00:07:49 +00:00
Víctor Déniz 1d8512bc0e weekly release 3.9.7+ 2021-06-17 14:55:05 +01:00
Víctor Déniz b751583087 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-06-17 14:55:04 +01:00
Andrew Nicols 94b897a176 Merge branch 'MDL-71939_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-06-16 13:14:34 +08:00
Jun Pataleta 4c6b771c2f MDL-71939 mod_h5pactivity: Increase window size during test
The addition of the activity information moves the h5p content down
out of the window view on Firefox which causes the Check button to be
unclickable. This patch increases the window size to ensure that the
check button is visible and clickable.

Credits to Eloy <stronk7@moodle.org> for the thorough investigation
of the root cause of this issue :)

This is a backport of MDL-71876 that is a backport of MDL-71337
2021-06-15 23:34:32 +02:00
Andrew Nicols b8122e1de3 Merge branch 'MDL-71804_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-06-15 11:28:45 +08:00
AMOS bot a9eae7edf4 Automatically generated installer lang files 2021-06-10 00:07:42 +00:00
Eloy Lafuente (stronk7) a7a9150b62 MDL-71804 travis: Bump to bionic 2021-05-29 10:26:34 +02:00
AMOS bot c283ed04e0 Automatically generated installer lang files 2021-05-29 00:07:42 +00:00
AMOS bot f65e706662 Automatically generated installer lang files 2021-05-27 00:07:43 +00:00
AMOS bot 49e1731fbe Automatically generated installer lang files 2021-05-24 00:07:43 +00:00
AMOS bot cd320b32b5 Automatically generated installer lang files 2021-05-23 00:07:40 +00:00
Sara Arjona 8dea153c6b weekly release 3.9.7+ 2021-05-20 11:09:11 +02:00
Sara Arjona ae9fea0b47 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-05-20 11:09:10 +02:00
Jun Pataleta dc9258574d Merge branch 'MDL-71157-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2021-05-20 12:29:36 +08:00
Eloy Lafuente (stronk7) 5b94aaed06 Merge branch 'MDL-67935-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2021-05-19 22:50:53 +02:00
Sara Arjona a099c8d921 MDL-71157 block_myoverview: remove wait from behat
The step "And I wait until ".block_myoverview
[data-control='next']" "css_element" exists" is not correct
because this [data-control='next'] element exists before and
after the step so, in some cases, it might cause the following
step will start earlier than expected.
As pending JS has been added, this wait steps are not required
any more.
2021-05-19 12:38:28 +02:00
Andrew Nicols 36a3c41b8b MDL-71157 core: Pending JS in paged content bars 2021-05-19 12:38:27 +02:00
AMOS bot d7208f8dd0 Automatically generated installer lang files 2021-05-18 00:07:55 +00:00
Sara Arjona df9c7f755d MDL-67935 tool_lp: fix random errors with login/logout 2021-05-14 10:53:25 +02:00
AMOS bot a76583296b Automatically generated installer lang files 2021-05-14 00:07:50 +00:00
Sara Arjona b56affcfe6 weekly release 3.9.7+ 2021-05-11 12:42:36 +02:00
Sara Arjona 4799f8b7c4 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-05-11 12:42:35 +02:00
AMOS bot 62758b8224 Automatically generated installer lang files 2021-05-11 00:07:51 +00:00
Víctor Déniz cf6aeae427 Merge branch 'MDL-71060-39' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_39_STABLE 2021-05-10 23:43:30 +01:00
Thong Bui 8ea5b30a5d MDL-71060 Questions: Duplicates 'Current category' text. 2021-05-10 00:25:38 +07:00
Eloy Lafuente (stronk7) 270f52bf55 Moodle release 3.9.7 2021-05-08 16:40:39 +02:00
Eloy Lafuente (stronk7) 1affa30299 weekly release 3.9.6+ 2021-05-07 16:54:47 +02:00
Eloy Lafuente (stronk7) f61b2edde0 NOBUG: Fixed SVG browser compatibility 2021-05-07 16:54:46 +02:00
Eloy Lafuente (stronk7) d1b2674eea Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-05-07 16:54:46 +02:00
abgreeve 849f392f3b Merge branch 'MDL-68747-39' of https://github.com/dcai/moodle into MOODLE_39_STABLE 2021-05-07 11:46:50 +08:00
Mathew May 2c73122c60 MDL-70622 mod_lti: Tighten redirect param typing 2021-05-07 11:46:50 +08:00
Adam Olley 3b6104d6dc MDL-70622 mod_lti: Prevent xss on lti 1.3 authentication script
Without this, people can craft URLs that other users might use not realising
what they do - and as a XSS vulnerability, it could do any number of things the
clicking-user has access to do on the site.

Change-Id: I82adc71e8706d8929011b4b24523d5b62b8ccea1
2021-05-07 11:46:41 +08:00
Jun Pataleta be2eb84be9 Merge branch 'MDL-71395-39-2' of git://github.com/marinaglancy/moodle into MOODLE_39_STABLE 2021-05-07 10:30:52 +08:00
abgreeve 711b1a5ae9 Merge branch 'MDL-70181_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-05-07 10:22:50 +08:00
Víctor Déniz df136f7535 Merge branch 'MDL-71303-39' of https://github.com/StudiUM/moodle into MOODLE_39_STABLE 2021-05-06 23:34:49 +01:00
Eloy Lafuente (stronk7) 6c996b1570 Merge branch 'MDL-70049-39_count_submissions' of https://github.com/agrowe/moodle into MOODLE_39_STABLE 2021-05-06 23:27:31 +02:00
Eloy Lafuente (stronk7) f01179355c Merge branch 'MDL-70772-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-05-06 23:20:20 +02:00
Eloy Lafuente (stronk7) 414102ed74 Merge branch 'MDL-71313_39' of https://github.com/timhunt/moodle into MOODLE_39_STABLE 2021-05-06 23:15:18 +02:00
Eloy Lafuente (stronk7) 24cd545eb8 Merge branch 'MDL-71343-m39' of https://github.com/rjnl/moodle into MOODLE_39_STABLE 2021-05-06 23:07:54 +02:00
Sara Arjona bcf349ed45 MDL-70110 mod_assign: make phpunit test DB order agnostic 2021-05-06 19:38:57 +02:00
Sara Arjona ae221af121 Merge branch 'MDL-71491-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-05-06 18:42:41 +02:00
Marina Glancy 4f87b28436 MDL-71395 core: fix bug in google lib wrapper
because of changes in PHP8 the '' == 0 is no longer true and the error in the google api wrapper was discovered
2021-05-06 18:38:42 +02:00
Sara Arjona b3a66b1484 Merge branch 'MDL-71420_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-05-06 17:58:40 +02:00
Víctor Déniz 52b5aa5a18 Merge branch 'MDL-71402-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-05-06 16:47:12 +01:00
Marina Glancy de6a44d7d0 MDL-71395 block_tag_youtube: sometimes exception may have empty message 2021-05-06 17:41:47 +02:00
Paul Holden 21941c6c2a MDL-71491 repository_flickr: return more file data.
See also 643b0cca.
2021-05-06 16:37:19 +01:00
Sara Arjona 54da1506a1 Merge branch 'MDL-71268-39' of git://github.com/lucaboesch/moodle into MOODLE_39_STABLE 2021-05-06 17:11:45 +02:00
Paul Holden 7f3a1dff28 MDL-71402 availability: fix group restriction button in mod form.
* The button to "Add group/grouping access restriction" under
   common module settings should only be present if corresponding
   availability plugins are enabled; and
 * Prevent the same button behaving as a submit button, which
   intercepted the user hitting return in the form and added a
   restriction without deliberate action taken by the user.
2021-05-06 14:20:29 +01:00
Sara Arjona 818182879a Merge branch 'MDL-70110-39' of https://github.com/septatrix/moodle into MOODLE_39_STABLE 2021-05-06 13:16:20 +02:00
Víctor Déniz e995073997 Merge branch 'MDL-71434-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-05-06 11:15:29 +01:00
Sara Arjona bc47266a65 Merge branch 'MDL-71390-39' of git://github.com/marinaglancy/moodle into MOODLE_39_STABLE 2021-05-06 08:05:26 +02:00
Adrian Greeve 799e988f80 Merge branch 'MDL-70786-39' of git://github.com/lucaboesch/moodle into MOODLE_39_STABLE 2021-05-06 10:04:26 +08:00
AMOS bot 9bae0ce6a7 Automatically generated installer lang files 2021-05-06 00:07:53 +00:00
Eloy Lafuente (stronk7) d6a633d7a8 MDL-71420 environment: Lower sodium requirement to recommended 2021-05-05 23:06:22 +02:00
Sara Arjona 16dff14e56 Merge branch 'MDL-71517-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-05-05 12:18:03 +02:00
Sara Arjona c0d26fff0d Merge branch 'MDL-71187-39' of git://github.com/lucaboesch/moodle into MOODLE_39_STABLE 2021-05-05 12:14:23 +02:00
Víctor Déniz 3698f34fc3 Merge branch 'MDL-71460-39' of git://github.com/peterRd/moodle into MOODLE_39_STABLE 2021-05-05 10:45:53 +01:00
Paul Holden e52ec9edd4 MDL-71517 mod_data: remove invalid form custom data access.
On PHP7.4, trying to access array offsets of NULL triggers a notice.
2021-05-05 10:18:18 +01:00
Luca Bösch 63b4929729 MDL-71187 quizaccess_seb: Change "Launch Safe Exam Browser" to a href.
In order to allow for correct seb:// or sebs:// calls without browser
warnings of insecure links, it is not possible to send a get request
with an attached cmid parameter to the unknown seb:// or sebs://
URL via a form button.
We've got to use a <a href> link outside a form to circumvent
browsers warning of an insecure link and call Safe Exam Browser
correctly.
2021-05-05 10:54:24 +02:00
Leon Stringer 3afbffe6a0 MDL-70181 database: Quote database object names
Table names and database name now enclosed in backticks.
admin/cli/mysql_collation.php failed if $CFG->prefix was blank with
MySQL 8.0 because table 'groups' conflicted with a new reserved word.

Note that this quotes both mysql_collation.php and mysql_compressed_rows.php
but only the former was mal-functioning.

The case of mysql_compressed_rows.php is a little bit special because
not all tables are processed, only those having big rows. And the groups
table is not one of them. In any case, better add the quotes there for
any future case.

Also, when testing this patch https://tracker.moodle.org/browse/MDL-71512
was discovered and will need to be fixed to make core 100% compliant
with MySQL 8.0 and MariaDB 10.6 and up.
2021-05-05 10:16:59 +02:00
Peter Dias 1dd574efd8 MDL-71460 hub: Use checkboxes instead of dropdowns
Change the yes/no dropdowns to a checkbox. Defaults to unchecked.
2021-05-05 10:28:02 +08:00
Víctor Déniz a426320c54 Merge branch 'MDL-70864-39-zip_packer_windows' of git://github.com/mudrd8mz/moodle into MOODLE_39_STABLE 2021-05-05 00:04:07 +01:00
Eloy Lafuente (stronk7) 3dea860e64 Merge branch 'MDL-71425-39-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_39_STABLE 2021-05-04 23:40:20 +02:00
Paul Holden 69f3e0753e MDL-71359 mod_forum: empty forums shouldn't export anything. 2021-05-04 17:23:49 +02:00
Sara Arjona 690bad040a MDL-71408 h5plib_v124: Add required changes after lib upgrade
- The mbstring extension is required since Moodle 3.9 onwards so
the upgrading steps have been removed because they are not
required any more.
- The pull-request for fixing some minor PHP7.4 problems has been
integrated so this patch is not required.
2021-05-04 17:23:49 +02:00
Sara Arjona 22c30c160e MDL-71408 h5plib_v124: Upgrade H5P core library to 1.24.02 2021-05-04 17:23:49 +02:00
Huong Nguyen b28b6066b4 MDL-70720 Quiz: Improve capability checks when fetching users' best grades 2021-05-04 17:23:49 +02:00
Shamim Rezaie c4e993d546 MDL-69028 repository: Put a rate limit on draft file uploads 2021-05-04 17:23:49 +02:00
Paul Holden 5b7d2a1992 MDL-71130 quiz_grading: escape user idnumber on display. 2021-05-04 17:23:49 +02:00
David Mudrák 23846c5450 MDL-70804 mnet: Use proper DML method to get records from the table
This improves the code and avoids the risk of SQL injection through the
malicious XML-RPC request from the MNet peer.
2021-05-04 17:23:49 +02:00
Sara Arjona b6d65c77cf Merge branch 'MDL-71274-39' of git://github.com/aanabit/moodle into MOODLE_39_STABLE 2021-05-04 17:10:55 +02:00
David Mudrák f77ec5e7fd MDL-71425 lang: Fix reworded strings in tests 2021-05-04 16:59:21 +02:00
Helen Foster 9031cf789d MDL-71425 lang: Import fixed English strings (en_fix) 2021-05-04 16:59:04 +02:00
Luca Bösch 010aa5ee16 MDL-70786 report_loglive: respect fullname setting. 2021-05-04 14:30:33 +02:00
Luca Bösch 2014c08636 MDL-70786 report_log: respect fullname setting. 2021-05-04 14:30:33 +02:00
Luca Bösch f5531458aa MDL-70786 report_completion: respect fullname setting. 2021-05-04 14:30:33 +02:00
Luca Bösch a6e2d950e7 MDL-70786 report_competency: respect fullname setting. 2021-05-04 14:30:33 +02:00
Luca Bösch dddc4cc410 MDL-70786 report_progress: respect fullname setting. 2021-05-04 14:30:33 +02:00
Luca Bösch 2e16fca0f1 MDL-71268 graphics: Use new Moodle logo for RSS feeds by Moodle 2021-05-04 14:14:10 +02:00
Sara Arjona 30d1832f45 weekly release 3.9.6+ 2021-05-04 13:27:53 +02:00
Sara Arjona 24c44b38be Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-05-04 13:27:52 +02:00
Adrian Greeve d848c604dd Merge branch 'MDL-66673-MOODLE_39_STABLE' of https://github.com/ScottVerbeek/moodle into MOODLE_39_STABLE 2021-05-04 15:47:08 +08:00
AMOS bot 9a4034f3bf Automatically generated installer lang files 2021-05-04 00:07:53 +00:00
Paul Holden 4c1d448b5b MDL-71463 dml: escape square brackets for SQL Server LIKE operator. 2021-05-03 19:01:24 +02:00
David Mudrák f92e83fe36 MDL-70864 files: Fix zip_packer extracting files with trailing dots
File and folder names cannot end with dots on Windows. So replace the
trailing dots with underscore consistently with how some other zip tools
(such as 7-zip) handle this case.
2021-05-03 18:15:44 +02:00
Marina Glancy d500b5c62d MDL-71390 core: raise max_input_vars requirement for Moodle 3.11 2021-05-03 13:29:52 +02:00
Adrian Greeve 65fad5f93f Merge branch 'MDL-71440-39' of git://github.com/mihailges/moodle into MOODLE_39_STABLE 2021-05-03 16:04:05 +08:00
Mihail Geshoski 7ea8dc7112 MDL-71440 mod_assign: New capability for viewing the submission summary
Creates a new capability mod/assign:viewownsubmissionsummary which will
be required in order to display the submission summary to the user in
the assignment page.
2021-05-03 15:33:55 +08:00
Jake Dallimore 276476233d Merge branch 'MDL-52724-39' of git://github.com/merrill-oakland/moodle into MOODLE_39_STABLE 2021-05-03 13:25:51 +08:00
Víctor Déniz a565c5d93d Merge branch 'MDL-69956-39' of https://github.com/dcai/moodle into MOODLE_39_STABLE 2021-05-01 13:43:55 +01:00
Víctor Déniz a72e1f1e0d weekly release 3.9.6+ 2021-04-30 12:54:26 +01:00
Rajneel Totaram 2d86d87012 MDL-71343 core_h5p: Convert all line-endings to UNIX format 2021-04-30 23:32:05 +12:00
Andrew Nicols 27ea958dfe MDL-71343 core_h5p: Add unit test for helper::parse_js_array
Signed-off-by: Rajneel Totaram <rjnlfj@yahoo.com>
2021-04-30 23:31:37 +12:00
Dongsheng Cai 2410df1fd2 MDL-69956 forum: throw exception when advanced grading is not ready 2021-04-30 14:59:42 +10:00
Adrian Greeve ccb1a3b39f Merge branch 'MDL-71481-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-30 11:20:17 +08:00
Jun Pataleta ce2058c4c2 Merge branch 'MDL-70947-39' of git://github.com/HuongNV13/moodle into MOODLE_39_STABLE 2021-04-30 10:34:30 +08:00
Sara Arjona b7fb146cca Merge branch 'MDL-60331-39_take3' of git://github.com/lucaboesch/moodle into MOODLE_39_STABLE 2021-04-29 17:50:06 +02:00
Amaia Anabitarte 2695a394fe MDL-71274 analytics: Don't generate insight for hidden courses
Hidden courses can be used for training
but we do not want to generate insights for them
because students do not have access to hidden courses.
This was fixed in MDL-66806 for "Students at risk" model.
Fixed for "Students who have not accessed the course recently" in this issue.
2021-04-29 11:14:12 +02:00
Paul Holden 05e9ae07cd MDL-71481 repository_flickr_public: return more file data.
A HTTP HEAD request is required to get the image filesize.
The remaining data can be obtained from existing calls to
the Flickr API.
2021-04-29 09:49:24 +01:00
Sara Arjona c14603ecd1 Merge branch 'MDL-71016-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-29 09:21:58 +02:00
Jun Pataleta 5d2d5bc542 Merge branch 'MDL-70863-39' of git://github.com/jleyva/moodle into MOODLE_39_STABLE 2021-04-29 15:05:22 +08:00
Andrew Nicols 3d92acac8a Merge branch 'MDL-56609_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-04-29 09:42:14 +08:00
Víctor Déniz ac115326f9 Merge branch 'MDL-71200-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-28 20:57:59 +01:00
Paul Holden cb94a54412 MDL-71016 gradeexport_xml: ensure user/grade idnumbers are encoded. 2021-04-28 19:04:03 +01:00
Luca Bösch 0c2e30809a MDL-60331 questions: prevent double escaping question categories. 2021-04-28 17:59:59 +02:00
Sara Arjona a6c9132e73 Merge branch 'MDL-70979-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-28 13:06:30 +02:00
Sara Arjona 323276969f Merge branch 'MDL-71127-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-28 12:58:35 +02:00
Sara Arjona 18a99edcb9 Merge branch 'MDL-70763-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-28 12:31:13 +02:00
Septatrix 9d6fff9671 MDL-70110 assign: add group submission attemptnumber test 2021-04-28 11:49:53 +02:00
Sara Arjona c4dad5b5e6 Merge branch 'MDL-71244-39' of git://github.com/lucaboesch/moodle into MOODLE_39_STABLE 2021-04-28 09:17:46 +02:00
Andrew Nicols 9c4204c96b Merge branch 'MDL-71168-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-28 10:50:33 +08:00
Andrew Nicols 15da5ba48e MDL-70909 mod_h5pactivity: Whitespace fix 2021-04-28 10:34:00 +08:00
Andrew Nicols c7e65064b1 Merge branch 'MDL-70909-39' of git://github.com/ferranrecio/moodle into MOODLE_39_STABLE 2021-04-28 10:33:54 +08:00
Andrew Nicols 32702452e7 Merge branch 'MDL-71386-39' of git://github.com/NoelDeMartin/moodle into MOODLE_39_STABLE 2021-04-28 10:16:02 +08:00
Eloy Lafuente (stronk7) 2e1151bbb3 MDL-56609 phpunit: Fix bogus expectation on DST changes day
Current test works ok every day of the year but the day of
DST begin changes (last Sunday of March currently).

That day, 01:00 Europe/London simply doesn't exist, because
the time is moved forward by 60 minutes.

Hence the expectation for the next cron execution is not 1 "normal"
day (24h) but 1 less hour.

Note this only happens for the current test on DST begins, the
opposite change (DST ends), happening the last Sunday of October
is not affected, because, at all effects, 01:00 is a perfectly normal
and existing hour.
2021-04-27 18:31:05 +02:00
Luca Bösch 2e7cc5e17c MDL-71244 enrol_manual: Add bootstrap classes to buttons 2021-04-27 17:24:51 +02:00
Ferran Recio 513ac0c086 MDL-70909 mod_h5pactivity: fix reports on freeze context 2021-04-27 15:44:25 +02:00
Ferran Recio 9f7752d6bc MDL-70909 behat: context freeze and not freeze steps 2021-04-27 15:44:25 +02:00
Ferran Recio 79071cdd87 MDL-70909 core: add cannotmatchanyrows to capabilities join 2021-04-27 15:44:25 +02:00
Sara Arjona 69962f36d7 weekly release 3.9.6+ 2021-04-27 15:14:56 +02:00
Víctor Déniz 76ef9c5d1a Merge branch 'MDL-65687-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-27 01:13:36 +01:00
Víctor Déniz b67b742e40 Merge branch 'MDL-71003-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-27 00:38:48 +01:00
Sara Arjona eece2df651 Merge branch 'MDL-70917-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-26 15:18:17 +02:00
Sara Arjona 61ef211525 Merge branch 'MDL-71416-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-26 12:35:56 +02:00
Eloy Lafuente (stronk7) 535fcef31e Merge branch 'MDL-70446-m39' of https://github.com/sammarshallou/moodle into MOODLE_39_STABLE 2021-04-26 10:45:26 +02:00
Paul Holden 817757c088 MDL-71434 mod_data: add form control class to template textarea. 2021-04-25 18:35:05 +01:00
Tim Schroeder 054d5c0f04 MDL-70110 assign: fixed ws get_submissions for groups 2021-04-24 12:12:01 +02:00
Paul Holden adcd50bea0 MDL-71416 report_log: user context header should show users name.
Co-Authored-By: Luca Bösch <luca.boesch@bfh.ch>
2021-04-23 20:24:39 +01:00
Sara Arjona 3018a35249 weekly release 3.9.6+ 2021-04-23 10:47:01 +02:00
Jun Pataleta 1d217301ad Merge branch 'MDL-71171_39' of git://github.com/mdjnelson/moodle into MOODLE_39_STABLE 2021-04-23 12:40:29 +08:00
Mark Nelson 4dc6c7a79d MDL-71171 customfield_text: ensure we set defaults properly 2021-04-23 12:37:49 +08:00
Andrew Nicols 6d6a39e34d Merge branch 'MOODLE_39_STABLE-MDL-71376' of https://github.com/rjnl/moodle into MOODLE_39_STABLE 2021-04-23 11:53:36 +08:00
Andrew Nicols 1b169c82be Merge branch 'MDL-70970-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-23 11:39:52 +08:00
ScottVerbeek 91376cdb69 MDL-66673 groups: Stop notice when messaging system is disabled 2021-04-23 08:55:09 +10:00
Sara Arjona 3f5477f8a0 Merge branch 'MDL-71136_39' of https://github.com/TomoTsuyuki/moodle into MOODLE_39_STABLE 2021-04-22 13:56:55 +02:00
Sara Arjona 2166e3e681 Merge branch 'MDL-71400-39' of git://github.com/mihailges/moodle into MOODLE_39_STABLE 2021-04-22 13:16:44 +02:00
Jun Pataleta 9e3b15f31e Merge branch 'MDL-71170_39' of git://github.com/mdjnelson/moodle into MOODLE_39_STABLE 2021-04-22 18:54:41 +08:00
Noel De Martin dfe187a59d MDL-71386 behat: Support for 3.9.5+ mobile app 2021-04-22 12:16:25 +02:00
Paul Holden 45725c2408 MDL-71200 mod_folder: ensure "Download folder" option is backed up. 2021-04-22 10:29:04 +01:00
Paul Holden 8aea2ef66b MDL-70979 search: validate external user search parameters.
Clean return value in unit test for same.
2021-04-22 10:23:10 +01:00
Mihail Geshoski f065061f08 MDL-71400 assignfeedback_offline: Fix message after worksheet upload 2021-04-22 13:08:59 +08:00
Jun Pataleta 92df285f49 Merge branch 'MDL-71156-39' of git://github.com/lameze/moodle into MOODLE_39_STABLE 2021-04-22 11:53:53 +08:00
Simey Lameze c72839d6d0 MDL-71156 core: machinery to recover orphaned calendar events
The machinery to fix orphaned calendar events that were broken by MDL-67494.

The solution consists of:

1) Upgrade step that checks if this site has executed the problematic upgrade steps and
   if positive, it will schedule a new run for calendar_fix_orphaned_events adhoc task.

2) Adhoc task that will self-spawn calling the recovery machinery, running until
   all the orphaned calendar events are fixed. It also sets the maximum runtime of
   60 seconds. It is also possible to override that number by specifing the desired
   number setting the ->calendareventsmaxseconds in your config.php

3) CLI script that will look for all the calendar events which userids
   where broken by a wrong upgrade step, affecting to Moodle 3.9.5
   and up.

   It performs checks to both:
     a) Detect if the site was affected (ran the wrong upgrade step).
     b) Look for orphaned calendar events, categorising them as:
       - standard: site / category / course / group / user events
       - subscription: events created via subscriptions.
       - action: normal action events, created to show common important dates.
       - override: user and group override events, particular, that some activities support.
       - custom: other events, not being any of the above, common or particular.

   By specifying it (--fix) try to recover as many broken events (missing userid) as
   possible. Standard, subscription, action, override events in core are fully supported but
   override or custom events should be fixed by each plugin as far as there isn't any standard
   API (plugin-wise) to launch a rebuild of the calendar events.

4) Unit tests and helper functions to generate calendar events. We have decided to
   keep the tests simple, testing only true and false and not using data generators because
   the code is purely to recover the calendar events and won't turn into an API or something
   and also due to the urgency of this issue.
   The helpers have been created in calendar/tests/helpers.php since there are no data generators
   for calendar.
2021-04-22 10:45:27 +08:00
Andrew Nicols f33b8bb576 Merge branch 'MDL-70412-39' of git://github.com/aanabit/moodle into MOODLE_39_STABLE 2021-04-22 10:07:40 +08:00
Sara Arjona 7ccf8f2fe4 Merge branch 'MDL-64336-m39' of https://github.com/NeillM/moodle into MOODLE_39_STABLE 2021-04-21 17:15:23 +02:00
Sara Arjona 0997a89e39 Merge branch 'MDL-62244_39_label_view' of https://github.com/sheesania/moodle into MOODLE_39_STABLE 2021-04-20 17:45:12 +02:00
Sara Arjona f63aed03b8 weekly release 3.9.6+ 2021-04-20 15:51:17 +02:00
Sara Arjona cf3215cff4 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-04-20 15:51:16 +02:00
Paul Holden d26512cb63 MDL-70970 quizaccess_seb: consistent property array sorting by key.
In PHP8.0 using `ksort` was producing incorrect results by sorting
keys differing only in case in the wrong order. This change makes
sorting consistent between PHP versions.

Co-Authored-By: Tim Hunt <T.J.Hunt@open.ac.uk>
2021-04-20 14:36:22 +01:00
Rajneel Totaram b4ccc75a03 MDL-71376 mod_quiz: fix undefined object reference 2021-04-20 20:14:53 +12:00
Jun Pataleta 49f994fb03 Merge branch 'MDL-71364_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-04-20 09:23:14 +08:00
AMOS bot ebd1eb3726 Automatically generated installer lang files 2021-04-20 00:07:48 +00:00
Víctor Déniz 88d21b999c Merge branch 'MDL-71087-39' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_39_STABLE 2021-04-19 23:45:29 +01:00
Eloy Lafuente (stronk7) 946cbedf54 Merge branch 'MDL-69256-39' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-04-20 00:05:14 +02:00
Víctor Déniz 6ec958e639 Merge branch 'MOODLE_39_STABLE_fix_gradeimport_csv' of https://github.com/intrajp/moodle into MOODLE_39_STABLE 2021-04-19 22:49:51 +01:00
Dongsheng Cai 737682c750 MDL-68747 mod_quiz: force LTR for quiz grading overview chart 2021-04-19 21:06:31 +10:00
Sara Arjona 138e5b9996 Merge branch 'MDL-71365_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-04-19 10:18:46 +02:00
Paul Holden f3f7f28015 MDL-71127 mod_quiz: fix thrown exception for invalid question columns. 2021-04-19 09:07:24 +01:00
Paul Holden 2bada93f17 MDL-71168 report_participation: fix select all users checkbox. 2021-04-19 09:05:06 +01:00
Sara Arjona a5d64155ad Merge branch 'MDL-66475-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-19 09:49:29 +02:00
Sara Arjona e511a7fdc4 Merge branch 'MDL-65553-39' of git://github.com/aanabit/moodle into MOODLE_39_STABLE 2021-04-19 08:53:51 +02:00
AMOS bot 767c610be1 Automatically generated installer lang files 2021-04-18 00:07:44 +00:00
Eloy Lafuente (stronk7) c0f4d9e170 MDL-71365 grunt: fix ignores missing LF @ EOF 2021-04-18 00:42:52 +02:00
Eloy Lafuente (stronk7) e4c7028c20 MDL-71364 behat: fix randomness causes by "now" advancing
Some recent tests do set a date time element
to ##now## or tomorrow and, immediately after that
the look if, effectively, ##now## and #tomorrow#
have been set (with minutes resolution).

Problem is that, between the field is set and the field
is verified, it can happen that the time advances to
next minute (from H:M:59 to H:M+1:00) and then the
assertion fails.

To avoid this, we could have lowered the resolution to be
hours... but that doesn't solve the problem just makes it
to happen less often.

So, instead of that... we are setting the 2 now and tomorrow
cases to be "today noon" and "tomorrow noon" (12:00:00) so
we ensure they won't be ever in the risk of jumping of minute.
2021-04-17 12:34:03 +02:00
Eloy Lafuente (stronk7) 375ec1c034 Merge branch 'MDL-70099-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-17 09:40:45 +02:00
Sara Arjona 1c3b9af49a weekly release 3.9.6+ 2021-04-16 17:03:31 +02:00
Sara Arjona d4d2ef9119 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-04-16 17:03:30 +02:00
Andrew Nicols fdcc9383b1 Merge branch 'MDL-60490-missing_close_div-39' of https://github.com/leonstr/moodle into MOODLE_39_STABLE 2021-04-16 11:55:01 +08:00
Andrew Nicols d1d57dc12d Merge branch 'MDL-69415-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2021-04-16 11:27:42 +08:00
Amaia Anabitarte 27a6bf394d MDL-70412 groups: Improving create_group data generator
Increasing the size of the name for generated groups
to ensure we don't have problems with ordering.
2021-04-15 16:57:23 +02:00
Amaia Anabitarte 5e4aab248f MDL-65553 core_analytics: Don't allow to flag predictions several times
Even if a prediction is hidden from the report once is flagged,
it can be flagged several times if the user visits detailed view via URL.
We remove the checkbox to select a prediction and flag it
once it has already been flagged.
2021-04-15 16:39:09 +02:00
Jake Dallimore c32142cf80 Merge branch 'MDL-71338-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-15 14:43:28 +08:00
Jake Dallimore ea90581cb1 Merge branch 'MDL-71119-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2021-04-15 08:33:03 +08:00
AMOS bot 505366bed8 Automatically generated installer lang files 2021-04-15 00:07:59 +00:00
Paul Holden a6a5130a65 MDL-71338 tool_usertours: correct Content-Type on tour export.
Replace existing code with standard file serving mechanism, in
turn correcting the previously incorrect Content-Type header.
2021-04-14 21:12:03 +01:00
sam marshall a53238a07b MDL-70446 search_solr: File indexing can fail due to multipart upload
Due to Solr bug SOLR-15039, uploading files for indexing can fail if
it uses multipart upload. This changes it to use direct binary upload.

Unfortunately, the direct binary version in PHP curl only supports a
string, so we have to load the file into memory. I added extra code to
restrict the size of files indexed to (memory limit - 100MB), which is
usually 284MB unless configured differently because cron runs under
MEMORY_EXTRA.
2021-04-14 13:19:08 +01:00
Eloy Lafuente (stronk7) e085678bf2 Merge branch 'MDL-70616-39-fix' of https://github.com/izendegi/moodle into MOODLE_39_STABLE 2021-04-14 12:45:31 +02:00
Iñigo Zendegi ad3ac443a9 MDL-70616 gradingform_rubric: Filters not applied to rubric name 2021-04-14 11:48:58 +02:00
Sara Arjona 81da134c2c MDL-71119 core_badges: Add more information to errors
Some errors raised when calling external services were ignored.
Displaying this information helps to debug and find the real reasons
why some action, like connecting to an external backpack, can't be
done.
2021-04-14 11:04:28 +02:00
Sara Arjona dc4a36c3b1 MDL-71119 core_badges: Use basicauth and remove urlencode
Basic authorization header is required to get token. Besides, client
id and secret shouldn't call urlencode.
2021-04-14 11:04:28 +02:00
Sara Arjona 946120eeee MDL-71119 core_badges: Initialise scopes param in backpack-connect.php
The scopes parameter should be passed when creating the OAuth2 badges
client. As it is an optional parameter, when it's empty, it will
be initilised with the supported scopes for the backpack issuer.

It will happen, for instance, when a call is done to oauth2callback.php
because, as defined in RFC6749, OAuth2 authorization response only
supports code and state.
2021-04-14 11:04:28 +02:00
Paul Holden 82d35db47a MDL-70772 mod_forum: check for valid usernode before making active. 2021-04-14 09:20:26 +01:00
Andrew Nicols 83c3d04702 Merge branch 'MDL-71154_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-04-14 12:11:46 +08:00
AMOS bot 16736110d8 Automatically generated installer lang files 2021-04-14 00:07:53 +00:00
Eloy Lafuente (stronk7) 22f1a27aa3 MDL-71154 ci: Prevent upstream branches and tags to be built
Both for travis and GHA:

- master and MOODLE_XXX_STABLE branches
- any vX.Y.Z tag

won't lead to a build anymore.
2021-04-13 16:55:54 +02:00
Eloy Lafuente (stronk7) 30e6bf75dd weekly release 3.9.6+ 2021-04-13 10:26:35 +02:00
Eloy Lafuente (stronk7) 9c4a0b8490 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-04-13 10:26:34 +02:00
Eloy Lafuente (stronk7) da03cf8972 Merge branch 'MDL-71059-39' of git://github.com/abias/moodle into MOODLE_39_STABLE 2021-04-13 00:42:42 +02:00
Tim Hunt 0b3e3d7c54 MDL-71313 repositories: warn if get_instances context is wrong type 2021-04-12 20:32:07 +01:00
Sara Arjona 1b8ced636c Merge branch 'MDL-68716-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-12 17:24:52 +02:00
Sara Arjona 2c73fbfc3d Merge branch 'MDL-71264_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-04-12 16:40:25 +02:00
Sara Arjona 5e3c934691 Merge branch 'MDL-70595-39' of git://github.com/mickhawkins/moodle into MOODLE_39_STABLE 2021-04-12 16:01:49 +02:00
Sara Arjona df3efafbcf Merge branch 'MDL-71107-39' of git://github.com/aanabit/moodle into MOODLE_39_STABLE 2021-04-12 12:41:24 +02:00
Eloy Lafuente (stronk7) e2f2de4885 Merge branch 'MDL-69102-39' of https://github.com/martygilbert/moodle into MOODLE_39_STABLE 2021-04-12 00:02:14 +02:00
Eloy Lafuente (stronk7) 5279159083 MDL-69102 phpunit: Add test to cover ALL cohort criteria
That way we can check that the expectations are
working ok for every database. Previously only the
ANY case was being tested.

Also, convert them to course badges and check, via
review_all_criteria() that the SQL structures returned
by award_criteria_cohort->get_completed_criteria_sql()
doesn't fail and return the expected counters.
2021-04-10 12:37:52 -04:00
Issam Taboubi 8392586599 MDL-71303 core: HTML not escaped in block skip link 2021-04-09 17:34:25 -04:00
AMOS bot 26a0581c1b Automatically generated installer lang files 2021-04-09 00:07:54 +00:00
Eric Merrill 6037a3dde0 MDL-52724 editor_atto: Scrub atto html for invalid ol, ul, and li tags
Try to correct broken ul/ol/li tags, as they have an outsized impact
on course layout. Uses basic regex and loops to track open and closed
tags.

Also adds a deep clean option to the HTML cleaner, that runs less
frequent, more intensive cleanings. This is because normally _cleanHTML
gets called after each keystroke, which could cause problems with
large content on weak systems.

Behat changes are a fix for setting multiline strings in Atto, and
creating a multiline match step.
2021-04-08 15:37:24 -04:00
Eloy Lafuente (stronk7) 471d1a4b6d Merge branch 'MDL-70802-39' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-04-08 18:38:58 +02:00
Víctor Déniz 3db93ec2a2 Merge branch 'MDL-71116-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2021-04-08 01:06:30 +01:00
Amaia Anabitarte ff6ac0b2fd MDL-71107 core_contentbank: Behat test. Authoring when copying a course 2021-04-07 10:03:37 +02:00
Amaia Anabitarte 57d5be04f8 MDL-71107 core_contentbank: Fill content author when copying a course
'usercreated' and 'usermodified' fields can not be always mapped.
We are filling those fields with 'old' users when working on the same
site, or with current user when working on a different instance.
2021-04-07 10:03:37 +02:00
Alex Rowe c9d3c97e74 MDL-70049 assign: count_submissions_need_grading call when can't grade 2021-04-07 08:56:10 +10:00
Eloy Lafuente (stronk7) a772325afc Merge branch 'MDL-70959-39' of git://github.com/junpataleta/moodle into MOODLE_39_STABLE 2021-04-06 22:29:58 +02:00
Eloy Lafuente (stronk7) 4c1c1aa6c6 Merge branch 'MDL-68635-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-06 22:23:50 +02:00
Víctor Déniz 05e79651b6 Merge branch 'MDL-71128-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-06 19:51:32 +01:00
Michael Hawkins a8c569c368 MDL-70595 core: Updated security.txt expiry 2021-04-06 13:14:01 +08:00
AMOS bot 12afd60ba2 Automatically generated installer lang files 2021-04-06 00:08:03 +00:00
Paul Holden c4fb2a2141 MDL-70099 enrol: increase accuracy of current enrolments by date.
By rounding the current time it was possible that the most recently
created user enrolments (e.g. self enrolments) were being excluded.

This would manifest itself in a user being enrolled on a course,
but it not appearing under "My courses" navigation or on their own
Dashboard until the rounded time had caught up with the current
time.
2021-04-05 19:32:07 +01:00
Paul Holden 97d63b6272 MDL-71003 user: fix alignment of autocomplete participant filters. 2021-04-04 23:21:33 +01:00
Paul Holden 39944aee16 MDL-70917 tool_behat: fix profile/replace option comparison.
The `isset` call always returned true for the 'replace' option,
because even if not specified it receives a non-null value. The
`strpos` call now does a strict equality check rather than
greater-than-or-equal (which always returns true).
2021-04-04 23:18:44 +01:00
Paul Holden 3284f1fe7e MDL-70763 core: export preferences for correct user.
Ensure we are using the ID of the given user rather than falling
back to that of the current user during privacy export.
2021-04-04 23:15:51 +01:00
Paul Holden a96ad13616 MDL-70763 quiz_overview: export preferences for correct user. 2021-04-04 23:15:51 +01:00
Paul Holden 3c872b34c6 MDL-70763 gradereport_grader: export preferences for correct user. 2021-04-04 23:15:51 +01:00
Paul Holden 4699142c9b MDL-66475 task: fix random timing failures in logger cleanup test. 2021-04-04 23:12:27 +01:00
AMOS bot 613e7f8a88 Automatically generated installer lang files 2021-04-04 00:08:01 +00:00
Eloy Lafuente (stronk7) b240173b66 MDL-71264 behat: Change date(time) element update order
This includes 2 change to the order date(time) elements are filled,
each one addressing one type of problem, where current order is
problematic and can lead to unexpected dates.

1) Changing date, when current month only has X days and target
   month has more than X days. Example, being 1 April, change
   the date to 31 May.
     This is solved by changing the order of introduction
     from current D => M => Y to Y => M => D.
2) Changing date, when target month only has X days and current
   month has more that X days. Example, being 31 March, change
   the date to 28 Feb.
     This is solved by always setting the D to 1, before the
     Y => M => D sequence commented @ 1) begins.
2021-04-03 18:09:47 +02:00
Eloy Lafuente (stronk7) 74730a2d63 MDL-71264 behat: New feature covering all day/month/year date changes
Because of the order that dates and datetimes are filled by behat
sometimes there are some intermediate results that are impossible
and then the form (javascript) automatically reacts and fixes the
date, ultimate leading to a different date that the one we wanted
to set with Behat.

This is noticeable when switching between months (with some day
being the last day of the month) and the 2 months have a different
number of days. For example April date => March date (or the opposite).

This test covers all the critical changes (day, month and year),
back and forth. All times are Perth/Australia.
2021-04-03 11:00:04 +02:00
Huong Nguyen 0273fc7731 MDL-70947 File upload: Upload protection
Interacts badly with double-submit protection, and not all uploads protected
2021-04-02 15:27:29 +07:00
AMOS bot eecb28b386 Automatically generated installer lang files 2021-04-02 00:07:46 +00:00
Marty Gilbert 88f81cf8d1 MDL-69102 badge: Fixes broken WHERE clause
When buildilng the 'WHERE' clause, the SQL generated
a query that selected any user who was a member of the
**last** group, not all of the groups.

I believe the query has to be re-worked so that it only
returns users who are in ALL of the groups. This can
be done by a GROUP BY and HAVING.
2021-04-01 14:51:27 -04:00
Alison Blomenberg fe177d5dec MDL-62244 Resource: label view redirects to label, not course 2021-04-01 11:53:53 -06:00
Leon Stringer d80644a986 MDL-60490 tool_lp: Missing div close
Mustache template had opening <div> with missing </div>.
2021-04-01 12:17:24 +01:00
AMOS bot bfe2779cea Automatically generated installer lang files 2021-04-01 00:07:48 +00:00
Juan Leyva 39916b12fd MDL-70863 mod_forum: Allow NULL in timecreated 2021-03-31 17:51:20 +02:00
Neill Magill b861c1dec7 MDL-64336 assign: Add missing PHP doc 2021-03-31 08:46:28 +01:00
Neill Magill 808a335c90 MDL-64336 assign: Teachers should be able to see all submissions
Before this change a teacher would be able to see users listed if:

* They have an active enrolment and can submit
* They have an an inactive enrolment for a role that can submit

After this change they will additonally be able to see users listed:

* That have an active enrolment and have submitted
* That have an inactive enrolment and have submitted

This means that if an assignment has it's context frozen all users
that have made some form of submission will still be listed.

It will also apply if the submission capability is removed from a
user.

If a user's enrolment is deleted they will not be listed.

The submission and grading counts have also been updated so
they will reflect the new rules.
2021-03-31 08:46:17 +01:00
Neill Magill 3b55f2847a MDL-64336 assign: Submissions should be visible while frozen
Before this change if a student visited an assignment that is
frozen they would only see the title and description even if
they had made a submission to it.

After the change they will be able to see the status of their
submission and any feedback and grades they have recived.

It will also make the Moodle app recognise that submission
should not happen because the assignment is frozen.

Tests based on ones created by Andrew Nicols
2021-03-31 08:46:06 +01:00
Víctor Déniz a2e4730a35 weekly release 3.9.6+ 2021-03-30 15:37:38 +01:00
Víctor Déniz 7c2b6ed44f Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-03-30 15:37:37 +01:00
Paul Holden 3c4d30bcf4 MDL-65687 message: increase confirmation dialog zindex.
Make sure that confirmation dialogs (such as block/unblock user,
delete conversation) are shown with prominence in the messaging
drawer.
2021-03-30 10:50:57 +01:00
Tomo Tsuyuki c34c6a75df MDL-71136 backup: Fix moodle_exception path. 2021-03-30 10:55:38 +11:00
Paul Holden 0464ae85ca MDL-68635 tool_cohortroles: observe user initial table filter. 2021-03-29 14:12:01 +01:00
Paul Holden 3211454a2a MDL-68716 mod_forum: extra column sorting options in privacy export.
Accounts for extra sort options that were added in bc23cbaf.
2021-03-29 14:05:27 +01:00
Eloy Lafuente (stronk7) 06bebd6820 Merge branch 'MDL-70963-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2021-03-29 12:40:07 +02:00
Andrew Nicols 3f0cc3d712 Merge branch 'MDL-71004_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-03-29 11:54:53 +08:00
AMOS bot f71bfc90b1 Automatically generated installer lang files 2021-03-29 00:07:45 +00:00
AMOS bot ae29d57085 Automatically generated installer lang files 2021-03-28 00:07:43 +00:00
Víctor Déniz a2cf272e00 Merge branch 'MDL-70537-m39' of https://github.com/sammarshallou/moodle into MOODLE_39_STABLE 2021-03-26 20:16:22 +00:00
Sara Arjona 4736877c43 MDL-70963 core_badges: Use expected JSON format for OBv2.1
This patch adds some changes to guarantee that OpenBadges 2.1 (OBv2.1)
will return always the same JSON format that OBv2.0 (because the only
difference between both versions it's the BadgeConnect API).
2021-03-26 09:02:41 +01:00
Shintaro Fujiwara aa6c15c975 MDL-69304 gradeimport_csv: Validate if the user id is numerical. 2021-03-26 04:26:51 +09:00
Víctor Déniz d7d8a654f3 Merge branch 'MDL-71194-39' of git://github.com/NoelDeMartin/moodle into MOODLE_39_STABLE 2021-03-25 15:15:26 +00:00
Noel De Martin 2794943d3c MDL-71194 behat: Fix app tests 2021-03-25 13:50:27 +01:00
Andrew Nicols 8c62673dc5 Merge branch 'MDL-70980-39' of git://github.com/ferranrecio/moodle into MOODLE_39_STABLE 2021-03-25 08:07:54 +08:00
AMOS bot f7a80e3f2b Automatically generated installer lang files 2021-03-25 00:07:53 +00:00
Eloy Lafuente (stronk7) 8f23a60ba8 MDL-71004 git: Ignore moodle-plugin-ci.phar in any directory 2021-03-24 20:10:38 +01:00
Andrew Nicols 2370d0c629 MDL-70802 javascript: Normalise component consistently in templates 2021-03-24 11:18:33 +08:00
Thinh Pham 20c93ebb6f MDL-71087 File picker: Focus lost after 'Create folder' 2021-03-23 10:44:25 +07:00
Andrew Nicols 1720bef450 MDL-69256 tests: Fix random slow test failures in completion cron 2021-03-23 08:08:37 +08:00
Mark Nelson c197d3f14b MDL-71170 customfield_text: use correct error string 2021-03-22 21:57:02 +08:00
Sara Arjona 42934afbed MDL-69415 core_h5p: prepend H5P libraries in autoloader
Core and mod_hvp are using the same namespace for some H5P
libraries. This is causing some random errors.
In order to get the expected behaviour in Moodle core, this patch
prepends H5P libraries in order to guarantee they are loaded first.
Plugins using same libraries will need to use a different namespace
if they overlap and a different version of these libraries should
be used.
2021-03-22 12:41:08 +01:00
Ferran Recio a97de58aa7 MDL-70980 mod_h5pactivity: fix review mode 2021-03-22 10:58:04 +01:00
Sara Arjona 3784dcc912 MDL-71116 core_badges: Backpack URLs with more than 50 chars
Backpack URLs (web and API) can have up to 255. However, the form
for creating/editing them, doesn't allow URLs with more than 50
characters. This patch align limitation to DB value (255).
2021-03-19 15:09:12 +01:00
Jun Pataleta 6bc25f23fd MDL-70959 completion: Fix completion_info::get_data() unit tests
* Fixed inverted $sameuser test data.
* Fixed caching expectation check. Caching only relies on whether the
user accessing the completion data is the same user or not.
* Fixed checking for the caching of other modules. Should have been
checking cm ID and not instance ID.
* Additional test case when whole course parameter is passed as
true, but the requesting user is different from the target user.
2021-03-19 11:52:23 +08:00
Jun Pataleta 42631c3e34 MDL-70959 completion: Fix unit tests for get_data()
The unit tests for completion_info::get_data() does not make a lot of
sense with mocking being incorrectly used and the actual functionality
is not being properly tested. I have rewritten the test to use actual
cm_info instances and data providers for better coverage.
2021-03-19 11:52:23 +08:00
Jun Pataleta 4e75827d72 MDL-70959 completion: Documentation improvements
* Fix typo in $cm parameter's type in PHPDoc
* Improve the comment to better explain the logic why fetching the
completion data for the whole course can only be done when caching is
used.
Even if $wholecourse is set to true, there's no point in fetching the
completion data for all the course modules unless we're caching the
results.
2021-03-19 11:52:23 +08:00
sam marshall 6b06a36646 MDL-70537 Availability: Avoid recursive calls to $cm->name
These recursive calls didn't work in PHP 7.3 and below, but in PHP
7.4 they also cause a fatal error which means if you have invalid
availability data, the whole page might die.
2021-03-18 15:56:55 +00:00
Paul Holden b665e5aa33 MDL-71128 mod_quiz: escape question idnumber on display. 2021-03-16 20:28:50 +00:00
Alexander Bias bab8ea6608 MDL-71059 repository_contentbank: set default returntype
The content bank was designed for making easier to reuse content.
So "Link to the file" should be the default option when using the
contentbank repository, in order to let teachers modify their
content in the content bank and update automatically it everywhere
is used.
2021-03-05 14:20:38 +01:00
2523 changed files with 55525 additions and 29060 deletions
+1 -1
View File
@@ -89,4 +89,4 @@ theme/boost/amd/src/bootstrap/toast.js
theme/boost/amd/src/bootstrap/tooltip.js
theme/boost/amd/src/bootstrap/util.js
theme/boost/amd/src/tether.js
theme/boost/scss/fontawesome/
theme/boost/scss/fontawesome/
+3 -2
View File
@@ -211,7 +211,7 @@
},
// We're using babel transpiling so use their parser
// for linting.
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
// Check AMD with some slightly stricter rules.
rules: {
'no-unused-vars': 'error',
@@ -242,7 +242,8 @@
},
parserOptions: {
'ecmaVersion': 9,
'sourceType': 'module'
'sourceType': 'module',
'requireConfigFile': false,
}
}
]
+26 -11
View File
@@ -1,21 +1,34 @@
name: Core
on: [push]
on:
push:
branches-ignore:
- master
- MOODLE_[0-9]+_STABLE
tags-ignore:
- v[0-9]+.[0-9]+.[0-9]+*
workflow_dispatch:
inputs:
phpunit_extra_options:
description: Additional options to apply to PHPUnit
required: false
default: ''
env:
php: 7.4
jobs:
Grunt:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- name: Checking out code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Configuring node & npm
shell: bash -l {0}
run: nvm install
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Installing node stuff
run: npm install
@@ -47,17 +60,17 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-18.04
- os: ubuntu-22.04
php: 7.2
db: mysqli
- os: ubuntu-18.04
- os: ubuntu-22.04
php: 7.4
db: pgsql
steps:
- name: Setting up DB mysql
if: ${{ matrix.db == 'mysqli' }}
uses: johanmeiring/mysql-action@tmpfs-patch
uses: moodlehq/mysql-action@v1
with:
collation server: utf8mb4_bin
mysql version: 5.7
@@ -65,6 +78,8 @@ jobs:
mysql user: test
mysql password: test
use tmpfs: true
tmpfs size: '1024M'
extra conf: --skip-log-bin
- name: Setting up DB pgsql
if: ${{ matrix.db == 'pgsql' }}
@@ -76,7 +91,7 @@ jobs:
postgresql password: test
- name: Configuring git vars
uses: rlespinasse/github-slug-action@v3.x
uses: rlespinasse/github-slug-action@v4
- name: Setting up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
@@ -85,7 +100,7 @@ jobs:
coverage: none
- name: Checking out code from ${{ env.GITHUB_REF_SLUG }}
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setting up PHPUnit
env:
@@ -100,4 +115,4 @@ jobs:
- name: Running PHPUnit tests
env:
dbtype: ${{ matrix.db }}
run: vendor/bin/phpunit -v
run: vendor/bin/phpunit -v ${{ inputs.phpunit_extra_options }}
+1
View File
@@ -44,3 +44,4 @@ composer.phar
/lib/yuilib/*/*/*-coverage.js
atlassian-ide-plugin.xml
/node_modules/
moodle-plugin-ci.phar
+1 -1
View File
@@ -1 +1 @@
v14.15.0
lts/gallium
+1 -1
View File
@@ -90,4 +90,4 @@ theme/boost/amd/src/bootstrap/toast.js
theme/boost/amd/src/bootstrap/tooltip.js
theme/boost/amd/src/bootstrap/util.js
theme/boost/amd/src/tether.js
theme/boost/scss/fontawesome/
theme/boost/scss/fontawesome/
+12 -4
View File
@@ -10,7 +10,7 @@ language: php
os: linux
dist: xenial
dist: bionic
services:
- mysql
@@ -19,6 +19,12 @@ services:
addons:
postgresql: "9.6"
branches:
except:
- master
- /MOODLE_[0-9]+_STABLE/
- /^v[0-9]+\.[0-9]+\.[0-9]+.*/
jobs:
# Enable fast finish.
# This will fail the build if a single job fails (except those in allow_failures).
@@ -30,7 +36,7 @@ jobs:
- php: 7.2
env: DB=none TASK=CITEST
- php: 7.2
env: DB=none TASK=GRUNT NVM_VERSION='lts/carbon'
env: DB=none TASK=GRUNT NVM_VERSION='lts/gallium'
- if: env(MOODLE_DATABASE) = "pgsql" OR env(MOODLE_DATABASE) = "all" OR env(MOODLE_DATABASE) IS NOT present
php: 7.2
@@ -46,7 +52,7 @@ jobs:
env: DB=none TASK=CITEST
- if: env(MOODLE_PHP) = "all"
php: 7.4
env: DB=none TASK=GRUNT NVM_VERSION='lts/carbon'
env: DB=none TASK=GRUNT NVM_VERSION='lts/gallium'
- if: env(MOODLE_PHP) = "all" AND (env(MOODLE_DATABASE) = "pgsql" OR env(MOODLE_DATABASE) = "all" OR env(MOODLE_DATABASE) IS NOT present)
php: 7.4
@@ -75,7 +81,8 @@ install:
sudo service mysql stop
sudo mv /var/lib/mysql /mnt/ramdisk
sudo ln -s /mnt/ramdisk/mysql /var/lib/mysql
sudo service mysql restart
echo -e "[mysqld]\nskip-log-bin" | sudo tee -a /etc/mysql/my.cnf
sudo service mysql start
fi
- >
if [ "$DB" = 'pgsql' ];
@@ -86,6 +93,7 @@ install:
sudo mv /var/lib/postgresql /mnt/ramdisk
sudo ln -s /mnt/ramdisk/postgresql /var/lib/postgresql
sudo service postgresql start 9.6
sh -c 'until pg_isready -p 5432; do echo "Waiting for the DB to be up..."; sleep 2; done'
fi
- >
if [ "$TASK" = 'PHPUNIT' ];
+128 -51
View File
@@ -142,7 +142,7 @@ module.exports = function(grunt) {
const path = require('path');
const tasks = {};
const async = require('async');
const DOMParser = require('xmldom').DOMParser;
const DOMParser = require('@xmldom/xmldom').DOMParser;
const xpath = require('xpath');
const semver = require('semver');
const watchman = require('fb-watchman');
@@ -229,8 +229,8 @@ module.exports = function(grunt) {
* @return {String} The rewritten destination path.
*/
var babelRename = function(destPath, srcPath) {
destPath = srcPath.replace('src', 'build');
destPath = destPath.replace('.js', '.min.js');
destPath = srcPath.replace(`amd/src`, `amd/build`);
destPath = destPath.replace(/\.js$/, '.min.js');
return destPath;
};
@@ -285,6 +285,71 @@ module.exports = function(grunt) {
return ['**/tests/behat/*.feature'];
};
const babelTransform = require('@babel/core').transform;
const babel = (options = {}) => {
return {
name: 'babel',
transform: (code, id) => {
grunt.log.debug(`Transforming ${id}`);
options.filename = id;
const transformed = babelTransform(code, options);
return {
code: transformed.code,
map: transformed.map
};
}
};
};
// Note: We have to use a rate limit plugin here because rollup runs all tasks asynchronously and in parallel.
// When we kick off a full run, if we kick off a rollup of every file this will fork-bomb the machine.
// To work around this we use a concurrent Promise queue based on the number of available processors.
const rateLimit = () => {
const queue = [];
let queueRunner;
const startQueue = () => {
if (queueRunner) {
return;
}
queueRunner = setTimeout(() => {
const limit = Math.max(1, require('os').cpus().length / 2);
grunt.log.debug(`Starting rollup with queue size of ${limit}`);
runQueue(limit);
}, 100);
};
// The queue runner will run the next `size` items in the queue.
const runQueue = (size = 1) => {
queue.splice(0, size).forEach(resolve => {
resolve();
});
};
return {
name: 'ratelimit',
// The options hook is run in parallel.
// We can return an unresolved Promise which is queued for later resolution.
options: async() => {
return new Promise(resolve => {
queue.push(resolve);
startQueue();
});
},
// When an item in the queue completes, start the next item in the queue.
buildEnd: () => {
runQueue();
},
};
};
const terser = require('rollup-plugin-terser').terser;
// Project configuration.
grunt.initConfig({
eslint: {
@@ -301,55 +366,66 @@ module.exports = function(grunt) {
// Check YUI module source files.
yui: {src: files ? files : yuiSrc},
},
babel: {
options: {
sourceMaps: true,
comments: false,
plugins: [
'transform-es2015-modules-amd-lazy',
'system-import-transformer',
// This plugin modifies the Babel transpiling for "export default"
// so that if it's used then only the exported value is returned
// by the generated AMD module.
//
// It also adds the Moodle plugin name to the AMD module definition
// so that it can be imported as expected in other modules.
path.resolve('babel-plugin-add-module-to-define.js'),
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-syntax-import-meta',
['@babel/plugin-proposal-class-properties', {'loose': false}],
'@babel/plugin-proposal-json-strings'
],
presets: [
['minify', {
// This minification plugin needs to be disabled because it breaks the
// source map generation and causes invalid source maps to be output.
simplify: false,
builtIns: false
}],
['@babel/preset-env', {
targets: {
browsers: [
">0.25%",
"last 2 versions",
"not ie <= 10",
"not op_mini all",
"not Opera > 0",
"not dead"
]
},
modules: false,
useBuiltIns: false
}]
]
},
rollup: {
dist: {
options: {
format: 'esm',
dir: 'output',
sourcemap: true,
treeshake: false,
context: 'window',
plugins: [
rateLimit({initialDelay: 0}),
babel({
sourceMaps: true,
comments: false,
compact: false,
plugins: [
'transform-es2015-modules-amd-lazy',
'system-import-transformer',
// This plugin modifies the Babel transpiling for "export default"
// so that if it's used then only the exported value is returned
// by the generated AMD module.
//
// It also adds the Moodle plugin name to the AMD module definition
// so that it can be imported as expected in other modules.
path.resolve('babel-plugin-add-module-to-define.js'),
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-syntax-import-meta',
['@babel/plugin-proposal-class-properties', {'loose': false}],
'@babel/plugin-proposal-json-strings'
],
presets: [
['@babel/preset-env', {
targets: {
browsers: [
">0.25%",
"last 2 versions",
"not ie <= 10",
"not op_mini all",
"not Opera > 0",
"not dead"
]
},
modules: false,
useBuiltIns: false
}]
]
}),
terser({
// Do not mangle variables.
// Makes debugging easier.
mangle: false,
}),
],
},
files: [{
expand: true,
src: files ? files : amdSrc,
rename: babelRename
}]
}
}],
},
},
sass: {
dist: {
@@ -424,7 +500,7 @@ module.exports = function(grunt) {
'*/**/yui/src/*/meta/',
'*/**/build/',
].concat(thirdPartyPaths);
grunt.file.write('.eslintignore', eslintIgnores.join('\n'));
grunt.file.write('.eslintignore', eslintIgnores.join('\n') + '\n');
// Generate .stylelintignore.
const stylelintIgnores = [
@@ -433,7 +509,7 @@ module.exports = function(grunt) {
'theme/boost/style/moodle.css',
'theme/classic/style/moodle.css',
].concat(thirdPartyPaths);
grunt.file.write('.stylelintignore', stylelintIgnores.join('\n'));
grunt.file.write('.stylelintignore', stylelintIgnores.join('\n') + '\n');
};
/**
@@ -834,7 +910,8 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-stylelint');
grunt.loadNpmTasks('grunt-babel');
grunt.loadNpmTasks('grunt-rollup');
// Rename the grunt-contrib-watch "watch" task because we're going to wrap it.
grunt.renameTask('watch', 'watch-grunt');
@@ -845,7 +922,7 @@ module.exports = function(grunt) {
grunt.registerTask('ignorefiles', 'Generate ignore files for linters', tasks.ignorefiles);
grunt.registerTask('watch', 'Run tasks on file changes', tasks.watch);
grunt.registerTask('yui', ['eslint:yui', 'shifter']);
grunt.registerTask('amd', ['eslint:amd', 'babel']);
grunt.registerTask('amd', ['eslint:amd', 'rollup']);
grunt.registerTask('js', ['amd', 'yui']);
// Register CSS tasks.
+1
View File
@@ -0,0 +1 @@
mod/forum/tests/behat/forum_subscriptions_default.feature
+53 -35
View File
@@ -1,48 +1,66 @@
MOODLE TRADEMARKS POLICY
========================
The word "Moodle" is trademarked in many countries around the world. The word
was originally coined as an acronym: Modular Object-Oriented Dynamic Learning
Environment. The trademark is owned by Martin Dougiamas, Founder and Director
of Moodle.
The Moodle Trademark
--------------------
The law obligates trademark owners to police their marks and prevent the use of
confusingly similar names by third parties. Through this policy wed like to
make it clear how Moodle-related projects, organisations, and people can use
the Moodle trademark. Wed also like to be clear about how use of the word is
restricted when used to promote commercial Moodle services. We do this to
protect the very business model that allows us to continue developing Moodle
for you.
The brand and word "Moodle" has trade mark protection in many countries around
the world. Various Moodle™ trade marks are owned by either Moodle Pty Ltd or
one of its associated entities. The law obligates trade mark owners to police
their trade marks and prevent the use of confusingly similar names by
third parties.
Allowed uses
------------
We have created a more concise and thorough set of Trademark Guidelines
(https://moodle.com/wp-content/uploads/2023/02/Moodle-Trademark-Guidelines-2023-4.pdf)
to help you understand how to comply with Moodle's trade mark requirements.
The Trademark Guidelines will also assist our Moodle Certified Partners and the
community to understand some of the principles that inform Moodle's stance
whenever potential infringement has been detected by us or our community.
The following uses dont require any permission at all:
We need to be clear about use of the word "Moodle" and how we restrict its use
when promoting commercial Moodle™ branded services. The proper use of
trade marks reliably assures consumers about the quality of the associated
products or services and where they have been derived from. Because the
Moodle LMS is made available under the open source GNU General Public License'
that permits you to modify the copyrighted software, the distribution of such
modified software in combination with Moodle trade marks can potentially
mislead others in the community. To be clear, the GNU GPL does not include an
implied right or licence to use Moodle's trade marks.
* Referring to the software or the Moodle project.
* Describing your own Moodle implementation (including within corporate
settings).
We do all this to protect the very business model that allows us to continue
developing various Moodle software solutions for you.
Allowed uses of "Moodle"
------------------------
The following uses don't require any permission at all:
* Referring to the software or the Moodle project as the "Moodle™ software"
or the "Moodle™ project"
* Describing your own implementation of the Moodle™ software platform
(including within corporate settings).
* Describing a Moodle-based community hub.
* Describing some software youve made that integrates with Moodle
(eg a Moodle integration feature on another system).
* Describing certain software you've made that integrates with Moodle
branded software (e.g. a Moodle integration feature on another system).
Restricted uses
---------------
Restricted uses of "Moodle"
---------------------------
The following uses are generally prohibited without explicit and direct
permission being granted to you by Moodle Pty Ltd. We do this to protect the
Moodle project from software and sites which could confuse people. Please
contact us to ask for permission in writing.
Moodle project from software and sites which could confuse people. If in
doubt, reach out for clarification at <trademarks@moodle.com>
* You cant use "Moodle" in the name of your software (including Mobile apps)
* You cant use "Moodle" in your company name
* You cant use "Moodle" in your domain name
* You cant use "Moodle" in advertising-related keywords (such as Adsense)
* You cant use "Moodle" to describe services around Moodle (such as hosting,
training, support, consulting, course creation services, theme development,
customisation, installation, integration and certification). This applies
even if you do not charge for the services. Note that usually only Moodle
Partners have this permission.
For information about the Moodle Partner Certification Mark as well as for how
to contact us, please see <https://moodle.com/trademarks/>.
* You can't use the word "Moodle" or any Moodle logos for commercial purposes
without prior written permission from Moodle HQ.
* You can't use "Moodle" in the name of your software (including Mobile apps).
* You can't use "Moodle" in your company name.
* You can't use "Moodle" in your domain name.
* You can't use "Moodle" in advertising-related keywords (such as Adsense).
* You can't use "Moodle" to describe services around Moodle
(such as hosting, training, support, consulting, course creation services,
theme development, customisation, installation, integration, analytics
and certification) that cause consumers to be confused that you are
associated with Moodle HQ if you are not.
This applies even if you do not charge for the services.
Note that usually only Moodle Partners have this permission.
+138
View File
@@ -0,0 +1,138 @@
<?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/>.
/**
* Fix orphaned calendar events that were broken by MDL-67494.
*
* This script will look for all the calendar events which userids
* where broken by a wrong upgrade step, affecting to Moodle 3.9.5
* and up.
*
* It performs checks to both:
* a) Detect if the site was affected (ran the wrong upgrade step).
* b) Look for orphaned calendar events, categorising them as:
* - standard: site / category / course / group / user events
* - subscription: events created via subscriptions.
* - action: normal action events, created to show common important dates.
* - override: user and group override events, particular, that some activities support.
* - custom: other events, not being any of the above, common or particular.
* By specifying it (--fix) try to recover as many broken events (missing userid) as
* possible. Standard, subscription, action, override events in core are fully supported but
* override or custom events should be fixed by each plugin as far as there isn't any standard
* API (plugin-wise) to launch a rebuild of the calendar events.
*
* @package core
* @copyright 2021 onwards Simey Lameze <simey@moodle.com>
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
require_once(__DIR__ . '/../../config.php');
require_once($CFG->libdir . "/clilib.php");
require_once($CFG->libdir . '/db/upgradelib.php');
// Supported options.
$long = ['fix' => false, 'help' => false];
$short = ['f' => 'fix', 'h' => 'help'];
// CLI options.
[$options, $unrecognized] = cli_get_params($long, $short);
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
if ($options['help']) {
$help = <<<EOT
Fix orphaned calendar events.
This script detects calendar events that have had their
userid lost. By default it will perform various checks
and report them, showing the site status in an easy way.
Also, optionally (--fix), it wil try to recover as many
lost userids as possible from different sources. Note that
this script aims to process well-know events in core,
leaving custom events in 3rd part plugins mostly unmodified
because there isn't any consistent way to regenerate them.
For more details: https://tracker.moodle.org/browse/MDL-71156
Options:
-h, --help Print out this help.
-f, --fix Fix the orphaned calendar events in the DB.
If not specified only check and report problems to STDERR.
Usage:
- Only report: \$ sudo -u www-data /usr/bin/php admin/cli/fix_orphaned_calendar_events.php
- Report and fix: \$ sudo -u www-data /usr/bin/php admin/cli/fix_orphaned_calendar_events.php -f
EOT;
cli_writeln($help);
die;
}
// Check various usual pre-requisites.
if (empty($CFG->version)) {
cli_error('Database is not yet installed.');
}
$admin = get_admin();
if (!$admin) {
cli_error('Error: No admin account was found.');
}
if (moodle_needs_upgrading()) {
cli_error('Moodle upgrade pending, script execution suspended.');
}
// Do everything as admin by default.
\core\session\manager::set_user($admin);
// Report current site status.
cli_heading('Checking the site status');
$needsfix = upgrade_calendar_site_status();
// Report current calendar events status.
cli_heading('Checking the calendar events status');
$info = upgrade_calendar_events_status();
$hasbadevents = $info['total']->bad > 0 || $info['total']->bad != $info['other']->bad;
$needsfix = $needsfix || $hasbadevents;
// If, selected, fix as many calendar events as possible.
if ($options['fix']) {
// If the report has told us that the fix was not needed... ask for confirmation!
if (!$needsfix) {
cli_writeln("This site DOES NOT NEED to run the calendar events fix.");
$input = cli_input('Are you completely sure that you want to run the fix? (y/N)', 'N', ['y', 'Y', 'n', 'N']);
if (strtolower($input) != 'y') {
exit(0);
}
cli_writeln("");
}
cli_heading('Fixing as many as possible calendar events');
upgrade_calendar_events_fix_remaining($info);
// Report current (after fix) calendar events status.
cli_heading('Checking the calendar events status (after fix)');
upgrade_calendar_events_status();
} else if ($needsfix) {
// Fix option was not provided but problem events have been found. Notify the user and provide info how to fix these events.
cli_writeln("This site NEEDS to run the calendar events fix!");
cli_writeln("To fix the calendar events, re-run this script with the --fix option.");
}
+8 -8
View File
@@ -119,7 +119,7 @@ if (!empty($options['collation'])) {
if ($dbcollation->value !== $collation || $dbcharset->value !== $charset) {
// Try to convert the DB.
echo "Converting database to '$collation' for $CFG->wwwroot:\n";
$sql = "ALTER DATABASE $CFG->dbname DEFAULT CHARACTER SET $charset DEFAULT COLLATE = $collation";
$sql = "ALTER DATABASE `$CFG->dbname` DEFAULT CHARACTER SET $charset DEFAULT COLLATE = $collation";
try {
$DB->change_database_structure($sql);
} catch (exception $e) {
@@ -146,7 +146,7 @@ if (!empty($options['collation'])) {
} else {
try {
$DB->change_database_structure("ALTER TABLE $table->name CONVERT TO CHARACTER SET $charset COLLATE $collation");
$DB->change_database_structure("ALTER TABLE `$table->name` CONVERT TO CHARACTER SET $charset COLLATE $collation");
echo "CONVERTED\n";
$converted++;
} catch (ddl_exception $e) {
@@ -163,7 +163,7 @@ if (!empty($options['collation'])) {
}
}
$sql = "SHOW FULL COLUMNS FROM $table->name WHERE collation IS NOT NULL";
$sql = "SHOW FULL COLUMNS FROM `$table->name` WHERE collation IS NOT NULL";
$rs2 = $DB->get_recordset_sql($sql);
foreach ($rs2 as $column) {
$column = (object)array_change_key_case((array)$column, CASE_LOWER);
@@ -181,7 +181,7 @@ if (!empty($options['collation'])) {
$notnull = ($column->null === 'NO') ? 'NOT NULL' : 'NULL';
$default = (!is_null($column->default) and $column->default !== '') ? "DEFAULT '$column->default'" : '';
// primary, unique and inc are not supported for texts
$sql = "ALTER TABLE $table->name
$sql = "ALTER TABLE `$table->name`
MODIFY COLUMN $column->field $column->type
CHARACTER SET $charset
COLLATE $collation $notnull $default";
@@ -192,11 +192,11 @@ if (!empty($options['collation'])) {
$default = !is_null($column->default) ? "DEFAULT '$column->default'" : '';
if ($rowformat != '') {
$sql = "ALTER TABLE $table->name $rowformat";
$sql = "ALTER TABLE `$table->name` $rowformat";
$DB->change_database_structure($sql);
}
$sql = "ALTER TABLE $table->name
$sql = "ALTER TABLE `$table->name`
MODIFY COLUMN $column->field $column->type
CHARACTER SET $charset
COLLATE $collation $notnull $default";
@@ -315,8 +315,8 @@ function mysql_set_row_format($tablename, $charset, $collation, $engine) {
if ($rs->row_format == 'Compact' || $rs->row_format == 'Redundant') {
$rowformat = $DB->get_row_format_sql($engine, $collation);
// Try to convert to compressed format and then try updating the collation again.
$DB->change_database_structure("ALTER TABLE $tablename $rowformat");
$DB->change_database_structure("ALTER TABLE $tablename CONVERT TO CHARACTER SET $charset COLLATE $collation");
$DB->change_database_structure("ALTER TABLE `$tablename` $rowformat");
$DB->change_database_structure("ALTER TABLE `$tablename` CONVERT TO CHARACTER SET $charset COLLATE $collation");
} else {
// Row format may not be the problem. Can not diagnose problem. Send fail reply.
return false;
+2 -2
View File
@@ -158,7 +158,7 @@ if (!empty($options['info'])) {
}
foreach ($fixtables as $table) {
$DB->change_database_structure("ALTER TABLE {$prefix}$table ROW_FORMAT=Compressed");
$DB->change_database_structure("ALTER TABLE `{$prefix}$table` ROW_FORMAT=Compressed");
echo str_pad($prefix . $table, 32, ' ', STR_PAD_RIGHT) . " ... Compressed\n";
}
@@ -189,7 +189,7 @@ if (!empty($options['info'])) {
echo "SET GLOBAL innodb_file_per_table=1;\n";
echo "SET GLOBAL innodb_file_format=Barracuda;\n";
foreach ($fixtables as $table) {
echo "ALTER TABLE {$prefix}$table ROW_FORMAT=Compressed;\n";
echo "ALTER TABLE `{$prefix}$table` ROW_FORMAT=Compressed;\n";
}
echo "\n";
exit(0);
+968 -1
View File
@@ -3163,6 +3163,11 @@
<ON_CHECK message="sixtyfourbitswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_igbinary322_version" level="optional">
<FEEDBACK>
<ON_CHECK message="igbinary322buggyversion" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.10" requires="3.5">
@@ -3345,6 +3350,11 @@
<ON_CHECK message="sixtyfourbitswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_igbinary322_version" level="optional">
<FEEDBACK>
<ON_CHECK message="igbinary322buggyversion" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.11" requires="3.6">
@@ -3361,6 +3371,7 @@
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.3.0" level="required">
<RESTRICT function="restrict_php_version_81" message="unsupportedphpversion81" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -3447,7 +3458,7 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
<PHP_EXTENSION name="sodium" level="required"/>
<PHP_EXTENSION name="sodium" level="optional"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
@@ -3527,6 +3538,962 @@
<ON_CHECK message="sixtyfourbitswarning" />
</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_xmlrpc_usage" level="optional">
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="4.0" requires="3.6">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.2.29" />
<VENDOR name="mysql" version="5.7" />
<VENDOR name="postgres" version="10" />
<VENDOR name="mssql" version="14.0" />
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.3.0" level="required">
<RESTRICT function="restrict_php_version_81" message="unsupportedphpversion81" />
</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="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</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="optional"/>
<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_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="optional">
<FEEDBACK>
<ON_CHECK message="sixtyfourbitswarning" />
</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_CHECKS>
</MOODLE>
<MOODLE version="4.1" requires="3.9">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.4" />
<VENDOR name="mysql" version="5.7" />
<VENDOR name="postgres" version="12" />
<VENDOR name="mssql" version="14.0" />
<VENDOR name="oracle" version="19" />
</DATABASE>
<PHP version="7.4.0" level="required">
<RESTRICT function="restrict_php_version_82" message="unsupportedphpversion82" />
</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="optional"/>
<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_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="optional">
<FEEDBACK>
<ON_CHECK message="sixtyfourbitswarning" />
</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_CHECKS>
</MOODLE>
<MOODLE version="4.2" requires="3.11.8">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.6.7" />
<VENDOR name="mysql" version="8.0" />
<VENDOR name="postgres" version="13" />
<VENDOR name="mssql" version="14.0" />
<VENDOR name="oracle" version="19" />
</DATABASE>
<PHP version="8.0.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_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_CHECKS>
</MOODLE>
<MOODLE version="4.3" requires="3.11.8">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.6.7" />
<VENDOR name="mysql" version="8.0" />
<VENDOR name="postgres" version="13" />
<VENDOR name="mssql" version="14.0" />
<VENDOR name="oracle" version="19" />
</DATABASE>
<PHP version="8.0.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_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_CHECKS>
</MOODLE>
<MOODLE version="4.4" requires="4.1.2">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.6.7" />
<VENDOR name="mysql" version="8.0" />
<VENDOR name="postgres" version="13" />
<VENDOR name="mssql" version="14.0" />
<VENDOR name="oracle" version="19" />
</DATABASE>
<PHP version="8.1.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_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_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+10 -2
View File
@@ -6,7 +6,7 @@ require_once(__DIR__ . '/../../config.php');
require_once($CFG->libdir.'/adminlib.php');
include_once($CFG->dirroot.'/mnet/lib.php');
$sort = optional_param('sort', 'username', PARAM_ALPHA);
$sort = optional_param('sort', 'username', PARAM_ALPHAEXT);
$dir = optional_param('dir', 'ASC', PARAM_ALPHA);
$page = optional_param('page', 0, PARAM_INT);
$perpage = optional_param('perpage', 30, PARAM_INT);
@@ -153,7 +153,15 @@ foreach ($columns as $column) {
$headings[$column] = "<a href=\"?sort=$column&amp;dir=$columndir&amp;\">".$string[$column]."</a>$columnicon";
}
$headings['delete'] = '';
$acl = $DB->get_records('mnet_sso_access_control', null, "$sort $dir", '*'); //, $page * $perpage, $perpage);
$sortorder = get_safe_orderby([
'username' => 'username',
'mnet_host_id' => 'mnet_host_id',
'access' => 'accessctrl',
'default' => 'username',
], $sort, $dir, false);
$acl = $DB->get_records('mnet_sso_access_control', null, $sortorder);
$aclcount = $DB->count_records('mnet_sso_access_control');
if (!$acl) {
+16 -13
View File
@@ -1616,12 +1616,18 @@ class core_admin_renderer extends plugin_renderer_base {
$plugininfo = $pluginman->get_plugins();
$numtotal = $numextension = $numupdatable = 0;
$numtotal = $numextension = $numupdatable = $numinstallable = 0;
foreach ($plugininfo as $type => $plugins) {
foreach ($plugins as $name => $plugin) {
if ($plugin->available_updates()) {
if ($res = $plugin->available_updates()) {
$numupdatable++;
foreach ($res as $updateinfo) {
if ($pluginman->is_remote_plugin_installable($updateinfo->component, $updateinfo->version, $reason, false)) {
$numinstallable++;
break;
}
}
}
if ($plugin->get_status() === core_plugin_manager::PLUGIN_STATUS_MISSING) {
continue;
@@ -1664,16 +1670,13 @@ class core_admin_renderer extends plugin_renderer_base {
$out .= $this->output->heading(get_string('overviewext', 'core_plugin'), 3);
}
if ($numupdatable) {
$installableupdates = $pluginman->filter_installable($pluginman->available_updates());
if ($installableupdates) {
$out .= $this->output->single_button(
new moodle_url($this->page->url, array('installupdatex' => 1)),
get_string('updateavailableinstallall', 'core_admin', count($installableupdates)),
'post',
array('class' => 'singlebutton updateavailableinstallall')
);
}
if ($numinstallable) {
$out .= $this->output->single_button(
new moodle_url($this->page->url, array('installupdatex' => 1)),
get_string('updateavailableinstallall', 'core_admin', $numinstallable),
'post',
array('class' => 'singlebutton updateavailableinstallall')
);
}
$out .= html_writer::div($infoall, 'info info-all').
@@ -1907,7 +1910,7 @@ class core_admin_renderer extends plugin_renderer_base {
'infos'
);
if ($pluginman->is_remote_plugin_installable($updateinfo->component, $updateinfo->version, $reason)) {
if ($pluginman->is_remote_plugin_installable($updateinfo->component, $updateinfo->version, $reason, false)) {
$box .= $this->output->single_button(
new moodle_url($this->page->url, array('installupdate' => $updateinfo->component,
'installupdateversion' => $updateinfo->version)),
+2 -5
View File
@@ -53,11 +53,8 @@ class behat_admin extends behat_base {
}
foreach ($data as $label => $value) {
$this->execute('behat_navigation::i_select_from_flat_navigation_drawer', [get_string('administrationsite')]);
// Search by label.
$this->execute('behat_forms::i_set_the_field_to', [get_string('query', 'admin'), $label]);
$this->execute("behat_forms::press_button", get_string('search', 'admin'));
// Navigate straight to the search results fo rthis label.
$this->execute('behat_general::i_visit', ["/admin/search.php?query=" . urlencode($label)]);
// Admin settings does not use the same DOM structure than other moodle forms
// but we also need to use lib/behat/form_field/* to deal with the different moodle form elements.
+4 -2
View File
@@ -14,6 +14,10 @@ Feature: An administrator can filter user accounts by role, cohort and other pro
And the following "cohorts" exist:
| name | idnumber |
| Cohort 1 | CH1 |
And the following "cohort members" exist:
| user | cohort |
| user2 | CH1 |
| user3 | CH1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
@@ -23,8 +27,6 @@ Feature: An administrator can filter user accounts by role, cohort and other pro
| user2 | C1 | student |
| user3 | C1 | student |
And I log in as "admin"
And I add "User Two (two@example.com)" user to "CH1" cohort members
And I add "User Three (three@example.com)" user to "CH1" cohort members
And I navigate to "Users > Accounts > Browse list of users" in site administration
Scenario: Filter user accounts by role and cohort
+12 -2
View File
@@ -1,2 +1,12 @@
define ("tool_analytics/log_info",["jquery","core/str","core/modal_factory","core/notification"],function(a,b,c,d){return{loadInfo:function loadInfo(e,f){var g=a("[data-model-log-id=\""+e+"\"]");b.get_string("loginfo","tool_analytics").then(function(b){var d=a("<ul>");f.forEach(function(a){d.append("<li>"+a+"</li>")});d.append("</ul>");return c.create({title:b,body:d.html(),large:!0},g)}).catch(d.exception)}}});
//# sourceMappingURL=log_info.min.js.map
/**
* Shows a dialogue with info about this logs.
*
* @module tool_analytics/log_info
* @class log_info
* @package tool_analytics
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_analytics/log_info",["jquery","core/str","core/modal_factory","core/notification"],(function($,str,ModalFactory,Notification){return{loadInfo:function(id,info){var link=$('[data-model-log-id="'+id+'"]');str.get_string("loginfo","tool_analytics").then((function(langString){var bodyInfo=$("<ul>");return info.forEach((function(item){bodyInfo.append("<li>"+item+"</li>")})),bodyInfo.append("</ul>"),ModalFactory.create({title:langString,body:bodyInfo.html(),large:!0},link)})).catch(Notification.exception)}}}));
//# sourceMappingURL=log_info.min.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/log_info.js"],"names":["define","$","str","ModalFactory","Notification","loadInfo","id","info","link","get_string","then","langString","bodyInfo","forEach","item","append","create","title","body","html","large","catch","exception"],"mappings":"AAwBAA,OAAM,2BAAC,CAAC,QAAD,CAAW,UAAX,CAAuB,oBAAvB,CAA6C,mBAA7C,CAAD,CAAoE,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAA+BC,CAA/B,CAA6C,CAEnH,MAAoD,CAShDC,QAAQ,CAAE,kBAASC,CAAT,CAAaC,CAAb,CAAmB,CAEzB,GAAIC,CAAAA,CAAI,CAAGP,CAAC,CAAC,wBAAyBK,CAAzB,CAA8B,KAA/B,CAAZ,CACAJ,CAAG,CAACO,UAAJ,CAAe,SAAf,CAA0B,gBAA1B,EAA4CC,IAA5C,CAAiD,SAASC,CAAT,CAAqB,CAElE,GAAIC,CAAAA,CAAQ,CAAGX,CAAC,CAAC,MAAD,CAAhB,CACAM,CAAI,CAACM,OAAL,CAAa,SAASC,CAAT,CAAe,CACxBF,CAAQ,CAACG,MAAT,CAAgB,OAASD,CAAT,CAAgB,OAAhC,CACH,CAFD,EAGAF,CAAQ,CAACG,MAAT,CAAgB,OAAhB,EAEA,MAAOZ,CAAAA,CAAY,CAACa,MAAb,CAAoB,CACvBC,KAAK,CAAEN,CADgB,CAEvBO,IAAI,CAAEN,CAAQ,CAACO,IAAT,EAFiB,CAGvBC,KAAK,GAHkB,CAApB,CAIJZ,CAJI,CAMV,CAdD,EAcGa,KAdH,CAcSjB,CAAY,CAACkB,SAdtB,CAeH,CA3B+C,CA6BvD,CA/BK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Shows a dialogue with info about this logs.\n *\n * @module tool_analytics/log_info\n * @class log_info\n * @package tool_analytics\n * @copyright 2017 David Monllao {@link http://www.davidmonllao.com}\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/str', 'core/modal_factory', 'core/notification'], function($, str, ModalFactory, Notification) {\n\n return /** @alias module:tool_analytics/log_info */ {\n\n /**\n * Prepares a modal info for a log's results.\n *\n * @method loadInfo\n * @param {int} id\n * @param {string[]} info\n */\n loadInfo: function(id, info) {\n\n var link = $('[data-model-log-id=\"' + id + '\"]');\n str.get_string('loginfo', 'tool_analytics').then(function(langString) {\n\n var bodyInfo = $(\"<ul>\");\n info.forEach(function(item) {\n bodyInfo.append('<li>' + item + '</li>');\n });\n bodyInfo.append(\"</ul>\");\n\n return ModalFactory.create({\n title: langString,\n body: bodyInfo.html(),\n large: true,\n }, link);\n\n }).catch(Notification.exception);\n }\n };\n});\n"],"file":"log_info.min.js"}
{"version":3,"file":"log_info.min.js","sources":["../src/log_info.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Shows a dialogue with info about this logs.\n *\n * @module tool_analytics/log_info\n * @class log_info\n * @package tool_analytics\n * @copyright 2017 David Monllao {@link http://www.davidmonllao.com}\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/str', 'core/modal_factory', 'core/notification'], function($, str, ModalFactory, Notification) {\n\n return /** @alias module:tool_analytics/log_info */ {\n\n /**\n * Prepares a modal info for a log's results.\n *\n * @method loadInfo\n * @param {int} id\n * @param {string[]} info\n */\n loadInfo: function(id, info) {\n\n var link = $('[data-model-log-id=\"' + id + '\"]');\n str.get_string('loginfo', 'tool_analytics').then(function(langString) {\n\n var bodyInfo = $(\"<ul>\");\n info.forEach(function(item) {\n bodyInfo.append('<li>' + item + '</li>');\n });\n bodyInfo.append(\"</ul>\");\n\n return ModalFactory.create({\n title: langString,\n body: bodyInfo.html(),\n large: true,\n }, link);\n\n }).catch(Notification.exception);\n }\n };\n});\n"],"names":["define","$","str","ModalFactory","Notification","loadInfo","id","info","link","get_string","then","langString","bodyInfo","forEach","item","append","create","title","body","html","large","catch","exception"],"mappings":";;;;;;;;;AAwBAA,iCAAO,CAAC,SAAU,WAAY,qBAAsB,sBAAsB,SAASC,EAAGC,IAAKC,aAAcC,oBAEjD,CAShDC,SAAU,SAASC,GAAIC,UAEfC,KAAOP,EAAE,uBAAyBK,GAAK,MAC3CJ,IAAIO,WAAW,UAAW,kBAAkBC,MAAK,SAASC,gBAElDC,SAAWX,EAAE,eACjBM,KAAKM,SAAQ,SAASC,MAClBF,SAASG,OAAO,OAASD,KAAO,YAEpCF,SAASG,OAAO,SAETZ,aAAaa,OAAO,CACvBC,MAAON,WACPO,KAAMN,SAASO,OACfC,OAAO,GACRZ,SAEJa,MAAMjB,aAAakB"}
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_analytics/model",["jquery","core/str","core/log","core/notification","core/modal_factory","core/modal_events","core/templates"],function(b,c,d,e,f,g,h){var i={clear:{title:{key:"clearpredictions",component:"tool_analytics"},body:{key:"clearmodelpredictions",component:"tool_analytics"}},delete:{title:{key:"delete",component:"tool_analytics"},body:{key:"deletemodelconfirmation",component:"tool_analytics"}}},j=function(a){var c=b(a).closest("[data-model-name]");if(c.length){return c.attr("data-model-name")}else{d.error("Unexpected DOM error - unable to obtain the model name");return""}};return{confirmAction:function confirmAction(a,h){b("[data-action-id=\""+a+"\"]").on("click",function(k){k.preventDefault();var l=b(k.currentTarget);if("undefined"==typeof i[h]){d.error("Action \""+h+"\" is not allowed.");return}var a=[i[h].title,i[h].body];a[1].param=j(l);var m=c.get_strings(a),n=f.create({type:f.types.SAVE_CANCEL});b.when(m,n).then(function(a,b){b.setTitle(a[0]);b.setBody(a[1]);b.setSaveButtonText(a[0]);b.getRoot().on(g.save,function(){window.location.href=l.attr("href")});b.show();return b}).fail(e.exception)})},selectEvaluationOptions:function selectEvaluationOptions(a,d){b("[data-action-id=\""+a+"\"]").on("click",function(i){i.preventDefault();var j=b(i.currentTarget),a=b(this).attr("data-timesplitting-methods"),k=c.get_strings([{key:"evaluatemodel",component:"tool_analytics"},{key:"evaluate",component:"tool_analytics"}]),l=f.create({type:f.types.SAVE_CANCEL}),m=h.render("tool_analytics/evaluation_options",{trainedexternally:d,timesplittingmethods:JSON.parse(a)});b.when(k,l).then(function(a,c){c.getRoot().on(g.hidden,c.destroy.bind(c));c.setTitle(a[0]);c.setSaveButtonText(a[1]);c.setBody(m);c.getRoot().on(g.save,function(){var a=b("input[name='evaluationmode']:checked").val();if("trainedmodel"==a){j.attr("href",j.attr("href")+"&mode=trainedmodel")}var c=b("#id-evaluation-timesplitting").val();j.attr("href",j.attr("href")+"&timesplitting="+c);window.location.href=j.attr("href")});c.show();return c}).fail(e.exception)})},selectExportOptions:function selectExportOptions(a,d){b("[data-action-id=\""+a+"\"]").on("click",function(i){i.preventDefault();var j=b(i.currentTarget);if(!d){j.attr("href",j.attr("href")+"&action=exportmodel&includeweights=0");window.location.href=j.attr("href");return}var a=c.get_strings([{key:"export",component:"tool_analytics"}]),k=f.create({type:f.types.SAVE_CANCEL}),l=h.render("tool_analytics/export_options",{});b.when(a,k).then(function(a,c){c.getRoot().on(g.hidden,c.destroy.bind(c));c.setTitle(a[0]);c.setSaveButtonText(a[0]);c.setBody(l);c.getRoot().on(g.save,function(){var a=b("input[name='exportoption']:checked").val();if("exportdata"==a){j.attr("href",j.attr("href")+"&action=exportdata")}else{j.attr("href",j.attr("href")+"&action=exportmodel");if(b("#id-includeweights").is(":checked")){j.attr("href",j.attr("href")+"&includeweights=1")}else{j.attr("href",j.attr("href")+"&includeweights=0")}}window.location.href=j.attr("href")});c.show();return c}).fail(e.exception)})}}});
//# sourceMappingURL=model.min.js.map
/**
* AMD module for model actions confirmation.
*
* @module tool_analytics/model
* @copyright 2017 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_analytics/model",["jquery","core/str","core/log","core/notification","core/modal_factory","core/modal_events","core/templates"],(function($,Str,log,Notification,ModalFactory,ModalEvents,Templates){var actionsList={clear:{title:{key:"clearpredictions",component:"tool_analytics"},body:{key:"clearmodelpredictions",component:"tool_analytics"}},delete:{title:{key:"delete",component:"tool_analytics"},body:{key:"deletemodelconfirmation",component:"tool_analytics"}}};return{confirmAction:function(actionId,actionType){$('[data-action-id="'+actionId+'"]').on("click",(function(ev){ev.preventDefault();var a=$(ev.currentTarget);if(void 0!==actionsList[actionType]){var wrap,reqStrings=[actionsList[actionType].title,actionsList[actionType].body];reqStrings[1].param=(wrap=$(a).closest("[data-model-name]")).length?wrap.attr("data-model-name"):(log.error("Unexpected DOM error - unable to obtain the model name"),"");var stringsPromise=Str.get_strings(reqStrings),modalPromise=ModalFactory.create({type:ModalFactory.types.SAVE_CANCEL});$.when(stringsPromise,modalPromise).then((function(strings,modal){return modal.setTitle(strings[0]),modal.setBody(strings[1]),modal.setSaveButtonText(strings[0]),modal.getRoot().on(ModalEvents.save,(function(){window.location.href=a.attr("href")})),modal.show(),modal})).fail(Notification.exception)}else log.error('Action "'+actionType+'" is not allowed.')}))},selectEvaluationOptions:function(actionId,trainedOnlyExternally){$('[data-action-id="'+actionId+'"]').on("click",(function(ev){ev.preventDefault();var a=$(ev.currentTarget),timeSplittingMethods=$(this).attr("data-timesplitting-methods"),stringsPromise=Str.get_strings([{key:"evaluatemodel",component:"tool_analytics"},{key:"evaluate",component:"tool_analytics"}]),modalPromise=ModalFactory.create({type:ModalFactory.types.SAVE_CANCEL}),bodyPromise=Templates.render("tool_analytics/evaluation_options",{trainedexternally:trainedOnlyExternally,timesplittingmethods:JSON.parse(timeSplittingMethods)});$.when(stringsPromise,modalPromise).then((function(strings,modal){return modal.getRoot().on(ModalEvents.hidden,modal.destroy.bind(modal)),modal.setTitle(strings[0]),modal.setSaveButtonText(strings[1]),modal.setBody(bodyPromise),modal.getRoot().on(ModalEvents.save,(function(){"trainedmodel"==$("input[name='evaluationmode']:checked").val()&&a.attr("href",a.attr("href")+"&mode=trainedmodel");var timeSplittingMethod=$("#id-evaluation-timesplitting").val();a.attr("href",a.attr("href")+"&timesplitting="+timeSplittingMethod),window.location.href=a.attr("href")})),modal.show(),modal})).fail(Notification.exception)}))},selectExportOptions:function(actionId,isTrained){$('[data-action-id="'+actionId+'"]').on("click",(function(ev){ev.preventDefault();var a=$(ev.currentTarget);if(!isTrained)return a.attr("href",a.attr("href")+"&action=exportmodel&includeweights=0"),void(window.location.href=a.attr("href"));var stringsPromise=Str.get_strings([{key:"export",component:"tool_analytics"}]),modalPromise=ModalFactory.create({type:ModalFactory.types.SAVE_CANCEL}),bodyPromise=Templates.render("tool_analytics/export_options",{});$.when(stringsPromise,modalPromise).then((function(strings,modal){return modal.getRoot().on(ModalEvents.hidden,modal.destroy.bind(modal)),modal.setTitle(strings[0]),modal.setSaveButtonText(strings[0]),modal.setBody(bodyPromise),modal.getRoot().on(ModalEvents.save,(function(){"exportdata"==$("input[name='exportoption']:checked").val()?a.attr("href",a.attr("href")+"&action=exportdata"):(a.attr("href",a.attr("href")+"&action=exportmodel"),$("#id-includeweights").is(":checked")?a.attr("href",a.attr("href")+"&includeweights=1"):a.attr("href",a.attr("href")+"&includeweights=0")),window.location.href=a.attr("href")})),modal.show(),modal})).fail(Notification.exception)}))}}}));
//# sourceMappingURL=model.min.js.map
File diff suppressed because one or more lines are too long
+12 -2
View File
@@ -1,2 +1,12 @@
define ("tool_analytics/potential-contexts",["jquery","core/ajax"],function(a,b){return{processResults:function processResults(b,c){var d=[];if(a.isArray(c)){a.each(c,function(a,b){d.push({value:b.id,label:b.name})});return d}else{return c}},transport:function transport(c,d,e,f){var g,h=a(c).attr("modelid")||null;g=b.call([{methodname:"tool_analytics_potential_contexts",args:{query:d,modelid:h}}]);g[0].then(e).fail(f)}}});
//# sourceMappingURL=potential-contexts.min.js.map
/**
* Potential contexts selector module.
*
* @module tool_analytics/potential-contexts
* @class potential-contexts
* @package tool_analytics
* @copyright 2019 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_analytics/potential-contexts",["jquery","core/ajax"],(function($,Ajax){return{processResults:function(selector,results){var contexts=[];return $.isArray(results)?($.each(results,(function(index,context){contexts.push({value:context.id,label:context.name})})),contexts):results},transport:function(selector,query,success,failure){var modelid=$(selector).attr("modelid")||null;Ajax.call([{methodname:"tool_analytics_potential_contexts",args:{query:query,modelid:modelid}}])[0].then(success).fail(failure)}}}));
//# sourceMappingURL=potential-contexts.min.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/potential-contexts.js"],"names":["define","$","Ajax","processResults","selector","results","contexts","isArray","each","index","context","push","value","id","label","name","transport","query","success","failure","promise","modelid","attr","call","methodname","args","then","fail"],"mappings":"AAyBAA,OAAM,qCAAC,CAAC,QAAD,CAAW,WAAX,CAAD,CAA0B,SAASC,CAAT,CAAYC,CAAZ,CAAkB,CAE9C,MAA8D,CAE1DC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIC,CAAAA,CAAQ,CAAG,EAAf,CACA,GAAIL,CAAC,CAACM,OAAF,CAAUF,CAAV,CAAJ,CAAwB,CACpBJ,CAAC,CAACO,IAAF,CAAOH,CAAP,CAAgB,SAASI,CAAT,CAAgBC,CAAhB,CAAyB,CACrCJ,CAAQ,CAACK,IAAT,CAAc,CACVC,KAAK,CAAEF,CAAO,CAACG,EADL,CAEVC,KAAK,CAAEJ,CAAO,CAACK,IAFL,CAAd,CAIH,CALD,EAMA,MAAOT,CAAAA,CAEV,CATD,IASO,CACH,MAAOD,CAAAA,CACV,CACJ,CAhByD,CAkB1DW,SAAS,CAAE,mBAASZ,CAAT,CAAmBa,CAAnB,CAA0BC,CAA1B,CAAmCC,CAAnC,CAA4C,IAC/CC,CAAAA,CAD+C,CAG/CC,CAAO,CAAGpB,CAAC,CAACG,CAAD,CAAD,CAAYkB,IAAZ,CAAiB,SAAjB,GAA+B,IAHM,CAInDF,CAAO,CAAGlB,CAAI,CAACqB,IAAL,CAAU,CAAC,CACjBC,UAAU,CAAE,mCADK,CAEjBC,IAAI,CAAE,CACFR,KAAK,CAAEA,CADL,CAEFI,OAAO,CAAEA,CAFP,CAFW,CAAD,CAAV,CAAV,CAQAD,CAAO,CAAC,CAAD,CAAP,CAAWM,IAAX,CAAgBR,CAAhB,EAAyBS,IAAzB,CAA8BR,CAA9B,CACH,CA/ByD,CAmCjE,CArCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Potential contexts selector module.\n *\n * @module tool_analytics/potential-contexts\n * @class potential-contexts\n * @package tool_analytics\n * @copyright 2019 David Monllao\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax'], function($, Ajax) {\n\n return /** @alias module:tool_analytics/potential-contexts */ {\n\n processResults: function(selector, results) {\n var contexts = [];\n if ($.isArray(results)) {\n $.each(results, function(index, context) {\n contexts.push({\n value: context.id,\n label: context.name\n });\n });\n return contexts;\n\n } else {\n return results;\n }\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n\n let modelid = $(selector).attr('modelid') || null;\n promise = Ajax.call([{\n methodname: 'tool_analytics_potential_contexts',\n args: {\n query: query,\n modelid: modelid\n }\n }]);\n\n promise[0].then(success).fail(failure);\n }\n\n };\n\n});\n"],"file":"potential-contexts.min.js"}
{"version":3,"file":"potential-contexts.min.js","sources":["../src/potential-contexts.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Potential contexts selector module.\n *\n * @module tool_analytics/potential-contexts\n * @class potential-contexts\n * @package tool_analytics\n * @copyright 2019 David Monllao\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax'], function($, Ajax) {\n\n return /** @alias module:tool_analytics/potential-contexts */ {\n\n processResults: function(selector, results) {\n var contexts = [];\n if ($.isArray(results)) {\n $.each(results, function(index, context) {\n contexts.push({\n value: context.id,\n label: context.name\n });\n });\n return contexts;\n\n } else {\n return results;\n }\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n\n let modelid = $(selector).attr('modelid') || null;\n promise = Ajax.call([{\n methodname: 'tool_analytics_potential_contexts',\n args: {\n query: query,\n modelid: modelid\n }\n }]);\n\n promise[0].then(success).fail(failure);\n }\n\n };\n\n});\n"],"names":["define","$","Ajax","processResults","selector","results","contexts","isArray","each","index","context","push","value","id","label","name","transport","query","success","failure","modelid","attr","call","methodname","args","then","fail"],"mappings":";;;;;;;;;AAyBAA,2CAAO,CAAC,SAAU,cAAc,SAASC,EAAGC,YAEsB,CAE1DC,eAAgB,SAASC,SAAUC,aAC3BC,SAAW,UACXL,EAAEM,QAAQF,UACVJ,EAAEO,KAAKH,SAAS,SAASI,MAAOC,SAC5BJ,SAASK,KAAK,CACVC,MAAOF,QAAQG,GACfC,MAAOJ,QAAQK,UAGhBT,UAGAD,SAIfW,UAAW,SAASZ,SAAUa,MAAOC,QAASC,aAGtCC,QAAUnB,EAAEG,UAAUiB,KAAK,YAAc,KACnCnB,KAAKoB,KAAK,CAAC,CACjBC,WAAY,oCACZC,KAAM,CACFP,MAAOA,MACPG,QAASA,YAIT,GAAGK,KAAKP,SAASQ,KAAKP"}
@@ -32,8 +32,11 @@ Feature: Manage availability conditions
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "activity" exists:
| activity | page |
| course | C1 |
| name | P1 |
And I log in as "admin"
And I am on site homepage
When I navigate to "Plugins > Availability restrictions > Manage restrictions" in site administration
# Check the icon is there (it should be a Hide icon, meaning is currently visible).
@@ -49,8 +52,7 @@ Feature: Manage availability conditions
# OK, toggling works. Set the grade one to Hide and we'll go see if it actually worked.
And I click on "Hide" "icon" in the "Restriction by grade" "table_row"
And I am on "Course 1" course homepage with editing mode on
And I add a "Page" to section "1"
And I am on the "P1" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And "Add restriction..." "dialogue" should be visible
+12
View File
@@ -0,0 +1,12 @@
define("tool_behat/steps",["exports","core/ajax","core/templates","core/pending"],(function(_exports,_ajax,_templates,_pending){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0,_ajax=_interopRequireDefault(_ajax),_templates=_interopRequireDefault(_templates),_pending=_interopRequireDefault(_pending);
/**
* Enhancements for the step definitions page.
*
* @module tool_behat/steps
* @copyright 2022 Catalyst IT EU
* @author Mark Johnson <mark.johnson@catalyst-eu.net>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
var getRequiredFieldsContent=function(entityData){var _entityData$required;return null!==(_entityData$required=entityData.required)&&void 0!==_entityData$required&&_entityData$required.length?_templates.default.renderForPromise("tool_behat/steprequiredfields",{fields:entityData.required}):Promise.resolve({html:"",js:""})};_exports.init=function(){var fn,_ref;document.addEventListener("change",(fn=regeneratorRuntime.mark((function _callee(e){var entityElement,stepElement,pendingPromise,entityData,_yield$getRequiredFie,html,js,stepRequiredFields;return regeneratorRuntime.wrap((function(_context){for(;;)switch(_context.prev=_context.next){case 0:if(entityElement=e.target.closest(".entities"),stepElement=e.target.closest(".stepcontent"),entityElement&&stepElement){_context.next=4;break}return _context.abrupt("return");case 4:return pendingPromise=new _pending.default("tool_behat/steps:change"),_context.next=7,entityType=e.target.value,_ajax.default.call([{methodname:"tool_behat_get_entity_generator",args:{entitytype:entityType}}])[0];case 7:return entityData=_context.sent,_context.next=10,getRequiredFieldsContent(entityData);case 10:if(_yield$getRequiredFie=_context.sent,html=_yield$getRequiredFie.html,js=_yield$getRequiredFie.js,!(stepRequiredFields=stepElement.querySelector(".steprequiredfields"))){_context.next=19;break}return _context.next=17,_templates.default.replaceNode(stepRequiredFields,html,js);case 17:_context.next=21;break;case 19:return _context.next=21,_templates.default.appendNodeContents(stepElement,html,js);case 21:pendingPromise.resolve();case 22:case"end":return _context.stop()}var entityType}),_callee)})),_ref=function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))},function(_x){return _ref.apply(this,arguments)}))}}));
//# sourceMappingURL=steps.min.js.map
@@ -0,0 +1 @@
{"version":3,"file":"steps.min.js","sources":["../src/steps.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\nimport Ajax from 'core/ajax';\nimport Templates from 'core/templates';\nimport PendingJS from 'core/pending';\n\n/**\n * Enhancements for the step definitions page.\n *\n * @module tool_behat/steps\n * @copyright 2022 Catalyst IT EU\n * @author Mark Johnson <mark.johnson@catalyst-eu.net>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * Call the get_entity_generator web service function\n *\n * Takes the name of an entity generator and returns an object containing a list of the required fields.\n *\n * @param {String} entityType\n * @returns {Promise}\n */\nconst getGeneratorEntities = (entityType) => Ajax.call([{\n methodname: 'tool_behat_get_entity_generator',\n args: {entitytype: entityType}\n}])[0];\n\n/**\n * Render HTML for required fields\n *\n * Takes the entity data returned from getGeneratorEntities and renders the HTML to display the required fields.\n *\n * @param {String} entityData\n * @return {Promise}\n */\nconst getRequiredFieldsContent = (entityData) => {\n if (!entityData.required?.length) {\n return Promise.resolve({\n html: '',\n js: ''\n });\n }\n return Templates.renderForPromise('tool_behat/steprequiredfields', {fields: entityData.required});\n};\n\nexport const init = () => {\n // When an entity is selected in the \"the following exist\" step, fetch and display the required fields.\n document.addEventListener('change', async(e) => {\n const entityElement = e.target.closest('.entities');\n const stepElement = e.target.closest('.stepcontent');\n if (!entityElement || !stepElement) {\n return;\n }\n\n const pendingPromise = new PendingJS('tool_behat/steps:change');\n\n const entityData = await getGeneratorEntities(e.target.value);\n const {html, js} = await getRequiredFieldsContent(entityData);\n\n const stepRequiredFields = stepElement.querySelector('.steprequiredfields');\n if (stepRequiredFields) {\n await Templates.replaceNode(stepRequiredFields, html, js);\n } else {\n await Templates.appendNodeContents(stepElement, html, js);\n }\n pendingPromise.resolve();\n });\n};\n"],"names":["getRequiredFieldsContent","entityData","required","_entityData$required","length","Templates","renderForPromise","fields","Promise","resolve","html","js","document","addEventListener","e","entityElement","target","closest","stepElement","pendingPromise","PendingJS","entityType","value","Ajax","call","methodname","args","entitytype","stepRequiredFields","querySelector","replaceNode","appendNodeContents"],"mappings":";;;;;;;;;IAiDMA,yBAA2B,SAACC,yEACzBA,WAAWC,0CAAXC,qBAAqBC,OAMnBC,mBAAUC,iBAAiB,gCAAiC,CAACC,OAAQN,WAAWC,WAL5EM,QAAQC,QAAQ,CACnBC,KAAM,GACNC,GAAI,oBAMI,uBAEhBC,SAASC,iBAAiB,sCAAU,iBAAMC,oNAChCC,cAAgBD,EAAEE,OAAOC,QAAQ,aACjCC,YAAcJ,EAAEE,OAAOC,QAAQ,gBAChCF,eAAkBG,kFAIjBC,eAAiB,IAAIC,iBAAU,2CAhCfC,WAkCwBP,EAAEE,OAAOM,MAlClBC,cAAKC,KAAK,CAAC,CACpDC,WAAY,kCACZC,KAAM,CAACC,WAAYN,eACnB,iBA+BUpB,0CACmBD,yBAAyBC,2DAA3CS,2BAAAA,KAAMC,yBAAAA,KAEPiB,mBAAqBV,YAAYW,cAAc,wEAE3CxB,mBAAUyB,YAAYF,mBAAoBlB,KAAMC,mEAEhDN,mBAAU0B,mBAAmBb,YAAaR,KAAMC,YAE1DQ,eAAeV,mDA3CM,IAACY"}
+82
View File
@@ -0,0 +1,82 @@
// 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/>.
import Ajax from 'core/ajax';
import Templates from 'core/templates';
import PendingJS from 'core/pending';
/**
* Enhancements for the step definitions page.
*
* @module tool_behat/steps
* @copyright 2022 Catalyst IT EU
* @author Mark Johnson <mark.johnson@catalyst-eu.net>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Call the get_entity_generator web service function
*
* Takes the name of an entity generator and returns an object containing a list of the required fields.
*
* @param {String} entityType
* @returns {Promise}
*/
const getGeneratorEntities = (entityType) => Ajax.call([{
methodname: 'tool_behat_get_entity_generator',
args: {entitytype: entityType}
}])[0];
/**
* Render HTML for required fields
*
* Takes the entity data returned from getGeneratorEntities and renders the HTML to display the required fields.
*
* @param {String} entityData
* @return {Promise}
*/
const getRequiredFieldsContent = (entityData) => {
if (!entityData.required?.length) {
return Promise.resolve({
html: '',
js: ''
});
}
return Templates.renderForPromise('tool_behat/steprequiredfields', {fields: entityData.required});
};
export const init = () => {
// When an entity is selected in the "the following exist" step, fetch and display the required fields.
document.addEventListener('change', async(e) => {
const entityElement = e.target.closest('.entities');
const stepElement = e.target.closest('.stepcontent');
if (!entityElement || !stepElement) {
return;
}
const pendingPromise = new PendingJS('tool_behat/steps:change');
const entityData = await getGeneratorEntities(e.target.value);
const {html, js} = await getRequiredFieldsContent(entityData);
const stepRequiredFields = stepElement.querySelector('.steprequiredfields');
if (stepRequiredFields) {
await Templates.replaceNode(stepRequiredFields, html, js);
} else {
await Templates.appendNodeContents(stepElement, html, js);
}
pendingPromise.resolve();
});
};
@@ -0,0 +1,92 @@
<?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/>.
/**
* Return data about an entity generator.
*
* @package tool_behat
* @copyright 2022 onwards Catalyst IT EU {@link https://catalyst-eu.net}
* @author Mark Johnson <mark.johnson@catalyst-eu.net>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_behat\external;
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir . '/externallib.php');
/**
* External function for getting properties of entity generators.
*/
class get_entity_generator extends \external_api {
/**
* Define parameters for external function.
*
* The parameter is either in the format 'entity' or 'component_name > entity'. There is no appropriate param type for a
* string like this containing angle brackets, so we will do PARAM_RAW. The value will be parsed by
* behat_data_generators::parse_entity_type, which validates the format of the parameter and throws an exception if it is not
* correct.
*
* @return \external_function_parameters
*/
public static function execute_parameters(): \external_function_parameters {
return new \external_function_parameters([
'entitytype' => new \external_value(PARAM_RAW, 'Entity type that can be created by a generator.'),
]);
}
/**
* Return a list of the required fields for a given entity type.
*
* @param string $entitytype
* @return array
*/
public static function execute(string $entitytype): array {
global $CFG;
// Ensure we can load Behat and Facebook namespaces in behat libraries.
require_once("{$CFG->dirroot}/vendor/autoload.php");
require_once("{$CFG->libdir}/tests/behat/behat_data_generators.php");
$params = self::validate_parameters(self::execute_parameters(), ['entitytype' => $entitytype]);
$context = \context_system::instance();
self::validate_context($context);
require_capability('moodle/site:config', $context);
$generators = new \behat_data_generators();
$entity = $generators->get_entity($params['entitytype']);
return ['required' => $entity['required']];
}
/**
* Define return values.
*
* Return required fields
*
* @return \external_single_structure
*/
public static function execute_returns(): \external_single_structure {
return new \external_single_structure([
'required' => new \external_multiple_structure(
new \external_value(PARAM_TEXT, 'Required field'),
'Required fields',
VALUE_OPTIONAL
),
]);
}
}
+5 -4
View File
@@ -45,7 +45,7 @@ list($options, $unrecognised) = cli_get_params(
array(
'stop-on-failure' => 0,
'verbose' => false,
'replace' => false,
'replace' => '',
'help' => false,
'tags' => '',
'profile' => '',
@@ -70,7 +70,7 @@ $help = "
Behat utilities to run behat tests in parallel
Usage:
php run.php [--BEHAT_OPTION=\"value\"] [--feature=\"value\"] [--replace] [--fromrun=value --torun=value] [--help]
php run.php [--BEHAT_OPTION=\"value\"] [--feature=\"value\"] [--replace=\"{run}\"] [--fromrun=value --torun=value] [--help]
Options:
--BEHAT_OPTION Any combination of behat option specified in http://behat.readthedocs.org/en/v2.5/guides/6.cli.html
@@ -144,9 +144,10 @@ $extraopts = $unrecognised;
if ($options['profile']) {
$profile = $options['profile'];
// If profile passed is not set, then exit.
// If profile passed is not set, then exit (note we skip if the 'replace' option is found within the 'profile' value).
if (!isset($CFG->behat_config[$profile]) && !isset($CFG->behat_profiles[$profile]) &&
!(isset($options['replace']) && (strpos($options['profile'], $options['replace']) >= 0 ))) {
!($options['replace'] && (strpos($profile, (string) $options['replace']) !== false))) {
echo "Invalid profile passed: " . $profile . PHP_EOL;
exit(1);
}
+37
View File
@@ -0,0 +1,37 @@
<?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/>.
/**
* Define web service functions for tool_behat
*
* @package tool_behat
* @copyright 2022 onwards Catalyst IT EU {@link https://catalyst-eu.net}
* @author Mark Johnson <mark.johnson@catalyst-eu.net>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$functions = [
'tool_behat_get_entity_generator' => [
'classname' => 'tool_behat\\external\\get_entity_generator',
'methodname' => 'execute',
'description' => 'Get the generator details for an entity',
'type' => 'read',
'ajax' => true,
'capabilities' => 'moodle/site:config'
]
];
+1
View File
@@ -56,6 +56,7 @@ if ($components) {
$form = new steps_definitions_form(null, array('components' => $componentswithsteps));
// Output contents.
$PAGE->requires->js_call_amd('tool_behat/steps', 'init');
$renderer = $PAGE->get_renderer('tool_behat');
echo $renderer->render_stepsdefinitions($steps, $form);
+28
View File
@@ -24,6 +24,8 @@
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir . '/behat/classes/behat_generator_base.php');
/**
* Renderer for behat tool web features
*
@@ -106,6 +108,32 @@ class tool_behat_renderer extends plugin_renderer_base {
},
$stepsdefinitions
);
$elementstrings = [];
$count = 1;
$stepsdefinitions = preg_replace_callback('/(the following ")ELEMENT\d?_STRING(" exist:)/',
function($matches) use (&$elementstrings, &$count) {
// Replace element type arguments with a user-friendly select.
if (empty($elementstrings)) {
$behatgenerators = new behat_data_generators();
$componententities = $behatgenerators->get_all_entities();
ksort($componententities);
$elementstrings = [];
foreach ($componententities as $component => $entities) {
asort($entities);
foreach ($entities as $entity) {
$string = ($component === 'core') ? $entity : $component . ' > ' . $entity;
$elementstrings[$string] = $string;
}
}
}
$select = html_writer::select($elementstrings, 'entities' . $count, '', ['' => 'choosedots'],
['class' => 'entities']);
$count++;
return $matches[1] . $select . $matches[2];
},
$stepsdefinitions
);
}
// Steps definitions.
+6
View File
@@ -29,3 +29,9 @@
#page-admin-tool-behat-index .steps-definitions .stepregex {
color: #060;
}
#page-admin-tool-behat-index .steprequiredfields {
font-weight: bold;
font-size: 1em;
margin-top: 1em;
}
@@ -0,0 +1,33 @@
{{!
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 <http://www.gnu.org/licenses/>.
}}
{{!
@template tool_behat/steprequiredfields
Display a Gherkin-style table row showing required columns for a step.
Example context (json):
{
"fields": [
"user",
"role",
"context"
]
}
}}
<pre class="steprequiredfields">
|{{#fields}} {{{.}}} |{{/fields}}
</pre>
@@ -105,8 +105,7 @@ Feature: Set up contextual data for tests
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
When I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as student1
Then I should see "Topic 1"
Scenario: Add role assigns
@@ -140,17 +139,11 @@ Feature: Set up contextual data for tests
When I log in as "user1"
And I am on site homepage
Then "Edit settings" "link" should exist in current page administration
And I log out
And I log in as "user2"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as user2
And "Turn editing on" "button" should exist
And I log out
And I log in as "user3"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as user3
And "Turn editing on" "button" should exist
And I log out
And I log in as "user4"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as user4
And "Turn editing on" "button" should exist
And I log out
And I log in as "user5"
@@ -192,8 +185,7 @@ Feature: Set up contextual data for tests
And the following "activities" exist:
| activity | name | intro | course | idnumber | grade |
| assign | Test assignment name with scale | Test assignment description | C1 | assign1 | Test Scale 1 |
When I log in as "admin"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as admin
Then I should see "Test assignment name"
# Assignment 2.2 module type is disabled by default
# And I should see "Test assignment22 name"
@@ -311,9 +303,7 @@ Feature: Set up contextual data for tests
And the following "grade categories" exist:
| fullname | course | gradecategory |
| Grade sub category 2 | C1 | Grade category 1 |
When I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
When I am on the "Course 1" "grades > Grader report > View" page logged in as "admin"
Then I should see "Grade category 1"
And I should see "Grade sub category 2"
@@ -334,9 +324,7 @@ Feature: Set up contextual data for tests
| itemname | course | gradecategory |
| Test Grade Item 2 | C1 | Grade category 1 |
| Test Grade Item 3 | C1 | Grade sub category 2 |
When I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
When I am on the "Course 1" "grades > gradebook setup" page logged in as "admin"
Then I should see "Test Grade Item 1"
And I follow "Edit Test Grade Item 1"
And I expand all fieldsets
@@ -362,9 +350,7 @@ Feature: Set up contextual data for tests
And the following "scales" exist:
| name | scale |
| Test Scale 1 | Disappointing, Good, Very good, Excellent |
When I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "Scales" in the course gradebook
When I am on the "Course 1" "grades > scales" page logged in as admin
Then I should see "Test Scale 1"
And I should see "Disappointing, Good, Very good, Excellent"
@@ -383,9 +369,7 @@ Feature: Set up contextual data for tests
| Grade outcome 2 | OT2 | C1 | Test Scale 1 |
And the following config values are set as admin:
| enableoutcomes | 1 |
When I log in as "admin"
And I am on "Course 1" course homepage
And I follow "Outcomes"
When I am on the "Course 1" "grades > outcomes" page logged in as admin
Then I should see "Grade outcome 1" in the "#addoutcomes" "css_element"
And I should see "Grade outcome 2" in the "#removeoutcomes" "css_element"
And I follow "Edit outcomes"
@@ -21,12 +21,15 @@ Feature: Edit capabilities
Scenario: Default system capabilities modification
Given I log in as "admin"
And I set the following system permissions of "Teacher" role:
And I navigate to "Users > Permissions > Define roles" in site administration
And I click on "Edit Teacher role" "link"
And I fill the capabilities form with the following permissions:
| capability | permission |
| block/mnet_hosts:myaddinstance | Allow |
| moodle/site:messageanyuser | Inherit |
| moodle/grade:managesharedforms | Prevent |
| moodle/course:request | Prohibit |
And I press "Save changes"
When I follow "Edit Teacher role"
Then "block/mnet_hosts:myaddinstance" capability has "Allow" permission
And "moodle/site:messageanyuser" capability has "Not set" permission
@@ -48,12 +51,12 @@ Feature: Edit capabilities
And "mod/forum:addquestion" capability has "Allow" permission
Scenario: Module capabilities overrides
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | I'm the name |
| Description | I'm the introduction |
And I follow "I'm the name"
Given the following "activity" exists:
| activity | forum |
| course | C1 |
| idnumber | 00001 |
| name | I'm the name |
And I am on the "I'm the name" "forum activity" page logged in as teacher1
And I navigate to "Permissions" in current page administration
And I override the system permissions of "Student" role with:
| mod/forum:deleteanypost | Prohibit |
@@ -30,10 +30,9 @@ Feature: Verify that all form fields values can be get and set
| student2 | G2 |
| student3 | G2 |
And the following "activities" exist:
| activity | course | idnumber | name | intro | firstpagetitle | wikimode | visible |
| wiki | C1 | wiki1 | Test this one | Test this one | Test this one | collaborative | 0 |
And I log in as "admin"
And I am on "Course 1" course homepage
| activity | course | idnumber | name | firstpagetitle | wikimode | visible |
| wiki | C1 | wiki1 | Test this one | Test this one | collaborative | 0 |
And I am on the "Course 1" course page logged in as admin
And I navigate to "Reset" in current page administration
# Select (multi-select) - Checking "the select box should contain".
And I expand all fieldsets
@@ -48,7 +47,7 @@ Feature: Verify that all form fields values can be get and set
And the "Unenrol users" select box should not contain "Baker"
And the "Unenrol users" select box should not contain "President, Baker"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I press "Create page"
# Text (textarea & editor) & Select (multi-select) - Checking "I set the following fields to these values".
When I set the following fields to these values:
@@ -61,18 +60,14 @@ Feature: Verify that all form fields values can be get and set
# Checkbox - Checking "I set the field" and "The field matches value" ticked.
And I set the field "Force format" to "1"
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test this one" "wiki activity editing" page
And I expand all fieldsets
And the field "Force format" matches value "1"
And the field "Force format" does not match value ""
# Checkbox - Checking "I set the field" and "The field matches value" unticked.
And I set the field "Force format" to ""
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test this one" "wiki activity editing" page
And I expand all fieldsets
And the field "Force format" matches value ""
And the field "Force format" does not match value "1"
@@ -80,9 +75,7 @@ Feature: Verify that all form fields values can be get and set
And I set the following fields to these values:
| Force format | 1 |
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test this one" "wiki activity editing" page
And I expand all fieldsets
And the following fields match these values:
| Force format | 1 |
@@ -92,9 +85,7 @@ Feature: Verify that all form fields values can be get and set
And I set the following fields to these values:
| Force format | |
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test this one" "wiki activity editing" page
And I expand all fieldsets
And the following fields match these values:
| Force format | |
@@ -115,20 +106,21 @@ Feature: Verify that all form fields values can be get and set
| Wiki name | Test this one baby |
| Default format | HTML |
And I press "Cancel"
And I am on "Course 1" course homepage
# Radio - Checking "I set the field" and "the field matches value".
And I add a "Choice" to section "1" and I fill the form with:
| Choice name | Test choice name |
| Description | Test choice description |
| Allow choice to be updated | Yes |
| Option 1 | one |
| Option 2 | two |
| Option 3 | three |
And I follow "Test choice name"
And I set the field "one" to "1"
And the following "activity" exists:
| activity | choice |
| course | C1 |
| idnumber | choice1 |
| intro | Test choice description |
| name | Test choice name |
| option | Option 1, Option 2, Option 3 |
| section | 1 |
| allowupdate | 1 |
And I am on the "Test choice name" "choice activity" page
And I set the field "Option 1" to "1"
And I press "Save my choice"
And the field "one" matches value "1"
And the field "two" matches value ""
And the field "Option 1" matches value "1"
And the field "Option 2" matches value ""
# Check if field xpath set/match works.
And I am on "Course 1" course homepage
And I navigate to "Edit settings" in current page administration
@@ -139,12 +131,13 @@ Feature: Verify that all form fields values can be get and set
And I navigate to "Edit settings" in current page administration
And the field "Course ID number" matches value "Course id number"
Scenario: with JS disabled all form fields getters and setters works as expected
@javascript
Scenario: with JS enabled all form fields getters and setters works as expected
Then I am on "Course 1" course homepage
And I navigate to "Users > Groups" in current page administration
Given the following "activities" exist:
| activity | course | name |
| lesson | C1 | Test lesson |
When I am on "Course 1" course homepage
Then I navigate to "Users > Groups" in current page administration
# Select (multi-select & AJAX) - Checking "I set the field" and "select box should contain".
And I set the field "groups" to "Group 2"
And the "members" select box should contain "Student 2 (s2@example.com)"
@@ -155,11 +148,8 @@ Feature: Verify that all form fields values can be get and set
And the "members" select box should contain "Student 2 (s2@example.com)"
And the "members" select box should not contain "Student 3 (s3@example.com)"
# Checkbox (AJAX) - Checking "I set the field" and "I set the following fields to these values".
And I am on "Course 1" course homepage
And I add a "Lesson" to section "1"
And I am on the "Test lesson" "lesson activity editing" page
And I set the following fields to these values:
| Name | Test lesson |
| Description | Test lesson description |
| available[enabled] | 1 |
And I set the field "deadline[enabled]" to "1"
# Checkbox (AJAX) - Checking "the field matches value" before saving.
@@ -174,31 +164,23 @@ Feature: Verify that all form fields values can be get and set
And I press "Cancel"
# Advanced checkbox requires real browser to allow uncheck to work. MDL-58681. MDL-55386.
# Advanced checkbox - Checking "I set the field" and "The field matches value" ticked.
And I am on "Course 1" course homepage
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And I set the field "Display description on course page" to "1"
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the field "Display description on course page" matches value "1"
And the field "Display description on course page" does not match value ""
# Advanced checkbox - Checking "I set the field" and "The field matches value" unticked.
And I set the field "Display description on course page" to ""
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the field "Display description on course page" matches value ""
And the field "Display description on course page" does not match value "1"
# Advanced checkbox - Checking "I set the following fields to these values:" and "The following fields match these values" ticked.
And I set the following fields to these values:
| Display description on course page | 1 |
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the following fields match these values:
| Display description on course page | 1 |
And the following fields do not match these values:
@@ -207,9 +189,7 @@ Feature: Verify that all form fields values can be get and set
And I set the following fields to these values:
| Display description on course page | |
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the following fields match these values:
| Display description on course page | |
And the following fields do not match these values:
@@ -7,8 +7,8 @@ Feature: Behat steps for interacting with form work
@javascript
Scenario: Test fields in containers
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
| fullname | shortname | summary | summaryformat |
| Course 1 | C1 | Red | 1 |
When I log in as "admin"
And I am on "Course 1" course homepage
# Just get to any form.
@@ -17,11 +17,15 @@ Feature: Behat steps for interacting with form work
And I set the following fields in the "Appearance" "fieldset" to these values:
| Show activity reports | Yes |
| Number of announcements | 1 |
And I set the following fields in the "Description" "fieldset" to these values:
| Course summary | Green |
Then the field "Show activity reports" in the "Appearance" "fieldset" matches value "Yes"
And the field "Show activity reports" in the "Appearance" "fieldset" does not match value "No"
And the following fields in the "region-main" "region" match these values:
| Course full name | Frog |
| Number of announcements | 1 |
| Course summary | Green |
And the following fields in the "region-main" "region" do not match these values:
| Course full name | Course 1 |
| Number of announcements | 5 |
| Course summary | Red |
@@ -0,0 +1,85 @@
@tool @tool_behat
Feature: Use core page resolvers for the I am on the page steps
In order to write tests correctly
As a developer
I need to have steps which take me straight to a page
Scenario Outline: When I am on an instance
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "course" exists:
| fullname | Economics 101 |
| shortname | ECON101 |
| idnumber | 2021-econ101 |
And the following "activity" exists:
| course | ECON101 |
| activity | forum |
| name | Fundamentals of Economics |
| idnumber | fundamentalsofeconomics |
And I log in as "admin"
When I am on the <identifier> <type> page
Then I should see "<shouldsee>"
Examples:
| description | identifier | type | shouldsee |
| Course Category idnumber | CAT1 | category | Add a new course |
| Course Category name | "Cat 1" | Category | Add a new course |
| Course Full name | "Economics 101" | course | Fundamentals of Economics |
| Course Short name | ECON101 | COURSE | Fundamentals of Economics |
| Course idnumber | "2021-econ101" | Course | Fundamentals of Economics |
| Forum idnumber | fundamentalsofeconomics | Activity | Add a new discussion |
| Generic activity editing | fundamentalsofeconomics | "Activity editing" | Updating: Forum |
| Forum name | "Fundamentals of Economics" | "Forum activity" | Add a new discussion |
| Forum name editing | "Fundamentals of Economics" | "Forum activity editing" | Updating: Forum |
| Forum name permissions | "Fundamentals of Economics" | "Forum activity permissions" | Permissions in Forum: Fun |
| Forum name roles | "Fundamentals of Economics" | "Forum activity roles" | Assign roles in Forum: Fun |
Scenario Outline: When I am on an instance logged in as
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "course" exists:
| fullname | Economics 101 |
| shortname | ECON101 |
| idnumber | 2021-econ101 |
And the following "activity" exists:
| course | ECON101 |
| activity | forum |
| name | Fundamentals of Economics |
| idnumber | fundamentalsofeconomics |
When I am on the <identifier> <type> page logged in as admin
Then I should see "<shouldsee>"
Examples:
| description | identifier | type | shouldsee |
| Course Category idnumber | CAT1 | category | Add a new course |
| Course Category name | "Cat 1" | Category | Add a new course |
| Course Full name | "Economics 101" | course | Fundamentals of Economics |
| Course Short name | ECON101 | COURSE | Fundamentals of Economics |
| Course idnumber | "2021-econ101" | Course | Fundamentals of Economics |
| Forum idnumber | fundamentalsofeconomics | Activity | Add a new discussion |
| Generic activity editing | fundamentalsofeconomics | "Activity editing" | Updating: Forum |
| Forum name | "Fundamentals of Economics" | "Forum activity" | Add a new discussion |
| Forum name editing | "Fundamentals of Economics" | "Forum activity editing" | Updating: Forum |
| Forum name permissions | "Fundamentals of Economics" | "Forum activity permissions" | Permissions in Forum: Fun |
| Forum name roles | "Fundamentals of Economics" | "Forum activity roles" | Assign roles in Forum: Fun |
Scenario Outline: When I am on a named page
Given I log in as "admin"
When I am on the <identifier> page
Then I should see "<shouldsee>"
Examples:
| description | identifier | shouldsee |
| Admin page | "Admin notifications" | Check for available updates |
| Home page | Homepage | Recently accessed courses |
Scenario Outline: When I am on a named page logged in as
When I am on the <identifier> page logged in as admin
Then I should see "<shouldsee>"
Examples:
| description | identifier | shouldsee |
| Admin page | "Admin notifications" | Check for available updates |
| Home page | Homepage | Recently accessed courses |
@@ -13,6 +13,10 @@ Feature: List the system steps definitions
Scenario: Accessing the list
Then I should see "Step definitions"
And I should not see "There aren't steps definitions matching this filter"
And I should not see "the following \"ELEMENT_STRING\" exist:"
And "entities1" "select" should exist
And the "entities1" select box should contain "users"
And the "entities1" select box should contain "mod_assign > submissions"
@javascript
Scenario: Filtering by type
@@ -34,3 +38,11 @@ Feature: List the system steps definitions
Then I should not see "There aren't steps definitions matching this filter"
And I should see "Checks the provided element and selector type exists in the current page."
And I should see "Checks that an element and selector type exists in another element and selector type on the current page."
@javascript
Scenario: Get required fields
Given I set the field "entities1" to "users"
And I should see "| username |"
When I set the field "entities1" to "mod_quiz > user overrides"
Then I should not see "| username |"
And I should see "| quiz | user |"
@@ -0,0 +1,110 @@
@tool_behat
Feature: Verify that the behat login and logout steps work as expected
In order to use behat login and log out steps
As a test writer
I need to verify that login and logout happen when the steps are used
Scenario: Log in as a user using the step
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
When I log in as "traverst1"
Then I should see "Thomas Travers"
@javascript
Scenario: Log in as a user using the step (javascript)
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
When I log in as "traverst1"
Then I should see "Thomas Travers"
Scenario: Log out using the log out step
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
And I am logged in as traverst1
When I log out
Then I should not see "Thomas Travers"
And I should see "You are not logged in"
@javascript
Scenario: Log out using the log out step (javascript)
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
And I am logged in as traverst1
When I log out
Then I should not see "Thomas Travers"
And I should see "You are not logged in"
Scenario: Log in step should automatically log user out if already logged in
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
| emeryj | Jane | Emery |
And I am logged in as traverst1
When I log in as "emeryj"
Then I should not see "Thomas Travers"
And I should see "Jane Emery"
@javascript
Scenario: Log in step should automatically log user out if already logged in (javascript)
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
| emeryj | Jane | Emery |
And I am logged in as traverst1
When I log in as "emeryj"
Then I should not see "Thomas Travers"
And I should see "Jane Emery"
Scenario: I am on page logged in as should redirect to correct page
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
And the following "course" exists:
| fullname | Life, the Universe, and Everything |
| shortname | hhgttg |
When I am on the hhgttg Course page logged in as traverst1
Then I should see "Thomas Travers"
And I should see "Life, the Universe, and Everything"
@javascript
Scenario: I am on page logged in as should redirect to correct page (javascript)
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
And the following "course" exists:
| fullname | Life, the Universe, and Everything |
| shortname | hhgttg |
When I am on the hhgttg Course page logged in as traverst1
Then I should see "Thomas Travers"
And I should see "Life, the Universe, and Everything"
Scenario: I am on page logged in as should redirect to correct page when automatically logging a user out
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
| emeryj | Jane | Emery |
And the following "course" exists:
| fullname | Life, the Universe, and Everything |
| shortname | hhgttg |
And I am logged in as emeryj
When I am on the hhgttg Course page logged in as traverst1
Then I should see "Thomas Travers"
And I should see "Life, the Universe, and Everything"
@javascript
Scenario: I am on page logged in as should redirect to correct page when automatically logging a user out (javacript)
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
| emeryj | Jane | Emery |
And the following "course" exists:
| fullname | Life, the Universe, and Everything |
| shortname | hhgttg |
And I am logged in as emeryj
When I am on the hhgttg Course page logged in as traverst1
Then I should see "Thomas Travers"
And I should see "Life, the Universe, and Everything"
@@ -20,9 +20,10 @@ Feature: Forms manipulation
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Quiz" to section "1"
And the following "activities" exist:
| activity | course | section | name |
| quiz | C1 | 1 | Quiz 1 |
And I am on the "Quiz 1" "quiz activity editing" page logged in as admin
When I expand all fieldsets
Then I should see "Close the quiz"
And I should see "Group mode"
@@ -0,0 +1,104 @@
<?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/>.
/**
* Unit tests for get_entity_generator web service
*
* @package tool_behat
* @copyright 2022 onwards Catalyst IT EU {@link https://catalyst-eu.net}
* @author Mark Johnson <mark.johnson@catalyst-eu.net>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_behat\external;
/**
* Tests for get_entity_generator web service
*
* @covers \tool_behat\external\get_entity_generator
*/
class get_entity_generator_test extends \advanced_testcase {
/**
* Log in as admin
*
* @return void
*/
public function setUp(): void {
$this->resetAfterTest();
$this->setAdminUser();
}
/**
* Get the generator for a core entity.
*
* @return void
*/
public function test_execute_core_entity(): void {
$generator = get_entity_generator::execute('users');
$this->assertEquals(['required' => ['username']], $generator);
}
/**
* Get the generator for the plugin entity.
*
* @return void
*/
public function test_execute_plugin_entity(): void {
$generator = get_entity_generator::execute('mod_book > chapters');
$this->assertEquals(['required' => ['book', 'title', 'content']], $generator);
}
/**
* Get the generator for an entity with no required fields.
*
* @return void
*/
public function test_execute_no_requried(): void {
$generator = get_entity_generator::execute('mod_forum > posts');
$this->assertEquals(['required' => []], $generator);
}
/**
* Attempt to get the generator for a core entity that does not exist.
*
* @return void
*/
public function test_execute_invalid_entity(): void {
$this->expectException('coding_exception');
get_entity_generator::execute('foo');
}
/**
* Attempt to get a generator form a plugin that does not exist.
*
* @return void
*/
public function test_execute_invalid_plugin(): void {
$this->expectException('coding_exception');
get_entity_generator::execute('foo > bar');
}
/**
* Attempt to get a generator for an entity that does not exist, from a plugin that does.
*
* @return void
*/
public function test_execute_invalid_plugin_entity(): void {
$this->expectException('coding_exception');
get_entity_generator::execute('mod_book > bar');
}
}
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2020061500; // The current plugin version (Date: YYYYMMDDXX)
$plugin->version = 2020061501; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2020060900; // Requires this Moodle version
$plugin->component = 'tool_behat'; // Full name of the plugin (used for diagnostics)
@@ -1 +1 @@
YUI.add("moodle-tool_capability-search",function(i,t){var e=function(){e.superclass.constructor.apply(this,arguments)};e.prototype={form:null,select:null,selectoptions:{},input:null,button:null,lastsearch:null,initializer:function(){this.form=i.one("#capability-overview-form"),this.select=this.form.one("select[data-search=capability]"),this.select.setStyle("minWidth",this.select.get("offsetWidth")),this.select.get("options").each(function(t){var e=t.get("value");this.selectoptions[e]=t},this),this.button=this.form.all("input[type=submit]"),this.lastsearch=this.form.one("input[name=search]");var t=i.Node.create('<div id="capabilitysearchui" data-fieldtype="text"></div>'),e=i.Node.create('<label for="capabilitysearch">'+this.get("strsearch")+"</label>");this.input=i.Node.create('<input type="text" id="capabilitysearch" />'),t.append(e).append(this.input),this.select.insert(t,"before"),this.input.on("keyup",this.typed,this),this.select.on("change",this.validate,this),this.lastsearch&&(this.input.set("value",this.lastsearch.get("value")),this.typed(),this.select.one("option[selected]")&&this.select.set("scrollTop",this.select.one("option[selected]").get("getX"))),this.validate()},validate:function(){this.button.set("disabled",""===this.select.get("value"))},typed:function(){var t,e=this.input.get("value"),i=0,s=null;for(t in this.lastsearch&&this.lastsearch.set("value",e),this.select.all("option").remove(),this.selectoptions)0<=t.indexOf(e)&&(i++,s=this.selectoptions[t],this.select.append(this.selectoptions[t]));0===i?this.input.addClass("error"):(this.input.removeClass("error"),1===i&&s.set("selected",!0)),this.validate()}},i.extend(e,i.Base,e.prototype,{NAME:"tool_capability-search",ATTRS:{strsearch:{}}}),M.tool_capability=M.tool_capability||{},M.tool_capability.init_capability_search=function(t){new e(t)}},"@VERSION@",{requires:["base","node"]});
YUI.add("moodle-tool_capability-search",function(i,t){var e=function(){e.superclass.constructor.apply(this,arguments)};i.extend(e,i.Base,e.prototype={form:null,select:null,selectoptions:{},input:null,button:null,lastsearch:null,initializer:function(){this.form=i.one("#capability-overview-form"),this.select=this.form.one("select[data-search=capability]"),this.select.setStyle("minWidth",this.select.get("offsetWidth")),this.select.get("options").each(function(t){var e=t.get("value");this.selectoptions[e]=t},this),this.button=this.form.all("input[type=submit]"),this.lastsearch=this.form.one("input[name=search]");var t=i.Node.create('<div id="capabilitysearchui" data-fieldtype="text"></div>'),e=i.Node.create('<label for="capabilitysearch">'+this.get("strsearch")+"</label>");this.input=i.Node.create('<input type="text" id="capabilitysearch" />'),t.append(e).append(this.input),this.select.insert(t,"before"),this.input.on("keyup",this.typed,this),this.select.on("change",this.validate,this),this.lastsearch&&(this.input.set("value",this.lastsearch.get("value")),this.typed(),this.select.one("option[selected]")&&this.select.set("scrollTop",this.select.one("option[selected]").get("getX"))),this.validate()},validate:function(){this.button.set("disabled",""===this.select.get("value"))},typed:function(){var t,e=this.input.get("value"),i=0,s=null;for(t in this.lastsearch&&this.lastsearch.set("value",e),this.select.all("option").remove(),this.selectoptions)0<=t.indexOf(e)&&(i++,s=this.selectoptions[t],this.select.append(this.selectoptions[t]));0===i?this.input.addClass("error"):(this.input.removeClass("error"),1===i&&s.set("selected",!0)),this.validate()}},{NAME:"tool_capability-search",ATTRS:{strsearch:{}}}),M.tool_capability=M.tool_capability||{},M.tool_capability.init_capability_search=function(t){new e(t)}},"@VERSION@",{requires:["base","node"]});
@@ -189,7 +189,12 @@ class cohort_role_assignments_table extends table_sql {
FROM {tool_cohortroles} uca
JOIN {user} u ON u.id = uca.userid
JOIN {cohort} c ON c.id = uca.cohortid";
$params = array();
// Check if any additional filtering is required.
[$sqlwhere, $params] = $this->get_sql_where();
if ($sqlwhere) {
$sql .= " WHERE {$sqlwhere}";
}
// Add order by if needed.
if (!$count && $sqlsort = $this->get_sql_sort()) {
+2 -2
View File
@@ -86,8 +86,8 @@ if ($removeid) {
$title = get_string('existingcohortroles', 'tool_cohortroles');
echo $output->heading($title);
$url = new moodle_url('/admin/tool/cohortroles/index.php');
$table = new tool_cohortroles\output\cohort_role_assignments_table(uniqid(), $url);
$table = new tool_cohortroles\output\cohort_role_assignments_table('cohort-role-assignments', $pageurl);
echo $table->out(50, true);
echo $output->spacer();
+15 -2
View File
@@ -36,7 +36,7 @@ class tool_customlang_utils {
* Rough number of strings that are being processed during a full checkout.
* This is used to estimate the progress of the checkout.
*/
const ROUGH_NUMBER_OF_STRINGS = 16500;
const ROUGH_NUMBER_OF_STRINGS = 30000;
/** @var array cache of {@link self::list_components()} results */
private static $components = null;
@@ -91,9 +91,22 @@ class tool_customlang_utils {
public static function checkout($lang, progress_bar $progressbar = null) {
global $DB;
// For behat executions we are going to load only a few components in the
// language customisation structures. Using the whole "en" langpack is
// too much slow (leads to Selenium 30s timeouts, especially on slow
// environments) and we don't really need the whole thing for tests. So,
// apart from escaping from the timeouts, we are also saving some good minutes
// in tests. See MDL-70014 and linked issues for more info.
$behatneeded = ['core', 'core_langconfig', 'tool_customlang'];
// make sure that all components are registered
$current = $DB->get_records('tool_customlang_components', null, 'name', 'name,version,id');
foreach (self::list_components() as $component) {
// Filter out unwanted components when running behat.
if (defined('BEHAT_SITE_RUNNING') && !in_array($component, $behatneeded)) {
continue;
}
if (empty($current[$component])) {
$record = new stdclass();
$record->name = $component;
@@ -103,7 +116,7 @@ class tool_customlang_utils {
$record->version = $version;
}
$DB->insert_record('tool_customlang_components', $record);
} elseif ($version = get_component_version($component)) {
} else if ($version = get_component_version($component)) {
if (is_null($current[$component]->version) or ($version > $current[$component]->version)) {
$DB->set_field('tool_customlang_components', 'version', $version, array('id' => $current[$component]->id));
}
+11 -2
View File
@@ -1,2 +1,11 @@
define ("tool_dataprivacy/add_category",["jquery","core/str","core/ajax","core/notification","core/modal_factory","core/modal_events","core/fragment"],function(a,b,c,d,e,f,g){var h={CATEGORY_LINK:"[data-add-element=\"category\"]"},i=function(a){this.contextId=a;this.strings=b.get_strings([{key:"addcategory",component:"tool_dataprivacy"},{key:"save",component:"admin"}]);this.registerEventListeners()};i.prototype.contextId=0;i.prototype.strings=0;i.prototype.registerEventListeners=function(){var b=a(h.CATEGORY_LINK);b.on("click",function(){return this.strings.then(function(a){e.create({type:e.types.SAVE_CANCEL,title:a[0],body:""},b).done(function(b){this.setupFormModal(b,a[1])}.bind(this))}.bind(this)).fail(d.exception)}.bind(this))};i.prototype.getBody=function(a){var b=null;if("undefined"!=typeof a){b={jsonformdata:JSON.stringify(a)}}return g.loadFragment("tool_dataprivacy","addcategory_form",this.contextId,b)};i.prototype.setupFormModal=function(a,b){a.setLarge();a.setSaveButtonText(b);a.getRoot().on(f.hidden,this.destroy.bind(this));a.setBody(this.getBody());a.getRoot().on(f.save,this.submitForm.bind(this));a.getRoot().on("submit","form",this.submitFormAjax.bind(this));this.modal=a;a.show()};i.prototype.submitForm=function(a){a.preventDefault();this.modal.getRoot().find("form").submit()};i.prototype.submitFormAjax=function(a){a.preventDefault();var b=this.modal.getRoot().find("form").serialize();c.call([{methodname:"tool_dataprivacy_create_category_form",args:{jsonformdata:JSON.stringify(b)},done:function(a){if(a.validationerrors){this.modal.setBody(this.getBody(b))}else{this.close()}}.bind(this),fail:d.exception}])};i.prototype.close=function(){this.destroy();document.location.reload()};i.prototype.destroy=function(){Y.use("moodle-core-formchangechecker",function(){M.core_formchangechecker.reset_form_dirty_state()});this.modal.destroy()};i.prototype.removeListeners=function(){a(h.CATEGORY_LINK).off("click")};return{getInstance:function getInstance(a){return new i(a)}}});
//# sourceMappingURL=add_category.min.js.map
/**
* Module to add categories.
*
* @module tool_dataprivacy/add_category
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/add_category",["jquery","core/str","core/ajax","core/notification","core/modal_factory","core/modal_events","core/fragment"],(function($,Str,Ajax,Notification,ModalFactory,ModalEvents,Fragment){var SELECTORS_CATEGORY_LINK='[data-add-element="category"]',AddCategory=function(contextId){this.contextId=contextId;this.strings=Str.get_strings([{key:"addcategory",component:"tool_dataprivacy"},{key:"save",component:"admin"}]),this.registerEventListeners()};return AddCategory.prototype.contextId=0,AddCategory.prototype.strings=0,AddCategory.prototype.registerEventListeners=function(){var trigger=$(SELECTORS_CATEGORY_LINK);trigger.on("click",function(){return this.strings.then(function(strings){ModalFactory.create({type:ModalFactory.types.SAVE_CANCEL,title:strings[0],body:""},trigger).done(function(modal){this.setupFormModal(modal,strings[1])}.bind(this))}.bind(this)).fail(Notification.exception)}.bind(this))},AddCategory.prototype.getBody=function(formdata){var params=null;return void 0!==formdata&&(params={jsonformdata:JSON.stringify(formdata)}),Fragment.loadFragment("tool_dataprivacy","addcategory_form",this.contextId,params)},AddCategory.prototype.setupFormModal=function(modal,saveText){modal.setLarge(),modal.setSaveButtonText(saveText),modal.getRoot().on(ModalEvents.hidden,this.destroy.bind(this)),modal.setBody(this.getBody()),modal.getRoot().on(ModalEvents.save,this.submitForm.bind(this)),modal.getRoot().on("submit","form",this.submitFormAjax.bind(this)),this.modal=modal,modal.show()},AddCategory.prototype.submitForm=function(e){e.preventDefault(),this.modal.getRoot().find("form").submit()},AddCategory.prototype.submitFormAjax=function(e){e.preventDefault();var formData=this.modal.getRoot().find("form").serialize();Ajax.call([{methodname:"tool_dataprivacy_create_category_form",args:{jsonformdata:JSON.stringify(formData)},done:function(data){data.validationerrors?this.modal.setBody(this.getBody(formData)):this.close()}.bind(this),fail:Notification.exception}])},AddCategory.prototype.close=function(){this.destroy(),document.location.reload()},AddCategory.prototype.destroy=function(){Y.use("moodle-core-formchangechecker",(function(){M.core_formchangechecker.reset_form_dirty_state()})),this.modal.destroy()},AddCategory.prototype.removeListeners=function(){$(SELECTORS_CATEGORY_LINK).off("click")},{getInstance:function(contextId){return new AddCategory(contextId)}}}));
//# sourceMappingURL=add_category.min.js.map
File diff suppressed because one or more lines are too long
+11 -2
View File
@@ -1,2 +1,11 @@
define ("tool_dataprivacy/add_purpose",["jquery","core/str","core/ajax","core/notification","core/modal_factory","core/modal_events","core/fragment"],function(a,b,c,d,e,f,g){var h={PURPOSE_LINK:"[data-add-element=\"purpose\"]"},i=function(a){this.contextId=a;this.strings=b.get_strings([{key:"addpurpose",component:"tool_dataprivacy"},{key:"save",component:"admin"}]);this.registerEventListeners()};i.prototype.contextId=0;i.prototype.strings=0;i.prototype.registerEventListeners=function(){var b=a(h.PURPOSE_LINK);b.on("click",function(){return this.strings.then(function(a){e.create({type:e.types.SAVE_CANCEL,title:a[0],body:""},b).done(function(b){this.setupFormModal(b,a[1])}.bind(this))}.bind(this)).fail(d.exception)}.bind(this))};i.prototype.getBody=function(a){var b=null;if("undefined"!=typeof a){b={jsonformdata:JSON.stringify(a)}}return g.loadFragment("tool_dataprivacy","addpurpose_form",this.contextId,b)};i.prototype.setupFormModal=function(a,b){a.setLarge();a.setSaveButtonText(b);a.getRoot().on(f.hidden,this.destroy.bind(this));a.setBody(this.getBody());a.getRoot().on(f.save,this.submitForm.bind(this));a.getRoot().on("submit","form",this.submitFormAjax.bind(this));this.modal=a;a.show()};i.prototype.submitForm=function(a){a.preventDefault();this.modal.getRoot().find("form").submit()};i.prototype.submitFormAjax=function(a){a.preventDefault();var b=this.modal.getRoot().find("form").serialize();c.call([{methodname:"tool_dataprivacy_create_purpose_form",args:{jsonformdata:JSON.stringify(b)},done:function(a){if(a.validationerrors){this.modal.setBody(this.getBody(b))}else{this.close()}}.bind(this),fail:d.exception}])};i.prototype.close=function(){this.destroy();document.location.reload()};i.prototype.destroy=function(){Y.use("moodle-core-formchangechecker",function(){M.core_formchangechecker.reset_form_dirty_state()});this.modal.destroy()};i.prototype.removeListeners=function(){a(h.PURPOSE_LINK).off("click")};return{getInstance:function getInstance(a){return new i(a)}}});
//# sourceMappingURL=add_purpose.min.js.map
/**
* Module to add purposes.
*
* @module tool_dataprivacy/add_purpose
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/add_purpose",["jquery","core/str","core/ajax","core/notification","core/modal_factory","core/modal_events","core/fragment"],(function($,Str,Ajax,Notification,ModalFactory,ModalEvents,Fragment){var SELECTORS_PURPOSE_LINK='[data-add-element="purpose"]',AddPurpose=function(contextId){this.contextId=contextId;this.strings=Str.get_strings([{key:"addpurpose",component:"tool_dataprivacy"},{key:"save",component:"admin"}]),this.registerEventListeners()};return AddPurpose.prototype.contextId=0,AddPurpose.prototype.strings=0,AddPurpose.prototype.registerEventListeners=function(){var trigger=$(SELECTORS_PURPOSE_LINK);trigger.on("click",function(){return this.strings.then(function(strings){ModalFactory.create({type:ModalFactory.types.SAVE_CANCEL,title:strings[0],body:""},trigger).done(function(modal){this.setupFormModal(modal,strings[1])}.bind(this))}.bind(this)).fail(Notification.exception)}.bind(this))},AddPurpose.prototype.getBody=function(formdata){var params=null;return void 0!==formdata&&(params={jsonformdata:JSON.stringify(formdata)}),Fragment.loadFragment("tool_dataprivacy","addpurpose_form",this.contextId,params)},AddPurpose.prototype.setupFormModal=function(modal,saveText){modal.setLarge(),modal.setSaveButtonText(saveText),modal.getRoot().on(ModalEvents.hidden,this.destroy.bind(this)),modal.setBody(this.getBody()),modal.getRoot().on(ModalEvents.save,this.submitForm.bind(this)),modal.getRoot().on("submit","form",this.submitFormAjax.bind(this)),this.modal=modal,modal.show()},AddPurpose.prototype.submitForm=function(e){e.preventDefault(),this.modal.getRoot().find("form").submit()},AddPurpose.prototype.submitFormAjax=function(e){e.preventDefault();var formData=this.modal.getRoot().find("form").serialize();Ajax.call([{methodname:"tool_dataprivacy_create_purpose_form",args:{jsonformdata:JSON.stringify(formData)},done:function(data){data.validationerrors?this.modal.setBody(this.getBody(formData)):this.close()}.bind(this),fail:Notification.exception}])},AddPurpose.prototype.close=function(){this.destroy(),document.location.reload()},AddPurpose.prototype.destroy=function(){Y.use("moodle-core-formchangechecker",(function(){M.core_formchangechecker.reset_form_dirty_state()})),this.modal.destroy()},AddPurpose.prototype.removeListeners=function(){$(SELECTORS_PURPOSE_LINK).off("click")},{getInstance:function(contextId){return new AddPurpose(contextId)}}}));
//# sourceMappingURL=add_purpose.min.js.map
File diff suppressed because one or more lines are too long
+11 -2
View File
@@ -1,2 +1,11 @@
define ("tool_dataprivacy/categoriesactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){var g={DELETE:"[data-action=\"deletecategory\"]"},h=function(){this.registerEvents()};h.prototype.registerEvents=function(){a(g.DELETE).click(function(g){g.preventDefault();var h=a(this).data("id"),i=a(this).data("name");d.get_strings([{key:"deletecategory",component:"tool_dataprivacy"},{key:"deletecategorytext",component:"tool_dataprivacy",param:i},{key:"delete"}]).then(function(d){var g=d[0],i=d[1],j=d[2];return e.create({title:g,body:i,type:e.types.SAVE_CANCEL}).then(function(d){d.setSaveButtonText(j);d.getRoot().on(f.save,function(){b.call([{methodname:"tool_dataprivacy_delete_category",args:{id:h}}])[0].done(function(b){if(b.result){a("tr[data-categoryid=\""+h+"\"]").remove()}else{c.addNotification({message:b.warnings[0].message,type:"error"})}}).fail(c.exception)});d.getRoot().on(f.hidden,function(){d.destroy()});return d})}).done(function(a){a.show()}).fail(c.exception)})};return{init:function init(){return new h}}});
//# sourceMappingURL=categoriesactions.min.js.map
/**
* AMD module for categories actions.
*
* @module tool_dataprivacy/categoriesactions
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/categoriesactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],(function($,Ajax,Notification,Str,ModalFactory,ModalEvents){var ACTIONS_DELETE='[data-action="deletecategory"]',CategoriesActions=function(){this.registerEvents()};return CategoriesActions.prototype.registerEvents=function(){$(ACTIONS_DELETE).click((function(e){e.preventDefault();var id=$(this).data("id"),stringkeys=[{key:"deletecategory",component:"tool_dataprivacy"},{key:"deletecategorytext",component:"tool_dataprivacy",param:$(this).data("name")},{key:"delete"}];Str.get_strings(stringkeys).then((function(langStrings){var title=langStrings[0],confirmMessage=langStrings[1],buttonText=langStrings[2];return ModalFactory.create({title:title,body:confirmMessage,type:ModalFactory.types.SAVE_CANCEL}).then((function(modal){return modal.setSaveButtonText(buttonText),modal.getRoot().on(ModalEvents.save,(function(){var request={methodname:"tool_dataprivacy_delete_category",args:{id:id}};Ajax.call([request])[0].done((function(data){data.result?$('tr[data-categoryid="'+id+'"]').remove():Notification.addNotification({message:data.warnings[0].message,type:"error"})})).fail(Notification.exception)})),modal.getRoot().on(ModalEvents.hidden,(function(){modal.destroy()})),modal}))})).done((function(modal){modal.show()})).fail(Notification.exception)}))},{init:function(){return new CategoriesActions}}}));
//# sourceMappingURL=categoriesactions.min.js.map
File diff suppressed because one or more lines are too long
+11 -2
View File
@@ -1,2 +1,11 @@
define ("tool_dataprivacy/data_deletion",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){var h={MARK_FOR_DELETION:"[data-action=\"markfordeletion\"]",SELECT_ALL:"[data-action=\"selectall\"]"},i={SELECTCONTEXT:".selectcontext"},j=function(){this.registerEvents()};j.prototype.registerEvents=function(){a(h.MARK_FOR_DELETION).click(function(b){b.preventDefault();var c=[];a(i.SELECTCONTEXT).each(function(){var b=a(this);if(b.is(":checked")){c.push(b.val())}});g(c)});a(h.SELECT_ALL).change(function(b){b.preventDefault();var c=a(this);if(c.is(":checked")){a(i.SELECTCONTEXT).attr("checked","checked")}else{a(i.SELECTCONTEXT).removeAttr("checked")}})};function g(a){var g="";d.get_strings([{key:"confirm",component:"moodle"},{key:"confirmcontextdeletion",component:"tool_dataprivacy"}]).then(function(a){g=a[0];var b=a[1];return e.create({title:g,body:b,type:e.types.SAVE_CANCEL})}).then(function(d){d.setSaveButtonText(g);d.getRoot().on(f.save,function(){b.call([{methodname:"tool_dataprivacy_confirm_contexts_for_deletion",args:{ids:a}}])[0].done(function(a){if(a.result){window.location.reload()}else{c.addNotification({message:a.warnings[0].message,type:"error"})}}).fail(c.exception)});d.getRoot().on(f.hidden,function(){d.destroy()});return d}).done(function(a){a.show()}).fail(c.exception)}return j});
//# sourceMappingURL=data_deletion.min.js.map
/**
* Request actions.
*
* @module tool_dataprivacy/data_deletion
* @package tool_dataprivacy
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/data_deletion",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],(function($,Ajax,Notification,Str,ModalFactory,ModalEvents){var ACTIONS_MARK_FOR_DELETION='[data-action="markfordeletion"]',ACTIONS_SELECT_ALL='[data-action="selectall"]',SELECTORS_SELECTCONTEXT=".selectcontext",DataDeletionActions=function(){this.registerEvents()};return DataDeletionActions.prototype.registerEvents=function(){$(ACTIONS_MARK_FOR_DELETION).click((function(e){e.preventDefault();var ids,keys,wsfunction,modalTitle,selectedIds=[];$(SELECTORS_SELECTCONTEXT).each((function(){var checkbox=$(this);checkbox.is(":checked")&&selectedIds.push(checkbox.val())})),ids=selectedIds,keys=[{key:"confirm",component:"moodle"},{key:"confirmcontextdeletion",component:"tool_dataprivacy"}],wsfunction="tool_dataprivacy_confirm_contexts_for_deletion",modalTitle="",Str.get_strings(keys).then((function(langStrings){modalTitle=langStrings[0];var confirmMessage=langStrings[1];return ModalFactory.create({title:modalTitle,body:confirmMessage,type:ModalFactory.types.SAVE_CANCEL})})).then((function(modal){return modal.setSaveButtonText(modalTitle),modal.getRoot().on(ModalEvents.save,(function(){var request={methodname:wsfunction,args:{ids:ids}};Ajax.call([request])[0].done((function(data){data.result?window.location.reload():Notification.addNotification({message:data.warnings[0].message,type:"error"})})).fail(Notification.exception)})),modal.getRoot().on(ModalEvents.hidden,(function(){modal.destroy()})),modal})).done((function(modal){modal.show()})).fail(Notification.exception)})),$(ACTIONS_SELECT_ALL).change((function(e){e.preventDefault(),$(this).is(":checked")?$(SELECTORS_SELECTCONTEXT).attr("checked","checked"):$(SELECTORS_SELECTCONTEXT).removeAttr("checked")}))},DataDeletionActions}));
//# sourceMappingURL=data_deletion.min.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+11 -2
View File
@@ -1,2 +1,11 @@
define ("tool_dataprivacy/data_request_modal",["jquery","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","tool_dataprivacy/events"],function(a,b,c,d,e,f){var g=!1,h={APPROVE_BUTTON:"[data-action=\"approve\"]",DENY_BUTTON:"[data-action=\"deny\"]",COMPLETE_BUTTON:"[data-action=\"complete\"]"},i=function(a){d.call(this,a)};i.TYPE="tool_dataprivacy-data_request";i.prototype=Object.create(d.prototype);i.prototype.constructor=i;i.prototype.registerEventListeners=function(){d.prototype.registerEventListeners.call(this);this.getModal().on(c.events.activate,h.APPROVE_BUTTON,function(b,c){var d=a.Event(f.approve);this.getRoot().trigger(d,this);if(!d.isDefaultPrevented()){this.hide();c.originalEvent.preventDefault()}}.bind(this));this.getModal().on(c.events.activate,h.DENY_BUTTON,function(b,c){var d=a.Event(f.deny);this.getRoot().trigger(d,this);if(!d.isDefaultPrevented()){this.hide();c.originalEvent.preventDefault()}}.bind(this));this.getModal().on(c.events.activate,h.COMPLETE_BUTTON,function(b,c){var d=a.Event(f.complete);this.getRoot().trigger(d,this);if(!d.isDefaultPrevented()){this.hide();c.originalEvent.preventDefault()}}.bind(this))};if(!g){e.register(i.TYPE,i,"tool_dataprivacy/data_request_modal");g=!0}return i});
//# sourceMappingURL=data_request_modal.min.js.map
/**
* Request actions.
*
* @module tool_dataprivacy/data_request_modal
* @package tool_dataprivacy
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/data_request_modal",["jquery","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","tool_dataprivacy/events"],(function($,Notification,CustomEvents,Modal,ModalRegistry,DataPrivacyEvents){var registered=!1,SELECTORS_APPROVE_BUTTON='[data-action="approve"]',SELECTORS_DENY_BUTTON='[data-action="deny"]',SELECTORS_COMPLETE_BUTTON='[data-action="complete"]',ModalDataRequest=function(root){Modal.call(this,root)};return ModalDataRequest.TYPE="tool_dataprivacy-data_request",(ModalDataRequest.prototype=Object.create(Modal.prototype)).constructor=ModalDataRequest,ModalDataRequest.prototype.registerEventListeners=function(){Modal.prototype.registerEventListeners.call(this),this.getModal().on(CustomEvents.events.activate,SELECTORS_APPROVE_BUTTON,function(e,data){var approveEvent=$.Event(DataPrivacyEvents.approve);this.getRoot().trigger(approveEvent,this),approveEvent.isDefaultPrevented()||(this.hide(),data.originalEvent.preventDefault())}.bind(this)),this.getModal().on(CustomEvents.events.activate,SELECTORS_DENY_BUTTON,function(e,data){var denyEvent=$.Event(DataPrivacyEvents.deny);this.getRoot().trigger(denyEvent,this),denyEvent.isDefaultPrevented()||(this.hide(),data.originalEvent.preventDefault())}.bind(this)),this.getModal().on(CustomEvents.events.activate,SELECTORS_COMPLETE_BUTTON,function(e,data){var completeEvent=$.Event(DataPrivacyEvents.complete);this.getRoot().trigger(completeEvent,this),completeEvent.isDefaultPrevented()||(this.hide(),data.originalEvent.preventDefault())}.bind(this))},registered||(ModalRegistry.register(ModalDataRequest.TYPE,ModalDataRequest,"tool_dataprivacy/data_request_modal"),registered=!0),ModalDataRequest}));
//# sourceMappingURL=data_request_modal.min.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +1,11 @@
define ("tool_dataprivacy/effective_retention_period",["jquery"],function(a){var b={PURPOSE_SELECT:"#id_purposeid",RETENTION_FIELD:"#fitem_id_retention_current [data-fieldtype=static]"},c=function(a){this.purposeRetentionPeriods=a;this.registerEventListeners()},d=function(){a(b.PURPOSE_SELECT).off("change")};c.prototype.purposeRetentionPeriods=[];c.prototype.registerEventListeners=function(){a(b.PURPOSE_SELECT).on("change",function(c){var d=a(c.currentTarget).val(),e=this.purposeRetentionPeriods[d];a(b.RETENTION_FIELD).text(e)}.bind(this))};return{init:function init(a){d();return new c(a)}}});
//# sourceMappingURL=effective_retention_period.min.js.map
/**
* Module to update the displayed retention period.
*
* @module tool_dataprivacy/effective_retention_period
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/effective_retention_period",["jquery"],(function($){var SELECTORS_PURPOSE_SELECT="#id_purposeid",SELECTORS_RETENTION_FIELD="#fitem_id_retention_current [data-fieldtype=static]",EffectiveRetentionPeriod=function(purposeRetentionPeriods){this.purposeRetentionPeriods=purposeRetentionPeriods,this.registerEventListeners()};return EffectiveRetentionPeriod.prototype.purposeRetentionPeriods=[],EffectiveRetentionPeriod.prototype.registerEventListeners=function(){$(SELECTORS_PURPOSE_SELECT).on("change",function(ev){var selected=$(ev.currentTarget).val(),selectedPurpose=this.purposeRetentionPeriods[selected];$(SELECTORS_RETENTION_FIELD).text(selectedPurpose)}.bind(this))},{init:function(purposeRetentionPeriods){return $(SELECTORS_PURPOSE_SELECT).off("change"),new EffectiveRetentionPeriod(purposeRetentionPeriods)}}}));
//# sourceMappingURL=effective_retention_period.min.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/effective_retention_period.js"],"names":["define","$","SELECTORS","PURPOSE_SELECT","RETENTION_FIELD","EffectiveRetentionPeriod","purposeRetentionPeriods","registerEventListeners","removeListeners","off","prototype","on","ev","selected","currentTarget","val","selectedPurpose","text","bind","init"],"mappings":"AAuBAA,OAAM,+CAAC,CAAC,QAAD,CAAD,CACF,SAASC,CAAT,CAAY,IAEJC,CAAAA,CAAS,CAAG,CACZC,cAAc,CAAE,eADJ,CAEZC,eAAe,CAAE,qDAFL,CAFR,CAYJC,CAAwB,CAAG,SAASC,CAAT,CAAkC,CAC7D,KAAKA,uBAAL,CAA+BA,CAA/B,CACA,KAAKC,sBAAL,EACH,CAfO,CAsBJC,CAAe,CAAG,UAAW,CAC7BP,CAAC,CAACC,CAAS,CAACC,cAAX,CAAD,CAA4BM,GAA5B,CAAgC,QAAhC,CACH,CAxBO,CA8BRJ,CAAwB,CAACK,SAAzB,CAAmCJ,uBAAnC,CAA6D,EAA7D,CAOAD,CAAwB,CAACK,SAAzB,CAAmCH,sBAAnC,CAA4D,UAAW,CAEnEN,CAAC,CAACC,CAAS,CAACC,cAAX,CAAD,CAA4BQ,EAA5B,CAA+B,QAA/B,CAAyC,SAASC,CAAT,CAAa,IAC9CC,CAAAA,CAAQ,CAAGZ,CAAC,CAACW,CAAE,CAACE,aAAJ,CAAD,CAAoBC,GAApB,EADmC,CAE9CC,CAAe,CAAG,KAAKV,uBAAL,CAA6BO,CAA7B,CAF4B,CAGlDZ,CAAC,CAACC,CAAS,CAACE,eAAX,CAAD,CAA6Ba,IAA7B,CAAkCD,CAAlC,CACH,CAJwC,CAIvCE,IAJuC,CAIlC,IAJkC,CAAzC,CAKH,CAPD,CASA,MAAwE,CACpEC,IAAI,CAAE,cAASb,CAAT,CAAkC,CAEpCE,CAAe,GACf,MAAO,IAAIH,CAAAA,CAAJ,CAA6BC,CAA7B,CACV,CALmE,CAO3E,CAtDC,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Module to update the displayed retention period.\n *\n * @module tool_dataprivacy/effective_retention_period\n * @package tool_dataprivacy\n * @copyright 2018 David Monllao\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery'],\n function($) {\n\n var SELECTORS = {\n PURPOSE_SELECT: '#id_purposeid',\n RETENTION_FIELD: '#fitem_id_retention_current [data-fieldtype=static]',\n };\n\n /**\n * Constructor for the retention period display.\n *\n * @param {Array} purposeRetentionPeriods Associative array of purposeids with effective retention period at this context\n */\n var EffectiveRetentionPeriod = function(purposeRetentionPeriods) {\n this.purposeRetentionPeriods = purposeRetentionPeriods;\n this.registerEventListeners();\n };\n\n /**\n * Removes the current 'change' listeners.\n *\n * Useful when a new form is loaded.\n */\n var removeListeners = function() {\n $(SELECTORS.PURPOSE_SELECT).off('change');\n };\n\n /**\n * @var {Array} purposeRetentionPeriods\n * @private\n */\n EffectiveRetentionPeriod.prototype.purposeRetentionPeriods = [];\n\n /**\n * Add purpose change listeners.\n *\n * @method registerEventListeners\n */\n EffectiveRetentionPeriod.prototype.registerEventListeners = function() {\n\n $(SELECTORS.PURPOSE_SELECT).on('change', function(ev) {\n var selected = $(ev.currentTarget).val();\n var selectedPurpose = this.purposeRetentionPeriods[selected];\n $(SELECTORS.RETENTION_FIELD).text(selectedPurpose);\n }.bind(this));\n };\n\n return /** @alias module:tool_dataprivacy/effective_retention_period */ {\n init: function(purposeRetentionPeriods) {\n // Remove previously attached listeners.\n removeListeners();\n return new EffectiveRetentionPeriod(purposeRetentionPeriods);\n }\n };\n }\n);\n\n"],"file":"effective_retention_period.min.js"}
{"version":3,"file":"effective_retention_period.min.js","sources":["../src/effective_retention_period.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Module to update the displayed retention period.\n *\n * @module tool_dataprivacy/effective_retention_period\n * @package tool_dataprivacy\n * @copyright 2018 David Monllao\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery'],\n function($) {\n\n var SELECTORS = {\n PURPOSE_SELECT: '#id_purposeid',\n RETENTION_FIELD: '#fitem_id_retention_current [data-fieldtype=static]',\n };\n\n /**\n * Constructor for the retention period display.\n *\n * @param {Array} purposeRetentionPeriods Associative array of purposeids with effective retention period at this context\n */\n var EffectiveRetentionPeriod = function(purposeRetentionPeriods) {\n this.purposeRetentionPeriods = purposeRetentionPeriods;\n this.registerEventListeners();\n };\n\n /**\n * Removes the current 'change' listeners.\n *\n * Useful when a new form is loaded.\n */\n var removeListeners = function() {\n $(SELECTORS.PURPOSE_SELECT).off('change');\n };\n\n /**\n * @var {Array} purposeRetentionPeriods\n * @private\n */\n EffectiveRetentionPeriod.prototype.purposeRetentionPeriods = [];\n\n /**\n * Add purpose change listeners.\n *\n * @method registerEventListeners\n */\n EffectiveRetentionPeriod.prototype.registerEventListeners = function() {\n\n $(SELECTORS.PURPOSE_SELECT).on('change', function(ev) {\n var selected = $(ev.currentTarget).val();\n var selectedPurpose = this.purposeRetentionPeriods[selected];\n $(SELECTORS.RETENTION_FIELD).text(selectedPurpose);\n }.bind(this));\n };\n\n return /** @alias module:tool_dataprivacy/effective_retention_period */ {\n init: function(purposeRetentionPeriods) {\n // Remove previously attached listeners.\n removeListeners();\n return new EffectiveRetentionPeriod(purposeRetentionPeriods);\n }\n };\n }\n);\n\n"],"names":["define","$","SELECTORS","EffectiveRetentionPeriod","purposeRetentionPeriods","registerEventListeners","prototype","on","ev","selected","currentTarget","val","selectedPurpose","this","text","bind","init","off"],"mappings":";;;;;;;;AAuBAA,qDAAO,CAAC,WACJ,SAASC,OAEDC,yBACgB,gBADhBA,0BAEiB,sDAQjBC,yBAA2B,SAASC,8BAC/BA,wBAA0BA,6BAC1BC,iCAgBTF,yBAAyBG,UAAUF,wBAA0B,GAO7DD,yBAAyBG,UAAUD,uBAAyB,WAExDJ,EAAEC,0BAA0BK,GAAG,SAAU,SAASC,QAC1CC,SAAWR,EAAEO,GAAGE,eAAeC,MAC/BC,gBAAkBC,KAAKT,wBAAwBK,UACnDR,EAAEC,2BAA2BY,KAAKF,kBACpCG,KAAKF,QAG6D,CACpEG,KAAM,SAASZ,gCAxBfH,EAAEC,0BAA0Be,IAAI,UA2BrB,IAAId,yBAAyBC"}
+12 -2
View File
@@ -1,2 +1,12 @@
define ("tool_dataprivacy/events",[],function(){return{approve:"tool_dataprivacy-data_request:approve",bulkApprove:"tool_dataprivacy-data_request:bulk_approve",deny:"tool_dataprivacy-data_request:deny",bulkDeny:"tool_dataprivacy-data_request:bulk_deny",complete:"tool_dataprivacy-data_request:complete"}});
//# sourceMappingURL=events.min.js.map
/**
* Contain the events the data privacy tool can fire.
*
* @module tool_dataprivacy/events
* @class events
* @package tool_dataprivacy
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/events",[],(function(){return{approve:"tool_dataprivacy-data_request:approve",bulkApprove:"tool_dataprivacy-data_request:bulk_approve",deny:"tool_dataprivacy-data_request:deny",bulkDeny:"tool_dataprivacy-data_request:bulk_deny",complete:"tool_dataprivacy-data_request:complete"}}));
//# sourceMappingURL=events.min.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/events.js"],"names":["define","approve","bulkApprove","deny","bulkDeny","complete"],"mappings":"AAwBAA,OAAM,2BAAC,EAAD,CAAK,UAAW,CAClB,MAAO,CACHC,OAAO,CAAE,uCADN,CAEHC,WAAW,CAAE,4CAFV,CAGHC,IAAI,CAAE,oCAHH,CAIHC,QAAQ,CAAE,yCAJP,CAKHC,QAAQ,CAAE,wCALP,CAOV,CARK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Contain the events the data privacy tool can fire.\n *\n * @module tool_dataprivacy/events\n * @class events\n * @package tool_dataprivacy\n * @copyright 2018 Jun Pataleta\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([], function() {\n return {\n approve: 'tool_dataprivacy-data_request:approve',\n bulkApprove: 'tool_dataprivacy-data_request:bulk_approve',\n deny: 'tool_dataprivacy-data_request:deny',\n bulkDeny: 'tool_dataprivacy-data_request:bulk_deny',\n complete: 'tool_dataprivacy-data_request:complete'\n };\n});\n"],"file":"events.min.js"}
{"version":3,"file":"events.min.js","sources":["../src/events.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Contain the events the data privacy tool can fire.\n *\n * @module tool_dataprivacy/events\n * @class events\n * @package tool_dataprivacy\n * @copyright 2018 Jun Pataleta\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([], function() {\n return {\n approve: 'tool_dataprivacy-data_request:approve',\n bulkApprove: 'tool_dataprivacy-data_request:bulk_approve',\n deny: 'tool_dataprivacy-data_request:deny',\n bulkDeny: 'tool_dataprivacy-data_request:bulk_deny',\n complete: 'tool_dataprivacy-data_request:complete'\n };\n});\n"],"names":["define","approve","bulkApprove","deny","bulkDeny","complete"],"mappings":";;;;;;;;;AAwBAA,iCAAO,IAAI,iBACA,CACHC,QAAS,wCACTC,YAAa,6CACbC,KAAM,qCACNC,SAAU,0CACVC,SAAU"}
+12 -2
View File
@@ -1,2 +1,12 @@
define ("tool_dataprivacy/expand_contract",["jquery","core/url","core/str"],function(a,b,c){var d=a("<img alt=\"\" src=\""+b.imageUrl("t/expanded")+"\"/>"),e=a("<img alt=\"\" src=\""+b.imageUrl("t/collapsed")+"\"/>"),f={EXPAND:"fa-caret-right",COLLAPSE:"fa-caret-down"};return{expandCollapse:function expandCollapse(a,b){if(a.hasClass("hide")){a.removeClass("hide");a.addClass("visible");a.attr("aria-expanded",!0);b.find(":header i.fa").removeClass(f.EXPAND);b.find(":header i.fa").addClass(f.COLLAPSE);b.find(":header img.icon").attr("src",d.attr("src"))}else{a.removeClass("visible");a.addClass("hide");a.attr("aria-expanded",!1);b.find(":header i.fa").removeClass(f.COLLAPSE);b.find(":header i.fa").addClass(f.EXPAND);b.find(":header img.icon").attr("src",e.attr("src"))}},expandCollapseAll:function expandCollapseAll(b){var g="visible"==b?"hide":"visible",h="visible"==b?!0:!1,i="visible"==b?f.EXPAND:f.COLLAPSE,j="visible"==b?f.COLLAPSE:f.EXPAND,k="visible"==b?d.attr("src"):e.attr("src");a("."+g).each(function(){a(this).removeClass(g);a(this).addClass(b);a(this).attr("aria-expanded",h)});a(".tool_dataprivacy-expand-all").data("visibilityState",g);c.get_string(g,"tool_dataprivacy").then(function(b){a(".tool_dataprivacy-expand-all").html(b)}).catch(Notification.exception);a(":header i.fa").each(function(){a(this).removeClass(i);a(this).addClass(j)});a(":header img.icon").each(function(){a(this).attr("src",k)})}}});
//# sourceMappingURL=expand_contract.min.js.map
/**
* Potential user selector module.
*
* @module tool_dataprivacy/expand_contract
* @class page-expand-contract
* @package tool_dataprivacy
* @copyright 2018 Adrian Greeve
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/expand_contract",["jquery","core/url","core/str"],(function($,url,str){var expandedImage=$('<img alt="" src="'+url.imageUrl("t/expanded")+'"/>'),collapsedImage=$('<img alt="" src="'+url.imageUrl("t/collapsed")+'"/>'),CLASSES_EXPAND="fa-caret-right",CLASSES_COLLAPSE="fa-caret-down";return{expandCollapse:function(targetnode,thisnode){targetnode.hasClass("hide")?(targetnode.removeClass("hide"),targetnode.addClass("visible"),targetnode.attr("aria-expanded",!0),thisnode.find(":header i.fa").removeClass(CLASSES_EXPAND),thisnode.find(":header i.fa").addClass(CLASSES_COLLAPSE),thisnode.find(":header img.icon").attr("src",expandedImage.attr("src"))):(targetnode.removeClass("visible"),targetnode.addClass("hide"),targetnode.attr("aria-expanded",!1),thisnode.find(":header i.fa").removeClass(CLASSES_COLLAPSE),thisnode.find(":header i.fa").addClass(CLASSES_EXPAND),thisnode.find(":header img.icon").attr("src",collapsedImage.attr("src")))},expandCollapseAll:function(nextstate){var currentstate="visible"==nextstate?"hide":"visible",ariaexpandedstate="visible"==nextstate,iconclassnow="visible"==nextstate?CLASSES_EXPAND:CLASSES_COLLAPSE,iconclassnext="visible"==nextstate?CLASSES_COLLAPSE:CLASSES_EXPAND,imagenow="visible"==nextstate?expandedImage.attr("src"):collapsedImage.attr("src");$("."+currentstate).each((function(){$(this).removeClass(currentstate),$(this).addClass(nextstate),$(this).attr("aria-expanded",ariaexpandedstate)})),$(".tool_dataprivacy-expand-all").data("visibilityState",currentstate),str.get_string(currentstate,"tool_dataprivacy").then((function(langString){$(".tool_dataprivacy-expand-all").html(langString)})).catch(Notification.exception),$(":header i.fa").each((function(){$(this).removeClass(iconclassnow),$(this).addClass(iconclassnext)})),$(":header img.icon").each((function(){$(this).attr("src",imagenow)}))}}}));
//# sourceMappingURL=expand_contract.min.js.map
File diff suppressed because one or more lines are too long
+12 -2
View File
@@ -1,2 +1,12 @@
define ("tool_dataprivacy/form-user-selector",["jquery","core/ajax","core/templates"],function(a,b,c){return{processResults:function processResults(b,c){var d=[];a.each(c,function(a,b){d.push({value:b.id,label:b._label})});return d},transport:function transport(d,e,f,g){var h=b.call([{methodname:"tool_dataprivacy_get_users",args:{query:e}}]);h[0].then(function(b){var d=[],e=0;a.each(b,function(a,b){d.push(c.render("tool_dataprivacy/form-user-selector-suggestion",b))});return a.when.apply(a.when,d).then(function(){var c=arguments;a.each(b,function(a,b){b._label=c[e];e++});f(b)})}).fail(g)}}});
//# sourceMappingURL=form-user-selector.min.js.map
/**
* Potential user selector module.
*
* @module tool_dataprivacy/form-user-selector
* @class form-user-selector
* @package tool_dataprivacy
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/form-user-selector",["jquery","core/ajax","core/templates"],(function($,Ajax,Templates){return{processResults:function(selector,results){var users=[];return $.each(results,(function(index,user){users.push({value:user.id,label:user._label})})),users},transport:function(selector,query,success,failure){Ajax.call([{methodname:"tool_dataprivacy_get_users",args:{query:query}}])[0].then((function(results){var promises=[],i=0;return $.each(results,(function(index,user){promises.push(Templates.render("tool_dataprivacy/form-user-selector-suggestion",user))})),$.when.apply($.when,promises).then((function(){var args=arguments;$.each(results,(function(index,user){user._label=args[i],i++})),success(results)}))})).fail(failure)}}}));
//# sourceMappingURL=form-user-selector.min.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/form-user-selector.js"],"names":["define","$","Ajax","Templates","processResults","selector","results","users","each","index","user","push","value","id","label","_label","transport","query","success","failure","promise","call","methodname","args","then","promises","i","render","when","apply","arguments","fail"],"mappings":"AAyBAA,OAAM,uCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,gBAAxB,CAAD,CAA4C,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAA6B,CAE3E,MAAgE,CAE5DC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIC,CAAAA,CAAK,CAAG,EAAZ,CACAN,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCH,CAAK,CAACI,IAAN,CAAW,CACPC,KAAK,CAAEF,CAAI,CAACG,EADL,CAEPC,KAAK,CAAEJ,CAAI,CAACK,MAFL,CAAX,CAIH,CALD,EAMA,MAAOR,CAAAA,CACV,CAX2D,CAa5DS,SAAS,CAAE,mBAASX,CAAT,CAAmBY,CAAnB,CAA0BC,CAA1B,CAAmCC,CAAnC,CAA4C,CACnD,GAAIC,CAAAA,CAAO,CAEDlB,CAAI,CAACmB,IAAL,CAAU,CAAC,CACjBC,UAAU,CAAE,4BADK,CAEjBC,IAAI,CAAE,CACFN,KAAK,CAAEA,CADL,CAFW,CAAD,CAAV,CAFV,CASAG,CAAO,CAAC,CAAD,CAAP,CAAWI,IAAX,CAAgB,SAASlB,CAAT,CAAkB,CAC9B,GAAImB,CAAAA,CAAQ,CAAG,EAAf,CACIC,CAAC,CAAG,CADR,CAIAzB,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCe,CAAQ,CAACd,IAAT,CAAcR,CAAS,CAACwB,MAAV,CAAiB,gDAAjB,CAAmEjB,CAAnE,CAAd,CACH,CAFD,EAKA,MAAOT,CAAAA,CAAC,CAAC2B,IAAF,CAAOC,KAAP,CAAa5B,CAAC,CAAC2B,IAAf,CAAqBH,CAArB,EAA+BD,IAA/B,CAAoC,UAAW,CAClD,GAAID,CAAAA,CAAI,CAAGO,SAAX,CACA7B,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCA,CAAI,CAACK,MAAL,CAAcQ,CAAI,CAACG,CAAD,CAAlB,CACAA,CAAC,EACJ,CAHD,EAIAR,CAAO,CAACZ,CAAD,CAEV,CARM,CAUV,CApBD,EAoBGyB,IApBH,CAoBQZ,CApBR,CAqBH,CA5C2D,CAgDnE,CAlDK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Potential user selector module.\n *\n * @module tool_dataprivacy/form-user-selector\n * @class form-user-selector\n * @package tool_dataprivacy\n * @copyright 2018 Jun Pataleta\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax', 'core/templates'], function($, Ajax, Templates) {\n\n return /** @alias module:tool_dataprivacy/form-user-selector */ {\n\n processResults: function(selector, results) {\n var users = [];\n $.each(results, function(index, user) {\n users.push({\n value: user.id,\n label: user._label\n });\n });\n return users;\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n\n promise = Ajax.call([{\n methodname: 'tool_dataprivacy_get_users',\n args: {\n query: query\n }\n }]);\n\n promise[0].then(function(results) {\n var promises = [],\n i = 0;\n\n // Render the label.\n $.each(results, function(index, user) {\n promises.push(Templates.render('tool_dataprivacy/form-user-selector-suggestion', user));\n });\n\n // Apply the label to the results.\n return $.when.apply($.when, promises).then(function() {\n var args = arguments;\n $.each(results, function(index, user) {\n user._label = args[i];\n i++;\n });\n success(results);\n return;\n });\n\n }).fail(failure);\n }\n\n };\n\n});\n"],"file":"form-user-selector.min.js"}
{"version":3,"file":"form-user-selector.min.js","sources":["../src/form-user-selector.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Potential user selector module.\n *\n * @module tool_dataprivacy/form-user-selector\n * @class form-user-selector\n * @package tool_dataprivacy\n * @copyright 2018 Jun Pataleta\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax', 'core/templates'], function($, Ajax, Templates) {\n\n return /** @alias module:tool_dataprivacy/form-user-selector */ {\n\n processResults: function(selector, results) {\n var users = [];\n $.each(results, function(index, user) {\n users.push({\n value: user.id,\n label: user._label\n });\n });\n return users;\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n\n promise = Ajax.call([{\n methodname: 'tool_dataprivacy_get_users',\n args: {\n query: query\n }\n }]);\n\n promise[0].then(function(results) {\n var promises = [],\n i = 0;\n\n // Render the label.\n $.each(results, function(index, user) {\n promises.push(Templates.render('tool_dataprivacy/form-user-selector-suggestion', user));\n });\n\n // Apply the label to the results.\n return $.when.apply($.when, promises).then(function() {\n var args = arguments;\n $.each(results, function(index, user) {\n user._label = args[i];\n i++;\n });\n success(results);\n return;\n });\n\n }).fail(failure);\n }\n\n };\n\n});\n"],"names":["define","$","Ajax","Templates","processResults","selector","results","users","each","index","user","push","value","id","label","_label","transport","query","success","failure","call","methodname","args","then","promises","i","render","when","apply","arguments","fail"],"mappings":";;;;;;;;;AAyBAA,6CAAO,CAAC,SAAU,YAAa,mBAAmB,SAASC,EAAGC,KAAMC,iBAEA,CAE5DC,eAAgB,SAASC,SAAUC,aAC3BC,MAAQ,UACZN,EAAEO,KAAKF,SAAS,SAASG,MAAOC,MAC5BH,MAAMI,KAAK,CACPC,MAAOF,KAAKG,GACZC,MAAOJ,KAAKK,YAGbR,OAGXS,UAAW,SAASX,SAAUY,MAAOC,QAASC,SAGhCjB,KAAKkB,KAAK,CAAC,CACjBC,WAAY,6BACZC,KAAM,CACFL,MAAOA,UAIP,GAAGM,MAAK,SAASjB,aACjBkB,SAAW,GACXC,EAAI,SAGRxB,EAAEO,KAAKF,SAAS,SAASG,MAAOC,MAC5Bc,SAASb,KAAKR,UAAUuB,OAAO,iDAAkDhB,UAI9ET,EAAE0B,KAAKC,MAAM3B,EAAE0B,KAAMH,UAAUD,MAAK,eACnCD,KAAOO,UACX5B,EAAEO,KAAKF,SAAS,SAASG,MAAOC,MAC5BA,KAAKK,OAASO,KAAKG,GACnBA,OAEJP,QAAQZ,eAIbwB,KAAKX"}
+11 -2
View File
@@ -1,2 +1,11 @@
define ("tool_dataprivacy/myrequestactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events","core/templates","core/pending"],function(a,b,c,d,e,f,g,h){var j={CANCEL_REQUEST:"[data-action=\"cancel\"]",CONTACT_DPO:"[data-action=\"contactdpo\"]"},k=function(){this.registerEvents()};k.prototype.registerEvents=function(){a(j.CANCEL_REQUEST).click(function(g){g.preventDefault();var h=a(this).data("requestid");d.get_strings([{key:"cancelrequest",component:"tool_dataprivacy"},{key:"cancelrequestconfirmation",component:"tool_dataprivacy"}]).then(function(a){var d=a[0],g=a[1];return e.create({title:d,body:g,type:e.types.SAVE_CANCEL}).then(function(a){a.setSaveButtonText(d);a.getRoot().on(f.save,function(){b.call([{methodname:"tool_dataprivacy_cancel_data_request",args:{requestid:h}}])[0].done(function(a){if(a.result){window.location.reload()}else{c.addNotification({message:a.warnings[0].message,type:"error"})}}).fail(c.exception)});a.getRoot().on(f.hidden,function(){a.destroy()});return a})}).done(function(a){a.show()}).fail(c.exception)});a(j.CONTACT_DPO).click(function(b){var j=new h("dataprivacy/crud:initModal:contactdpo");b.preventDefault();var k=a(this).data("replytoemail"),l="";d.get_strings([{key:"contactdataprotectionofficer",component:"tool_dataprivacy"},{key:"send",component:"tool_dataprivacy"}]).then(function(a){var b=a[0];l=a[1];return e.create({title:b,body:g.render("tool_dataprivacy/contact_dpo",{replytoemail:k}),type:e.types.SAVE_CANCEL,large:!0})}).then(function(b){b.setSaveButtonText(l);b.show();b.getRoot().on(f.save,function(b){var c=a("#message").val().trim();if(0===c.length){b.preventDefault();a("[data-region=\"messageinput\"]").addClass("has-danger notifyproblem");a("#id_error_message").removeAttr("hidden")}else{i(c)}});b.getRoot().on(f.hidden,function(){b.destroy()})}).then(j.resolve).catch(c.exception)})};function i(a){var e="success";b.call([{methodname:"tool_dataprivacy_contact_dpo",args:{message:a}}])[0].then(function(a){if(a.result){return d.get_string("requestsubmitted","tool_dataprivacy")}e="error";return a.warnings.join("<br>")}).done(function(a){c.addNotification({message:a,type:e})}).fail(c.exception)}return{init:function init(){return new k}}});
//# sourceMappingURL=myrequestactions.min.js.map
/**
* AMD module to enable users to manage their own data requests.
*
* @module tool_dataprivacy/myrequestactions
* @package tool_dataprivacy
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/myrequestactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events","core/templates","core/pending"],(function($,Ajax,Notification,Str,ModalFactory,ModalEvents,Templates,Pending){var ACTIONS_CANCEL_REQUEST='[data-action="cancel"]',ACTIONS_CONTACT_DPO='[data-action="contactdpo"]',MyRequestActions=function(){this.registerEvents()};return MyRequestActions.prototype.registerEvents=function(){$(ACTIONS_CANCEL_REQUEST).click((function(e){e.preventDefault();var requestId=$(this).data("requestid");Str.get_strings([{key:"cancelrequest",component:"tool_dataprivacy"},{key:"cancelrequestconfirmation",component:"tool_dataprivacy"}]).then((function(langStrings){var title=langStrings[0],confirmMessage=langStrings[1];return ModalFactory.create({title:title,body:confirmMessage,type:ModalFactory.types.SAVE_CANCEL}).then((function(modal){return modal.setSaveButtonText(title),modal.getRoot().on(ModalEvents.save,(function(){var request={methodname:"tool_dataprivacy_cancel_data_request",args:{requestid:requestId}};Ajax.call([request])[0].done((function(data){data.result?window.location.reload():Notification.addNotification({message:data.warnings[0].message,type:"error"})})).fail(Notification.exception)})),modal.getRoot().on(ModalEvents.hidden,(function(){modal.destroy()})),modal}))})).done((function(modal){modal.show()})).fail(Notification.exception)})),$(ACTIONS_CONTACT_DPO).click((function(e){var pendingPromise=new Pending("dataprivacy/crud:initModal:contactdpo");e.preventDefault();var replyToEmail=$(this).data("replytoemail"),sendButtonText="";Str.get_strings([{key:"contactdataprotectionofficer",component:"tool_dataprivacy"},{key:"send",component:"tool_dataprivacy"}]).then((function(langStrings){var modalTitle=langStrings[0];sendButtonText=langStrings[1];var context={replytoemail:replyToEmail};return ModalFactory.create({title:modalTitle,body:Templates.render("tool_dataprivacy/contact_dpo",context),type:ModalFactory.types.SAVE_CANCEL,large:!0})})).then((function(modal){modal.setSaveButtonText(sendButtonText),modal.show(),modal.getRoot().on(ModalEvents.save,(function(e){var message=$("#message").val().trim();0===message.length?(e.preventDefault(),$('[data-region="messageinput"]').addClass("has-danger notifyproblem"),$("#id_error_message").removeAttr("hidden")):function(message){var request={methodname:"tool_dataprivacy_contact_dpo",args:{message:message}},requestType="success";Ajax.call([request])[0].then((function(data){return data.result?Str.get_string("requestsubmitted","tool_dataprivacy"):(requestType="error",data.warnings.join("<br>"))})).done((function(message){Notification.addNotification({message:message,type:requestType})})).fail(Notification.exception)}(message)})),modal.getRoot().on(ModalEvents.hidden,(function(){modal.destroy()}))})).then(pendingPromise.resolve).catch(Notification.exception)}))},{init:function(){return new MyRequestActions}}}));
//# sourceMappingURL=myrequestactions.min.js.map
File diff suppressed because one or more lines are too long
+11 -2
View File
@@ -1,2 +1,11 @@
define ("tool_dataprivacy/purposesactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){var g={DELETE:"[data-action=\"deletepurpose\"]"},h=function(){this.registerEvents()};h.prototype.registerEvents=function(){a(g.DELETE).click(function(g){g.preventDefault();var h=a(this).data("id"),i=a(this).data("name");d.get_strings([{key:"deletepurpose",component:"tool_dataprivacy"},{key:"deletepurposetext",component:"tool_dataprivacy",param:i},{key:"delete"}]).then(function(d){var g=d[0],i=d[1],j=d[2];return e.create({title:g,body:i,type:e.types.SAVE_CANCEL}).then(function(d){d.setSaveButtonText(j);d.getRoot().on(f.save,function(){b.call([{methodname:"tool_dataprivacy_delete_purpose",args:{id:h}}])[0].done(function(b){if(b.result){a("tr[data-purposeid=\""+h+"\"]").remove()}else{c.addNotification({message:b.warnings[0].message,type:"error"})}}).fail(c.exception)});d.getRoot().on(f.hidden,function(){d.destroy()});return d})}).done(function(a){a.show()}).fail(c.exception)})};return{init:function init(){return new h}}});
//# sourceMappingURL=purposesactions.min.js.map
/**
* AMD module for purposes actions.
*
* @module tool_dataprivacy/purposesactions
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/purposesactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],(function($,Ajax,Notification,Str,ModalFactory,ModalEvents){var ACTIONS_DELETE='[data-action="deletepurpose"]',PurposesActions=function(){this.registerEvents()};return PurposesActions.prototype.registerEvents=function(){$(ACTIONS_DELETE).click((function(e){e.preventDefault();var id=$(this).data("id"),stringkeys=[{key:"deletepurpose",component:"tool_dataprivacy"},{key:"deletepurposetext",component:"tool_dataprivacy",param:$(this).data("name")},{key:"delete"}];Str.get_strings(stringkeys).then((function(langStrings){var title=langStrings[0],confirmMessage=langStrings[1],buttonText=langStrings[2];return ModalFactory.create({title:title,body:confirmMessage,type:ModalFactory.types.SAVE_CANCEL}).then((function(modal){return modal.setSaveButtonText(buttonText),modal.getRoot().on(ModalEvents.save,(function(){var request={methodname:"tool_dataprivacy_delete_purpose",args:{id:id}};Ajax.call([request])[0].done((function(data){data.result?$('tr[data-purposeid="'+id+'"]').remove():Notification.addNotification({message:data.warnings[0].message,type:"error"})})).fail(Notification.exception)})),modal.getRoot().on(ModalEvents.hidden,(function(){modal.destroy()})),modal}))})).done((function(modal){modal.show()})).fail(Notification.exception)}))},{init:function(){return new PurposesActions}}}));
//# sourceMappingURL=purposesactions.min.js.map
File diff suppressed because one or more lines are too long
+11 -2
View File
@@ -1,2 +1,11 @@
define ("tool_dataprivacy/request_filter",["jquery","core/form-autocomplete","core/str","core/notification"],function(a,b,c,d){var e={REQUEST_FILTERS:"#request-filters"},f=function init(){c.get_strings([{key:"filter",component:"moodle"},{key:"nofiltersapplied",component:"moodle"}]).then(function(a){var c=a[0],d=a[1];return b.enhance(e.REQUEST_FILTERS,!1,"",c,!1,!0,d,!0)}).fail(d.exception);var f=a(e.REQUEST_FILTERS).val();a(e.REQUEST_FILTERS).on("change",function(){var b=a(this).val();if(f.join(",")!==b.join(",")){if(0===b.length){a("#filters-cleared").val(1)}a(this.form).submit()}})};return{init:function init(){f()}}});
//# sourceMappingURL=request_filter.min.js.map
/**
* JS module for the data requests filter.
*
* @module tool_dataprivacy/request_filter
* @package tool_dataprivacy
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/request_filter",["jquery","core/form-autocomplete","core/str","core/notification"],(function($,Autocomplete,Str,Notification){var SELECTORS_REQUEST_FILTERS="#request-filters";return{init:function(){!function(){Str.get_strings([{key:"filter",component:"moodle"},{key:"nofiltersapplied",component:"moodle"}]).then((function(langstrings){var placeholder=langstrings[0],noSelectionString=langstrings[1];return Autocomplete.enhance(SELECTORS_REQUEST_FILTERS,!1,"",placeholder,!1,!0,noSelectionString,!0)})).fail(Notification.exception);var last=$(SELECTORS_REQUEST_FILTERS).val();$(SELECTORS_REQUEST_FILTERS).on("change",(function(){var current=$(this).val();last.join(",")!==current.join(",")&&(0===current.length&&$("#filters-cleared").val(1),$(this.form).submit())}))}()}}}));
//# sourceMappingURL=request_filter.min.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/request_filter.js"],"names":["define","$","Autocomplete","Str","Notification","SELECTORS","REQUEST_FILTERS","init","get_strings","key","component","then","langstrings","placeholder","noSelectionString","enhance","fail","exception","last","val","on","current","join","length","form","submit"],"mappings":"AAuBAA,OAAM,mCAAC,CAAC,QAAD,CAAW,wBAAX,CAAqC,UAArC,CAAiD,mBAAjD,CAAD,CAAwE,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAA+BC,CAA/B,CAA6C,IAQnHC,CAAAA,CAAS,CAAG,CACZC,eAAe,CAAE,kBADL,CARuG,CAkBnHC,CAAI,CAAG,QAAPA,CAAAA,IAAO,EAAW,CAYlBJ,CAAG,CAACK,WAAJ,CAXiB,CACb,CACIC,GAAG,CAAE,QADT,CAEIC,SAAS,CAAE,QAFf,CADa,CAKb,CACID,GAAG,CAAE,kBADT,CAEIC,SAAS,CAAE,QAFf,CALa,CAWjB,EAA4BC,IAA5B,CAAiC,SAASC,CAAT,CAAsB,IAC/CC,CAAAA,CAAW,CAAGD,CAAW,CAAC,CAAD,CADsB,CAE/CE,CAAiB,CAAGF,CAAW,CAAC,CAAD,CAFgB,CAGnD,MAAOV,CAAAA,CAAY,CAACa,OAAb,CAAqBV,CAAS,CAACC,eAA/B,IAAuD,EAAvD,CAA2DO,CAA3D,OAAqFC,CAArF,IACV,CAJD,EAIGE,IAJH,CAIQZ,CAAY,CAACa,SAJrB,EAMA,GAAIC,CAAAA,CAAI,CAAGjB,CAAC,CAACI,CAAS,CAACC,eAAX,CAAD,CAA6Ba,GAA7B,EAAX,CACAlB,CAAC,CAACI,CAAS,CAACC,eAAX,CAAD,CAA6Bc,EAA7B,CAAgC,QAAhC,CAA0C,UAAW,CACjD,GAAIC,CAAAA,CAAO,CAAGpB,CAAC,CAAC,IAAD,CAAD,CAAQkB,GAAR,EAAd,CAEA,GAAID,CAAI,CAACI,IAAL,CAAU,GAAV,IAAmBD,CAAO,CAACC,IAAR,CAAa,GAAb,CAAvB,CAA0C,CAEtC,GAAuB,CAAnB,GAAAD,CAAO,CAACE,MAAZ,CAA0B,CACtBtB,CAAC,CAAC,kBAAD,CAAD,CAAsBkB,GAAtB,CAA0B,CAA1B,CACH,CACDlB,CAAC,CAAC,KAAKuB,IAAN,CAAD,CAAaC,MAAb,EACH,CACJ,CAVD,CAWH,CAhDsH,CAkDvH,MAAmD,CAM/ClB,IAAI,CAAE,eAAW,CACbA,CAAI,EACP,CAR8C,CAUtD,CA5DK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * JS module for the data requests filter.\n *\n * @module tool_dataprivacy/request_filter\n * @package tool_dataprivacy\n * @copyright 2018 Jun Pataleta\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/form-autocomplete', 'core/str', 'core/notification'], function($, Autocomplete, Str, Notification) {\n\n /**\n * Selectors.\n *\n * @access private\n * @type {{REQUEST_FILTERS: string}}\n */\n var SELECTORS = {\n REQUEST_FILTERS: '#request-filters'\n };\n\n /**\n * Init function.\n *\n * @method init\n * @private\n */\n var init = function() {\n var stringkeys = [\n {\n key: 'filter',\n component: 'moodle'\n },\n {\n key: 'nofiltersapplied',\n component: 'moodle'\n }\n ];\n\n Str.get_strings(stringkeys).then(function(langstrings) {\n var placeholder = langstrings[0];\n var noSelectionString = langstrings[1];\n return Autocomplete.enhance(SELECTORS.REQUEST_FILTERS, false, '', placeholder, false, true, noSelectionString, true);\n }).fail(Notification.exception);\n\n var last = $(SELECTORS.REQUEST_FILTERS).val();\n $(SELECTORS.REQUEST_FILTERS).on('change', function() {\n var current = $(this).val();\n // Prevent form from submitting unnecessarily, eg. on blur when no filter is selected.\n if (last.join(',') !== current.join(',')) {\n // If we're submitting without filters, set the hidden input 'filters-cleared' to 1.\n if (current.length === 0) {\n $('#filters-cleared').val(1);\n }\n $(this.form).submit();\n }\n });\n };\n\n return /** @alias module:core/form-autocomplete */ {\n /**\n * Initialise the unified user filter.\n *\n * @method init\n */\n init: function() {\n init();\n }\n };\n});\n"],"file":"request_filter.min.js"}
{"version":3,"file":"request_filter.min.js","sources":["../src/request_filter.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * JS module for the data requests filter.\n *\n * @module tool_dataprivacy/request_filter\n * @package tool_dataprivacy\n * @copyright 2018 Jun Pataleta\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/form-autocomplete', 'core/str', 'core/notification'], function($, Autocomplete, Str, Notification) {\n\n /**\n * Selectors.\n *\n * @access private\n * @type {{REQUEST_FILTERS: string}}\n */\n var SELECTORS = {\n REQUEST_FILTERS: '#request-filters'\n };\n\n /**\n * Init function.\n *\n * @method init\n * @private\n */\n var init = function() {\n var stringkeys = [\n {\n key: 'filter',\n component: 'moodle'\n },\n {\n key: 'nofiltersapplied',\n component: 'moodle'\n }\n ];\n\n Str.get_strings(stringkeys).then(function(langstrings) {\n var placeholder = langstrings[0];\n var noSelectionString = langstrings[1];\n return Autocomplete.enhance(SELECTORS.REQUEST_FILTERS, false, '', placeholder, false, true, noSelectionString, true);\n }).fail(Notification.exception);\n\n var last = $(SELECTORS.REQUEST_FILTERS).val();\n $(SELECTORS.REQUEST_FILTERS).on('change', function() {\n var current = $(this).val();\n // Prevent form from submitting unnecessarily, eg. on blur when no filter is selected.\n if (last.join(',') !== current.join(',')) {\n // If we're submitting without filters, set the hidden input 'filters-cleared' to 1.\n if (current.length === 0) {\n $('#filters-cleared').val(1);\n }\n $(this.form).submit();\n }\n });\n };\n\n return /** @alias module:core/form-autocomplete */ {\n /**\n * Initialise the unified user filter.\n *\n * @method init\n */\n init: function() {\n init();\n }\n };\n});\n"],"names":["define","$","Autocomplete","Str","Notification","SELECTORS","init","get_strings","key","component","then","langstrings","placeholder","noSelectionString","enhance","fail","exception","last","val","on","current","this","join","length","form","submit"],"mappings":";;;;;;;;AAuBAA,yCAAO,CAAC,SAAU,yBAA0B,WAAY,sBAAsB,SAASC,EAAGC,aAAcC,IAAKC,kBAQrGC,0BACiB,yBAyC8B,CAM/CC,KAAM,YAtCC,WAYPH,IAAII,YAXa,CACb,CACIC,IAAK,SACLC,UAAW,UAEf,CACID,IAAK,mBACLC,UAAW,YAISC,MAAK,SAASC,iBAClCC,YAAcD,YAAY,GAC1BE,kBAAoBF,YAAY,UAC7BT,aAAaY,QAAQT,2BAA2B,EAAO,GAAIO,aAAa,GAAO,EAAMC,mBAAmB,MAChHE,KAAKX,aAAaY,eAEjBC,KAAOhB,EAAEI,2BAA2Ba,MACxCjB,EAAEI,2BAA2Bc,GAAG,UAAU,eAClCC,QAAUnB,EAAEoB,MAAMH,MAElBD,KAAKK,KAAK,OAASF,QAAQE,KAAK,OAET,IAAnBF,QAAQG,QACRtB,EAAE,oBAAoBiB,IAAI,GAE9BjB,EAAEoB,KAAKG,MAAMC,aAYjBnB"}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -9,10 +9,8 @@ Feature: Manage data requests
| username | firstname | lastname | email |
| student1 | John | Doe | s1@example.com |
| student2 | Jane | Doe | s2@example.com |
And I log in as "admin"
And I set the following administration settings values:
| contactdataprotectionofficer | 1 |
And I log out
And the following config values are set as admin:
| contactdataprotectionofficer | 1 | tool_dataprivacy |
@javascript
Scenario: Marking general enquiries as complete
@@ -30,6 +30,12 @@ Feature: Protected data should not be deleted
| Site purpose | PT1H | 0 |
| prot | P1D | 1 |
| unprot | P1D | 0 |
And the following "mod_forum > discussions" exist:
| user | forum | name | message |
| u1 | forump1 | Discussion subject | Test post in forump1 |
| u1 | forumu1 | Discussion subject | Test post in forumu1 |
| u1 | forump2 | Discussion subject | Test post in forump2 |
| u1 | forumu2 | Discussion subject | Test post in forumu2 |
And I set the category and purpose for the "forump1" "forum" in course "C1" to "CAT" and "prot"
And I set the category and purpose for the "forump2" "forum" in course "C2" to "CAT" and "prot"
And I set the category and purpose for the "forumu1" "forum" in course "C1" to "CAT" and "unprot"
@@ -38,47 +44,25 @@ Feature: Protected data should not be deleted
@javascripta
Scenario: Unexpired and protected data is not removed
Given I log in as "u1"
And I am on "C1" course homepage
And I add a new discussion to "forump1" forum with:
| Subject | Discussion subject |
| Message | Test post in forump1 |
And I am on "C1" course homepage
And I add a new discussion to "forumu1" forum with:
| Subject | Discussion subject |
| Message | Test post in forumu1 |
And I am on "C2" course homepage
And I add a new discussion to "forump2" forum with:
| Subject | Discussion subject |
| Message | Test post in forump2 |
And I am on "C2" course homepage
And I add a new discussion to "forumu2" forum with:
| Subject | Discussion subject |
| Message | Test post in forumu2 |
And I log out
And I log in as "admin"
Given I log in as "admin"
And I create a dataprivacy "delete" request for "u1"
And I approve a dataprivacy "delete" request for "u1"
And I run all adhoc tasks
And I navigate to "Users > Privacy and policies > Data requests" in site administration
And I should see "Deleted" in the "u1" "table_row"
And I am on "C1" course homepage
And I follow "forump1"
And I am on the "forump1" "forum activity" page
And I follow "Discussion subject"
Then I should not see "Test post in forump1"
When I am on "C1" course homepage
And I follow "forumu1"
When I am on the "forumu1" "forum activity" page
And I follow "Discussion subject"
Then I should not see "Test post in forumu1"
And I am on "C2" course homepage
And I follow "forump2"
And I am on the "forump2" "forum activity" page
And I follow "Discussion subject"
Then I should see "Test post in forump2"
When I am on "C2" course homepage
And I follow "forumu2"
When I am on the "forumu2" "forum activity" page
And I follow "Discussion subject"
Then I should not see "Test post in forumu2"
+1 -1
View File
@@ -27,7 +27,7 @@ require_once($CFG->libdir . '/adminlib.php');
admin_externalpage_setup('tool_filetypes');
$extension = required_param('extension', PARAM_RAW);
$extension = required_param('extension', PARAM_ALPHANUMEXT);
$redirecturl = new \moodle_url('/admin/tool/filetypes/index.php');
if (optional_param('revert', 0, PARAM_INT)) {
+14 -1
View File
@@ -79,6 +79,19 @@ class locale {
* @return string|false Returns the new current locale, or FALSE on error.
*/
protected function set_locale(int $category = LC_ALL, string $locale = '0') {
return setlocale($category, $locale);
if (strlen($locale) <= 255 || PHP_OS_FAMILY === 'BSD' || PHP_OS_FAMILY === 'Darwin') {
// We can set the whole locale all together.
return setlocale($category, $locale);
}
// Too long locale with linux or windows, let's split it into known and supported categories.
$split = explode(';', $locale);
foreach ($split as $element) {
[$category, $value] = explode('=', $element);
if (defined($category)) { // Only if the category exists, there are OS differences.
setlocale(constant($category), $value);
}
}
return setlocale(LC_ALL, 0); // Finally, return the complete configured locale.
}
}
@@ -27,6 +27,7 @@ defined('MOODLE_INTERNAL') || die();
/**
* Tests for \tool_langimport\locale class.
*
* @coversDefaultClass \tool_langimport\locale
* @copyright 2018 Université Rennes 2 {@link https://www.univ-rennes2.fr}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -34,6 +35,7 @@ class locale_testcase extends \advanced_testcase {
/**
* Test that \tool_langimport\locale::check_locale_availability() works as expected.
*
* @covers ::check_locale_availability
* @return void
*/
public function test_check_locale_availability() {
@@ -68,4 +70,100 @@ class locale_testcase extends \advanced_testcase {
$this->expectException(coding_exception::class);
$locale->check_locale_availability('');
}
/**
* Test \tool_langimport\locale::set_locale() own logic.
*
* We have to explicitly test set_locale() own logic and results,
* that effectively sets the current locale, so we need to restore
* the original locale after every test (ugly, from a purist unit test
* point of view, but needed).
*
* @dataProvider set_locale_provider
* @covers ::set_locale
*
* @param string $set locale string to be set.
* @param string $ret expected results returned after setting the locale.
*/
public function test_set_locale(string $set, string $ret) {
// Make set_locale() public.
$loc = new \tool_langimport\locale();
$rc = new \ReflectionClass(\tool_langimport\locale::class);
$rm = $rc->getMethod('set_locale');
$rm->setAccessible(true);
// Capture current locale for later restore (funnily, using the set_locale() method itself.
$originallocale = $rm->invokeArgs($loc, [LC_ALL, 0]);
// Assert we get the locale defined as expected.
$this->assertEquals($ret, $rm->invokeArgs($loc, [LC_ALL, $set]));
// We have finished, restore the original locale, so this doesn't affect other tests at distance.
// (again, funnily, using the very same set_locale() method).
$rm->invokeArgs($loc, [LC_ALL, $originallocale]);
}
/**
* Data provider for test_set_locale().
*
* Provides a locale to be set (as 'set') and a expected return value (as 'ret'). Note that
* some of the locales are OS dependent, so only the ones matching the OS will be provided.
*
* We make extensive use of the en_AU.UTF-8/English_Australia.1252 locale that is mandatory to
* be installed in any system running PHPUnit tests.
*/
public function set_locale_provider(): array {
// Let's list the allowed categories by OS.
$bsdallowed = ['LC_COLLATE', 'LC_CTYPE', 'LC_MESSAGES', 'LC_MONETARY', 'LC_NUMERIC', 'LC_TIME'];
$winallowed = ['LC_COLLATE', 'LC_CTYPE', 'LC_MONETARY', 'LC_NUMERIC', 'LC_TIME'];
$linuxallowed = [
'LC_COLLATE', 'LC_CTYPE', 'LC_MESSAGES', 'LC_MONETARY', 'LC_NUMERIC', 'LC_TIME',
'LC_PAPER', 'LC_NAME', 'LC_ADDRESS', 'LC_TELEPHONE', 'LC_MEASUREMENT', 'LC_IDENTIFICATION'
];
// The base locale name is also OS dependent.
$baselocale = get_string('locale', 'langconfig');
if (PHP_OS_FAMILY === 'Windows') {
$baselocale = get_string('localewin', 'langconfig');
}
// Here we'll go accumulating cases to be provided.
$cases = [];
// First, the simplest case, just pass a locale name, without categories.
$cases['rawlocale'] = [
'set' => $baselocale,
'ret' => $baselocale,
];
// Now, let's fill ALL LC categories, we should get back the locale name if all them are set with same value.
// Note that this case is the one that, under Linux only, covers the changes performed to the set_locale() method.
// Pick the correct categories depending on the OS.
$oscategories = $bsdallowed; // Default to BSD/Dawrwin ones because they are the standard 6 supported by PHP.
if (PHP_OS_FAMILY === 'Windows') {
$oscategories = $winallowed;
} else if (PHP_OS_FAMILY === 'Linux') {
$oscategories = $linuxallowed;
}
$localestr = '';
foreach ($oscategories as $category) {
// Format is different by OS too, so let build the string conditionally.
if (PHP_OS_FAMILY === 'BSD' || PHP_OS_FAMILY === 'Darwin') {
// BSD uses slashes (/) separated list of the 6 values in exact order.
$localestr .= '/' . $baselocale;
} else {
// Linux/Windows use semicolon (;) separated list of category=value pairs.
$localestr .= ';' . $category . '=' . $baselocale;
}
}
$cases['allcategories'] = [
'set' => trim($localestr, ';/'),
'ret' => $baselocale,
];
// Return all the built cases.
return $cases;
}
}
+12 -2
View File
@@ -1,2 +1,12 @@
define ("tool_licensemanager/delete_license",["jquery","core/modal_factory","core/modal_events","core/url","core/str"],function(a,b,c,d,e){var f=a(".delete-license");b.create({type:b.types.SAVE_CANCEL,title:e.get_string("deletelicense","tool_licensemanager"),body:e.get_string("deletelicenseconfirmmessage","tool_licensemanager"),preShowCallback:function preShowCallback(b,c){b=a(b);var e={action:"delete",license:b.data("license")};c.deleteURL=d.relativeUrl("/admin/tool/licensemanager/index.php",e,!0)},large:!0},f).done(function(a){a.getRoot().on(c.save,function(b){b.preventDefault();window.location.href=a.deleteURL})})});
//# sourceMappingURL=delete_license.min.js.map
/**
* Modal for confirming deletion of a custom license.
*
* @module tool_licensemanager/delete_license
* @class delete_license
* @package tool_licensemanager
* @copyright 2019 Tom Dickman <tomdickman@catalyst-au.net>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_licensemanager/delete_license",["jquery","core/modal_factory","core/modal_events","core/url","core/str"],(function($,ModalFactory,ModalEvents,Url,String){var trigger=$(".delete-license");ModalFactory.create({type:ModalFactory.types.SAVE_CANCEL,title:String.get_string("deletelicense","tool_licensemanager"),body:String.get_string("deletelicenseconfirmmessage","tool_licensemanager"),preShowCallback:function(triggerElement,modal){var params={action:"delete",license:(triggerElement=$(triggerElement)).data("license")};modal.deleteURL=Url.relativeUrl("/admin/tool/licensemanager/index.php",params,!0)},large:!0},trigger).done((function(modal){modal.getRoot().on(ModalEvents.save,(function(e){e.preventDefault(),window.location.href=modal.deleteURL}))}))}));
//# sourceMappingURL=delete_license.min.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/delete_license.js"],"names":["define","$","ModalFactory","ModalEvents","Url","String","trigger","create","type","types","SAVE_CANCEL","title","get_string","body","preShowCallback","triggerElement","modal","params","data","deleteURL","relativeUrl","large","done","getRoot","on","save","e","preventDefault","window","location","href"],"mappings":"AAwBAA,OAAM,sCAAC,CAAC,QAAD,CAAW,oBAAX,CAAiC,mBAAjC,CAAsD,UAAtD,CAAkE,UAAlE,CAAD,CACF,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAuCC,CAAvC,CAA4CC,CAA5C,CAAoD,CAEhD,GAAIC,CAAAA,CAAO,CAAGL,CAAC,CAAC,iBAAD,CAAf,CACAC,CAAY,CAACK,MAAb,CAAoB,CAChBC,IAAI,CAAEN,CAAY,CAACO,KAAb,CAAmBC,WADT,CAEhBC,KAAK,CAAEN,CAAM,CAACO,UAAP,CAAkB,eAAlB,CAAmC,qBAAnC,CAFS,CAGhBC,IAAI,CAAER,CAAM,CAACO,UAAP,CAAkB,6BAAlB,CAAiD,qBAAjD,CAHU,CAIhBE,eAAe,CAAE,yBAASC,CAAT,CAAyBC,CAAzB,CAAgC,CAC7CD,CAAc,CAAGd,CAAC,CAACc,CAAD,CAAlB,CACA,GAAIE,CAAAA,CAAM,CAAG,CACT,OAAU,QADD,CAET,QAAWF,CAAc,CAACG,IAAf,CAAoB,SAApB,CAFF,CAAb,CAIAF,CAAK,CAACG,SAAN,CAAkBf,CAAG,CAACgB,WAAJ,CAAgB,sCAAhB,CAAwDH,CAAxD,IACrB,CAXe,CAYhBI,KAAK,GAZW,CAApB,CAaGf,CAbH,EAcKgB,IAdL,CAcU,SAASN,CAAT,CAAgB,CAClBA,CAAK,CAACO,OAAN,GAAgBC,EAAhB,CAAmBrB,CAAW,CAACsB,IAA/B,CAAqC,SAASC,CAAT,CAAY,CAE7CA,CAAC,CAACC,cAAF,GAEAC,MAAM,CAACC,QAAP,CAAgBC,IAAhB,CAAuBd,CAAK,CAACG,SAChC,CALD,CAMH,CArBL,CAsBH,CA1BC,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Modal for confirming deletion of a custom license.\n *\n * @module tool_licensemanager/delete_license\n * @class delete_license\n * @package tool_licensemanager\n * @copyright 2019 Tom Dickman <tomdickman@catalyst-au.net>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/modal_factory', 'core/modal_events', 'core/url', 'core/str'],\n function($, ModalFactory, ModalEvents, Url, String) {\n\n var trigger = $('.delete-license');\n ModalFactory.create({\n type: ModalFactory.types.SAVE_CANCEL,\n title: String.get_string('deletelicense', 'tool_licensemanager'),\n body: String.get_string('deletelicenseconfirmmessage', 'tool_licensemanager'),\n preShowCallback: function(triggerElement, modal) {\n triggerElement = $(triggerElement);\n let params = {\n 'action': 'delete',\n 'license': triggerElement.data('license')\n };\n modal.deleteURL = Url.relativeUrl('/admin/tool/licensemanager/index.php', params, true);\n },\n large: true,\n }, trigger)\n .done(function(modal) {\n modal.getRoot().on(ModalEvents.save, function(e) {\n // Stop the default save button behaviour which is to close the modal.\n e.preventDefault();\n // Redirect to delete url.\n window.location.href = modal.deleteURL;\n });\n });\n });\n"],"file":"delete_license.min.js"}
{"version":3,"file":"delete_license.min.js","sources":["../src/delete_license.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Modal for confirming deletion of a custom license.\n *\n * @module tool_licensemanager/delete_license\n * @class delete_license\n * @package tool_licensemanager\n * @copyright 2019 Tom Dickman <tomdickman@catalyst-au.net>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/modal_factory', 'core/modal_events', 'core/url', 'core/str'],\n function($, ModalFactory, ModalEvents, Url, String) {\n\n var trigger = $('.delete-license');\n ModalFactory.create({\n type: ModalFactory.types.SAVE_CANCEL,\n title: String.get_string('deletelicense', 'tool_licensemanager'),\n body: String.get_string('deletelicenseconfirmmessage', 'tool_licensemanager'),\n preShowCallback: function(triggerElement, modal) {\n triggerElement = $(triggerElement);\n let params = {\n 'action': 'delete',\n 'license': triggerElement.data('license')\n };\n modal.deleteURL = Url.relativeUrl('/admin/tool/licensemanager/index.php', params, true);\n },\n large: true,\n }, trigger)\n .done(function(modal) {\n modal.getRoot().on(ModalEvents.save, function(e) {\n // Stop the default save button behaviour which is to close the modal.\n e.preventDefault();\n // Redirect to delete url.\n window.location.href = modal.deleteURL;\n });\n });\n });\n"],"names":["define","$","ModalFactory","ModalEvents","Url","String","trigger","create","type","types","SAVE_CANCEL","title","get_string","body","preShowCallback","triggerElement","modal","params","data","deleteURL","relativeUrl","large","done","getRoot","on","save","e","preventDefault","window","location","href"],"mappings":";;;;;;;;;AAwBAA,4CAAO,CAAC,SAAU,qBAAsB,oBAAqB,WAAY,aACrE,SAASC,EAAGC,aAAcC,YAAaC,IAAKC,YAEpCC,QAAUL,EAAE,mBAChBC,aAAaK,OAAO,CAChBC,KAAMN,aAAaO,MAAMC,YACzBC,MAAON,OAAOO,WAAW,gBAAiB,uBAC1CC,KAAMR,OAAOO,WAAW,8BAA+B,uBACvDE,gBAAiB,SAASC,eAAgBC,WAElCC,OAAS,QACC,kBAFdF,eAAiBd,EAAEc,iBAGWG,KAAK,YAEnCF,MAAMG,UAAYf,IAAIgB,YAAY,uCAAwCH,QAAQ,IAEtFI,OAAO,GACRf,SACEgB,MAAK,SAASN,OACXA,MAAMO,UAAUC,GAAGrB,YAAYsB,MAAM,SAASC,GAE1CA,EAAEC,iBAEFC,OAAOC,SAASC,KAAOd,MAAMG"}
@@ -33,3 +33,27 @@ Feature: Licence manager
And "This is the site default licence" "icon" should exist in the "cc" "table_row"
And "Enable licence" "icon" should not exist in the "cc" "table_row"
And "This is the site default licence" "icon" should not exist in the "public" "table_row"
@javascript @_file_upload
Scenario Outline: User licence preference is remembered depending of setting value
Given the following config values are set as admin:
| sitedefaultlicense | cc |
| rememberuserlicensepref | <rememberuserlicensepref> |
And I log in as "admin"
And I follow "Manage private files..."
And I follow "Add..."
And I follow "Upload a file"
And the field with xpath "//select[@name='license']" matches value "Creative Commons"
And I click on "Close" "button" in the "File picker" "dialogue"
When I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager as:
| Save as | empty_copy.txt |
| license | Public domain |
And I press "Save changes"
And I follow "Manage private files..."
And I follow "Add..."
Then the field with xpath "//select[@name='license']" matches value "<expectedlicence>"
Examples:
| rememberuserlicensepref | expectedlicence |
| 0 | Creative Commons |
| 1 | Public domain |
+1 -1
View File
@@ -75,7 +75,7 @@ trait reader {
*/
public static function decode_other(?string $other) {
if ($other === 'N;' || preg_match('~^.:~', $other)) {
return unserialize($other);
return unserialize($other, ['allowed_classes' => [stdClass::class]]);
} else {
return json_decode($other, true);
}
@@ -32,8 +32,7 @@ class logstore_database_store_testcase extends advanced_testcase {
* Tests log writing.
*
* @param bool $jsonformat True to test with JSON format
* @dataProvider test_log_writing_provider
* @throws moodle_exception
* @dataProvider log_writing_provider
*/
public function test_log_writing(bool $jsonformat) {
global $DB, $CFG;
@@ -251,9 +250,9 @@ class logstore_database_store_testcase extends advanced_testcase {
* Returns different JSON format settings so the test can be run with JSON format either on or
* off.
*
* @return [bool] Array of true/false
* @return bool[] Array of true/false
*/
public static function test_log_writing_provider(): array {
public static function log_writing_provider(): array {
return [
[false],
[true]
@@ -310,17 +309,16 @@ class logstore_database_store_testcase extends advanced_testcase {
$logmanager = get_log_manager();
$allreports = \core_component::get_plugin_list('report');
$supportedreports = array(
'report_log' => '/report/log',
'report_loglive' => '/report/loglive'
);
// Make sure all supported reports are installed.
$expectedreports = array_keys(array_intersect_key($allreports, $supportedreports));
$reports = $logmanager->get_supported_reports('logstore_database');
$reports = array_keys($reports);
$expectedreports = array_intersect_key([
'log' => 'report_log',
'loglive' => 'report_loglive',
], $allreports);
$supportedreports = $logmanager->get_supported_reports('logstore_database');
foreach ($expectedreports as $expectedreport) {
$this->assertContains($expectedreport, $reports);
$this->assertArrayHasKey($expectedreport, $supportedreports);
}
}
}
@@ -257,20 +257,19 @@ class logstore_legacy_store_testcase extends advanced_testcase {
$logmanager = get_log_manager();
$allreports = \core_component::get_plugin_list('report');
$supportedreports = array(
'report_log' => '/report/log',
'report_loglive' => '/report/loglive',
'report_outline' => '/report/outline',
'report_participation' => '/report/participation',
'report_stats' => '/report/stats'
);
// Make sure all supported reports are installed.
$expectedreports = array_keys(array_intersect_key($allreports, $supportedreports));
$reports = $logmanager->get_supported_reports('logstore_legacy');
$reports = array_keys($reports);
$expectedreports = array_intersect_key([
'log' => 'report_log',
'loglive' => 'report_loglive',
'outline' => 'report_outline',
'participation' => 'report_participation',
'stats' => 'report_stats'
], $allreports);
$supportedreports = $logmanager->get_supported_reports('logstore_legacy');
foreach ($expectedreports as $expectedreport) {
$this->assertContains($expectedreport, $reports);
$this->assertArrayHasKey($expectedreport, $supportedreports);
}
}
@@ -37,8 +37,7 @@ class logstore_standard_store_testcase extends advanced_testcase {
* Tests log writing.
*
* @param bool $jsonformat True to test with JSON format
* @dataProvider test_log_writing_provider
* @throws moodle_exception
* @dataProvider log_writing_provider
*/
public function test_log_writing(bool $jsonformat) {
global $DB;
@@ -222,9 +221,9 @@ class logstore_standard_store_testcase extends advanced_testcase {
* Returns different JSON format settings so the test can be run with JSON format either on or
* off.
*
* @return [bool] Array of true/false
* @return bool[] Array of true/false
*/
public static function test_log_writing_provider(): array {
public static function log_writing_provider(): array {
return [
[false],
[true]
@@ -238,20 +237,19 @@ class logstore_standard_store_testcase extends advanced_testcase {
$logmanager = get_log_manager();
$allreports = \core_component::get_plugin_list('report');
$supportedreports = array(
'report_log' => '/report/log',
'report_loglive' => '/report/loglive',
'report_outline' => '/report/outline',
'report_participation' => '/report/participation',
'report_stats' => '/report/stats'
);
// Make sure all supported reports are installed.
$expectedreports = array_keys(array_intersect_key($allreports, $supportedreports));
$reports = $logmanager->get_supported_reports('logstore_standard');
$reports = array_keys($reports);
$expectedreports = array_intersect_key([
'log' => 'report_log',
'loglive' => 'report_loglive',
'outline' => 'report_outline',
'participation' => 'report_participation',
'stats' => 'report_stats'
], $allreports);
$supportedreports = $logmanager->get_supported_reports('logstore_standard');
foreach ($expectedreports as $expectedreport) {
$this->assertContains($expectedreport, $reports);
$this->assertArrayHasKey($expectedreport, $supportedreports);
}
}
@@ -367,7 +365,7 @@ class logstore_standard_store_testcase extends advanced_testcase {
* Tests the decode_other function can cope with both JSON and PHP serialized format.
*
* @param mixed $value Value to encode and decode
* @dataProvider test_decode_other_provider
* @dataProvider decode_other_provider
*/
public function test_decode_other($value) {
$this->assertEquals($value, \logstore_standard\log\store::decode_other(serialize($value)));
@@ -386,7 +384,7 @@ class logstore_standard_store_testcase extends advanced_testcase {
*
* @return array Array of parameters
*/
public function test_decode_other_provider(): array {
public function decode_other_provider(): array {
return [
[['info' => 'd2819896', 'logurl' => 'discuss.php?d=2819896']],
[null],
@@ -399,8 +397,7 @@ class logstore_standard_store_testcase extends advanced_testcase {
* Checks that backup and restore of log data works correctly.
*
* @param bool $jsonformat True to test with JSON format
* @dataProvider test_log_writing_provider
* @throws moodle_exception
* @dataProvider log_writing_provider
*/
public function test_backup_restore(bool $jsonformat) {
global $DB;
+2
View File
@@ -50,6 +50,7 @@ switch ($action) {
case 'disable':
unset($enabled[$enrol]);
set_config('enabled_stores', implode(',', array_keys($enabled)), 'tool_log');
add_to_config_log('tool_logstore_visibility', '1', '0', $enrol);
break;
case 'enable':
@@ -59,6 +60,7 @@ switch ($action) {
$enabled = array_keys($enabled);
$enabled[] = $enrol;
set_config('enabled_stores', implode(',', $enabled), 'tool_log');
add_to_config_log('tool_logstore_visibility', '0', '1', $enrol);
break;
case 'up':
@@ -0,0 +1,19 @@
@tool_log @report @report_configlog
Feature: In a report, admin can see logstore visibility changes
# Change log stores visibility so the report contains known data.
Background:
Given I log in as "admin"
And the following config values are set as admin:
| enabled_stores | logstore_standard | tool_log |
@javascript
Scenario: Display configuration changes report
When I navigate to "Plugins > Logging > Manage log stores" in site administration
And I click on "Disable" "icon" in the "Standard log" "table_row"
And I click on "Enable" "icon" in the "External database log" "table_row"
And I navigate to "Reports > Config changes" in site administration
Then the following should exist in the "report-configlog-report-table" table:
| User | Plugin | Setting | New value | Original value |
| Admin User | logstore_standard | tool_logstore_visibility | 0 | 1 |
| Admin User | logstore_database | tool_logstore_visibility | 1 | 0 |
+14 -2
View File
@@ -1,2 +1,14 @@
define ("tool_lp/actionselector",["jquery","core/notification","core/ajax","core/templates","tool_lp/dialogue","tool_lp/event_base"],function(a,b,c,d,e,f){var g=function(a,b,c,d,e){var g=this;f.prototype.constructor.apply(this,[]);g._title=a;g._message=b;g._actions=c;g._confirm=d;g._cancel=e;g._selectedValue=null;g._reset()};g.prototype=Object.create(f.prototype);g.prototype._selectedValue=null;g.prototype._popup=null;g.prototype._title=null;g.prototype._message=null;g.prototype._actions=null;g.prototype._confirm=null;g.prototype._cancel=null;g.prototype._afterRender=function(){var b=this;b._find("[data-action=\"action-selector-confirm\"]").attr("disabled","disabled");b._find("[data-region=\"action-selector-radio-buttons\"]").change(function(){b._selectedValue=a("input[type='radio']:checked").val();b._find("[data-action=\"action-selector-confirm\"]").removeAttr("disabled");b._refresh.bind(b)});b._find("[data-action=\"action-selector-cancel\"]").click(function(a){a.preventDefault();b.close()});b._find("[data-action=\"action-selector-confirm\"]").click(function(a){a.preventDefault();if(!b._selectedValue.length){return}b._trigger("save",{action:b._selectedValue});b.close()})};g.prototype.close=function(){var a=this;a._popup.close();a._reset()};g.prototype.display=function(){var a=this;return a._render().then(function(b){a._popup=new e(a._title,b,a._afterRender.bind(a))}).fail(b.exception)};g.prototype._find=function(b){return a(this._popup.getContent()).find(b)};g.prototype._refresh=function(){var a=this;return a._render().then(function(b){a._find("[data-region=\"action-selector\"]").replaceWith(b);a._afterRender()})};g.prototype._render=function(){var a=this,b=[];for(var c in a._actions){b.push(a._actions[c])}var e={message:a._message,choices:b,confirm:a._confirm,cancel:a._cancel};return d.render("tool_lp/action_selector",e)};g.prototype._reset=function(){this._popup=null;this._selectedValue=""};return g});
//# sourceMappingURL=actionselector.min.js.map
/**
* Action selector.
*
* To handle 'save' events use: actionselector.on('save')
* This will receive the information to display in popup.
* The actions have the format [{'text': sometext, 'value' : somevalue}].
*
* @package tool_lp
* @copyright 2016 Serge Gauthier - <serge.gauthier.2@umontreal.ca>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_lp/actionselector",["jquery","core/notification","core/ajax","core/templates","tool_lp/dialogue","tool_lp/event_base"],(function($,Notification,Ajax,Templates,Dialogue,EventBase){var ActionSelector=function(title,message,actions,confirm,cancel){EventBase.prototype.constructor.apply(this,[]),this._title=title,this._message=message,this._actions=actions,this._confirm=confirm,this._cancel=cancel,this._selectedValue=null,this._reset()};return(ActionSelector.prototype=Object.create(EventBase.prototype))._selectedValue=null,ActionSelector.prototype._popup=null,ActionSelector.prototype._title=null,ActionSelector.prototype._message=null,ActionSelector.prototype._actions=null,ActionSelector.prototype._confirm=null,ActionSelector.prototype._cancel=null,ActionSelector.prototype._afterRender=function(){var self=this;self._find('[data-action="action-selector-confirm"]').attr("disabled","disabled"),self._find('[data-region="action-selector-radio-buttons"]').change((function(){self._selectedValue=$("input[type='radio']:checked").val(),self._find('[data-action="action-selector-confirm"]').removeAttr("disabled"),self._refresh.bind(self)})),self._find('[data-action="action-selector-cancel"]').click((function(e){e.preventDefault(),self.close()})),self._find('[data-action="action-selector-confirm"]').click((function(e){e.preventDefault(),self._selectedValue.length&&(self._trigger("save",{action:self._selectedValue}),self.close())}))},ActionSelector.prototype.close=function(){this._popup.close(),this._reset()},ActionSelector.prototype.display=function(){var self=this;return self._render().then((function(html){self._popup=new Dialogue(self._title,html,self._afterRender.bind(self))})).fail(Notification.exception)},ActionSelector.prototype._find=function(selector){return $(this._popup.getContent()).find(selector)},ActionSelector.prototype._refresh=function(){var self=this;return self._render().then((function(html){self._find('[data-region="action-selector"]').replaceWith(html),self._afterRender()}))},ActionSelector.prototype._render=function(){var choices=[];for(var i in this._actions)choices.push(this._actions[i]);var content={message:this._message,choices:choices,confirm:this._confirm,cancel:this._cancel};return Templates.render("tool_lp/action_selector",content)},ActionSelector.prototype._reset=function(){this._popup=null,this._selectedValue=""},ActionSelector}));
//# sourceMappingURL=actionselector.min.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_lp/competency_outcomes",["jquery","core/str"],function(a,b){return{NONE:0,EVIDENCE:1,COMPLETE:2,RECOMMEND:3,getAll:function getAll(){var a=this;return b.get_strings([{key:"competencyoutcome_none",component:"tool_lp"},{key:"competencyoutcome_evidence",component:"tool_lp"},{key:"competencyoutcome_recommend",component:"tool_lp"},{key:"competencyoutcome_complete",component:"tool_lp"}]).then(function(b){var c={};c[a.NONE]={code:a.NONE,name:b[0]};c[a.EVIDENCE]={code:a.EVIDENCE,name:b[1]};c[a.RECOMMEND]={code:a.RECOMMEND,name:b[2]};c[a.COMPLETE]={code:a.COMPLETE,name:b[3]};return c})},getString:function getString(b){var c=this,d=c.getAll();return d.then(function(c){if("undefined"==typeof c[b]){return a.Deferred().reject().promise()}return c[b].name})}}});
//# sourceMappingURL=competency_outcomes.min.js.map
/**
* Competency rule config.
*
* @package tool_lp
* @copyright 2015 Frédéric Massart - FMCorz.net
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_lp/competency_outcomes",["jquery","core/str"],(function($,Str){return{NONE:0,EVIDENCE:1,COMPLETE:2,RECOMMEND:3,getAll:function(){var self=this;return Str.get_strings([{key:"competencyoutcome_none",component:"tool_lp"},{key:"competencyoutcome_evidence",component:"tool_lp"},{key:"competencyoutcome_recommend",component:"tool_lp"},{key:"competencyoutcome_complete",component:"tool_lp"}]).then((function(strings){var outcomes={};return outcomes[self.NONE]={code:self.NONE,name:strings[0]},outcomes[self.EVIDENCE]={code:self.EVIDENCE,name:strings[1]},outcomes[self.RECOMMEND]={code:self.RECOMMEND,name:strings[2]},outcomes[self.COMPLETE]={code:self.COMPLETE,name:strings[3]},outcomes}))},getString:function(id){return this.getAll().then((function(outcomes){return void 0===outcomes[id]?$.Deferred().reject().promise():outcomes[id].name}))}}}));
//# sourceMappingURL=competency_outcomes.min.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/competency_outcomes.js"],"names":["define","$","Str","NONE","EVIDENCE","COMPLETE","RECOMMEND","getAll","self","get_strings","key","component","then","strings","outcomes","code","name","getString","id","all","Deferred","reject","promise"],"mappings":"AAuBAA,OAAM,+BAAC,CAAC,QAAD,CACC,UADD,CAAD,CAEE,SAASC,CAAT,CAAYC,CAAZ,CAAiB,CAOrB,MAAwD,CAEpDC,IAAI,EAFgD,CAGpDC,QAAQ,EAH4C,CAIpDC,QAAQ,EAJ4C,CAKpDC,SAAS,EAL2C,CAapDC,MAAM,CAAE,iBAAW,CACf,GAAIC,CAAAA,CAAI,CAAG,IAAX,CACA,MAAON,CAAAA,CAAG,CAACO,WAAJ,CAAgB,CACnB,CAACC,GAAG,CAAE,wBAAN,CAAgCC,SAAS,CAAE,SAA3C,CADmB,CAEnB,CAACD,GAAG,CAAE,4BAAN,CAAoCC,SAAS,CAAE,SAA/C,CAFmB,CAGnB,CAACD,GAAG,CAAE,6BAAN,CAAqCC,SAAS,CAAE,SAAhD,CAHmB,CAInB,CAACD,GAAG,CAAE,4BAAN,CAAoCC,SAAS,CAAE,SAA/C,CAJmB,CAAhB,EAKJC,IALI,CAKC,SAASC,CAAT,CAAkB,CACtB,GAAIC,CAAAA,CAAQ,CAAG,EAAf,CACAA,CAAQ,CAACN,CAAI,CAACL,IAAN,CAAR,CAAsB,CAACY,IAAI,CAAEP,CAAI,CAACL,IAAZ,CAAkBa,IAAI,CAAEH,CAAO,CAAC,CAAD,CAA/B,CAAtB,CACAC,CAAQ,CAACN,CAAI,CAACJ,QAAN,CAAR,CAA0B,CAACW,IAAI,CAAEP,CAAI,CAACJ,QAAZ,CAAsBY,IAAI,CAAEH,CAAO,CAAC,CAAD,CAAnC,CAA1B,CACAC,CAAQ,CAACN,CAAI,CAACF,SAAN,CAAR,CAA2B,CAACS,IAAI,CAAEP,CAAI,CAACF,SAAZ,CAAuBU,IAAI,CAAEH,CAAO,CAAC,CAAD,CAApC,CAA3B,CACAC,CAAQ,CAACN,CAAI,CAACH,QAAN,CAAR,CAA0B,CAACU,IAAI,CAAEP,CAAI,CAACH,QAAZ,CAAsBW,IAAI,CAAEH,CAAO,CAAC,CAAD,CAAnC,CAA1B,CACA,MAAOC,CAAAA,CACV,CAZM,CAaV,CA5BmD,CAqCpDG,SAAS,CAAE,mBAASC,CAAT,CAAa,CACpB,GAAIV,CAAAA,CAAI,CAAG,IAAX,CACIW,CAAG,CAAGX,CAAI,CAACD,MAAL,EADV,CAGA,MAAOY,CAAAA,CAAG,CAACP,IAAJ,CAAS,SAASE,CAAT,CAAmB,CAC/B,GAA4B,WAAxB,QAAOA,CAAAA,CAAQ,CAACI,CAAD,CAAnB,CAAyC,CACrC,MAAOjB,CAAAA,CAAC,CAACmB,QAAF,GAAaC,MAAb,GAAsBC,OAAtB,EACV,CACD,MAAOR,CAAAA,CAAQ,CAACI,CAAD,CAAR,CAAaF,IACvB,CALM,CAMV,CA/CmD,CAkD3D,CA3DK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Competency rule config.\n *\n * @package tool_lp\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/str'],\n function($, Str) {\n\n var OUTCOME_NONE = 0,\n OUTCOME_EVIDENCE = 1,\n OUTCOME_COMPLETE = 2,\n OUTCOME_RECOMMEND = 3;\n\n return /** @alias module:tool_lp/competency_outcomes */ {\n\n NONE: OUTCOME_NONE,\n EVIDENCE: OUTCOME_EVIDENCE,\n COMPLETE: OUTCOME_COMPLETE,\n RECOMMEND: OUTCOME_RECOMMEND,\n\n /**\n * Get all the outcomes.\n *\n * @return {Object} Indexed by outcome code, contains code and name.\n * @method getAll\n */\n getAll: function() {\n var self = this;\n return Str.get_strings([\n {key: 'competencyoutcome_none', component: 'tool_lp'},\n {key: 'competencyoutcome_evidence', component: 'tool_lp'},\n {key: 'competencyoutcome_recommend', component: 'tool_lp'},\n {key: 'competencyoutcome_complete', component: 'tool_lp'},\n ]).then(function(strings) {\n var outcomes = {};\n outcomes[self.NONE] = {code: self.NONE, name: strings[0]};\n outcomes[self.EVIDENCE] = {code: self.EVIDENCE, name: strings[1]};\n outcomes[self.RECOMMEND] = {code: self.RECOMMEND, name: strings[2]};\n outcomes[self.COMPLETE] = {code: self.COMPLETE, name: strings[3]};\n return outcomes;\n });\n },\n\n /**\n * Get the string for an outcome.\n *\n * @param {Number} id The outcome code.\n * @return {Promise} Resolved with the string.\n * @method getString\n */\n getString: function(id) {\n var self = this,\n all = self.getAll();\n\n return all.then(function(outcomes) {\n if (typeof outcomes[id] === 'undefined') {\n return $.Deferred().reject().promise();\n }\n return outcomes[id].name;\n });\n }\n };\n\n});\n"],"file":"competency_outcomes.min.js"}
{"version":3,"file":"competency_outcomes.min.js","sources":["../src/competency_outcomes.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Competency rule config.\n *\n * @package tool_lp\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/str'],\n function($, Str) {\n\n var OUTCOME_NONE = 0,\n OUTCOME_EVIDENCE = 1,\n OUTCOME_COMPLETE = 2,\n OUTCOME_RECOMMEND = 3;\n\n return /** @alias module:tool_lp/competency_outcomes */ {\n\n NONE: OUTCOME_NONE,\n EVIDENCE: OUTCOME_EVIDENCE,\n COMPLETE: OUTCOME_COMPLETE,\n RECOMMEND: OUTCOME_RECOMMEND,\n\n /**\n * Get all the outcomes.\n *\n * @return {Object} Indexed by outcome code, contains code and name.\n * @method getAll\n */\n getAll: function() {\n var self = this;\n return Str.get_strings([\n {key: 'competencyoutcome_none', component: 'tool_lp'},\n {key: 'competencyoutcome_evidence', component: 'tool_lp'},\n {key: 'competencyoutcome_recommend', component: 'tool_lp'},\n {key: 'competencyoutcome_complete', component: 'tool_lp'},\n ]).then(function(strings) {\n var outcomes = {};\n outcomes[self.NONE] = {code: self.NONE, name: strings[0]};\n outcomes[self.EVIDENCE] = {code: self.EVIDENCE, name: strings[1]};\n outcomes[self.RECOMMEND] = {code: self.RECOMMEND, name: strings[2]};\n outcomes[self.COMPLETE] = {code: self.COMPLETE, name: strings[3]};\n return outcomes;\n });\n },\n\n /**\n * Get the string for an outcome.\n *\n * @param {Number} id The outcome code.\n * @return {Promise} Resolved with the string.\n * @method getString\n */\n getString: function(id) {\n var self = this,\n all = self.getAll();\n\n return all.then(function(outcomes) {\n if (typeof outcomes[id] === 'undefined') {\n return $.Deferred().reject().promise();\n }\n return outcomes[id].name;\n });\n }\n };\n\n});\n"],"names":["define","$","Str","NONE","EVIDENCE","COMPLETE","RECOMMEND","getAll","self","this","get_strings","key","component","then","strings","outcomes","code","name","getString","id","Deferred","reject","promise"],"mappings":";;;;;;;AAuBAA,qCAAO,CAAC,SACA,aACA,SAASC,EAAGC,WAOwC,CAEpDC,KAPe,EAQfC,SAPmB,EAQnBC,SAPmB,EAQnBC,UAPoB,EAepBC,OAAQ,eACAC,KAAOC,YACJP,IAAIQ,YAAY,CACnB,CAACC,IAAK,yBAA0BC,UAAW,WAC3C,CAACD,IAAK,6BAA8BC,UAAW,WAC/C,CAACD,IAAK,8BAA+BC,UAAW,WAChD,CAACD,IAAK,6BAA8BC,UAAW,aAChDC,MAAK,SAASC,aACTC,SAAW,UACfA,SAASP,KAAKL,MAAQ,CAACa,KAAMR,KAAKL,KAAMc,KAAMH,QAAQ,IACtDC,SAASP,KAAKJ,UAAY,CAACY,KAAMR,KAAKJ,SAAUa,KAAMH,QAAQ,IAC9DC,SAASP,KAAKF,WAAa,CAACU,KAAMR,KAAKF,UAAWW,KAAMH,QAAQ,IAChEC,SAASP,KAAKH,UAAY,CAACW,KAAMR,KAAKH,SAAUY,KAAMH,QAAQ,IACvDC,aAWfG,UAAW,SAASC,WACLV,KACIF,SAEJM,MAAK,SAASE,sBACO,IAAjBA,SAASI,IACTlB,EAAEmB,WAAWC,SAASC,UAE1BP,SAASI,IAAIF"}
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_lp/competency_plan_navigation",["jquery"],function(a){var b=function(b,c,d,e,f){this._baseUrl=c;this._userId=d+"";this._competencyId=e+"";this._planId=f;this._ignoreFirstCompetency=!0;a(b).on("change",this._competencyChanged.bind(this))};b.prototype._competencyChanged=function(b){if(this._ignoreFirstCompetency){this._ignoreFirstCompetency=!1;return}var c=a(b.target).val(),d="?userid="+this._userId+"&planid="+this._planId+"&competencyid="+c;document.location=this._baseUrl+d};b.prototype._competencyId=null;b.prototype._userId=null;b.prototype._planId=null;b.prototype._baseUrl=null;b.prototype._ignoreFirstCompetency=null;return b});
//# sourceMappingURL=competency_plan_navigation.min.js.map
/**
* Event click on selecting competency in the competency autocomplete.
*
* @package tool_lp
* @copyright 2016 Issam Taboubi <issam.taboubi@umontreal.ca>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_lp/competency_plan_navigation",["jquery"],(function($){var CompetencyPlanNavigation=function(competencySelector,baseUrl,userId,competencyId,planId){this._baseUrl=baseUrl,this._userId=userId+"",this._competencyId=competencyId+"",this._planId=planId,this._ignoreFirstCompetency=!0,$(competencySelector).on("change",this._competencyChanged.bind(this))};return CompetencyPlanNavigation.prototype._competencyChanged=function(e){if(this._ignoreFirstCompetency)this._ignoreFirstCompetency=!1;else{var newCompetencyId=$(e.target).val(),queryStr="?userid="+this._userId+"&planid="+this._planId+"&competencyid="+newCompetencyId;document.location=this._baseUrl+queryStr}},CompetencyPlanNavigation.prototype._competencyId=null,CompetencyPlanNavigation.prototype._userId=null,CompetencyPlanNavigation.prototype._planId=null,CompetencyPlanNavigation.prototype._baseUrl=null,CompetencyPlanNavigation.prototype._ignoreFirstCompetency=null,CompetencyPlanNavigation}));
//# sourceMappingURL=competency_plan_navigation.min.js.map

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