Compare commits

..

961 Commits

Author SHA1 Message Date
Jun Pataleta b0a7bc3f42 Moodle release 4.1.6 2023-10-07 11:30:22 +08:00
Sara Arjona fcd50e4722 weekly release 4.1.5+ 2023-10-06 14:02:25 +02:00
Paul Holden 70a83735f3 MDL-79310 enrol: restrict searched users to those user can view. 2023-10-04 14:31:31 +08:00
Paul Holden a067663a63 MDL-79310 forumreport_summary: report only on users who can be viewed. 2023-10-04 14:31:31 +08:00
Paul Holden a55e18fb81 MDL-79310 mod_forum: ensure only visible users can be exported. 2023-10-04 14:31:30 +08:00
Sara Arjona bd18e026bb Merge branch 'MDL-69119-M401_angle_bracket_character_in_answers_not_escaped_in_moodle_xml_export_of_multiple_choice_calculated_questions' of https://github.com/ziegenberg/moodle into MOODLE_401_STABLE 2023-10-04 07:51:42 +02:00
Huong Nguyen c15cb5586c Merge branch 'MDL-79539-401' of https://github.com/meirzamoodle/moodle into MOODLE_401_STABLE 2023-10-04 10:56:09 +07:00
Mikel Martín fce36ecf4f MDL-79509 mod_wiki: Improve comment editing 2023-10-04 02:10:16 +02:00
Paul Holden 8f8c4e3153 MDL-72249 message: stricter cleaning of processor type parameter. 2023-10-04 02:10:16 +02:00
Paul Holden 369c5407ab MDL-79426 gradeimport_csv: safely preview CSV content during import. 2023-10-04 02:10:16 +02:00
Paul Holden 04db4a3e54 MDL-79455 tool_uploadcourse: clean course data fields individually. 2023-10-04 02:10:16 +02:00
Paul Holden 23466dd6d1 MDL-79455 tool_uploadcourse: safe preview of uploaded course data. 2023-10-04 02:10:16 +02:00
Paul Holden 74b62601d0 MDL-79409 mod_imscp: appropriate unserialization of package structure. 2023-10-04 02:10:16 +02:00
Paul Holden f428d58df6 MDL-79408 mod_lesson: safer unserializing/comparison of properties. 2023-10-04 02:10:16 +02:00
David Woloszyn 6f2fa6011e 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:10:16 +02:00
Huong Nguyen e2452a4b3c MDL-66730 core_course: Improve permission check for category moving
Co-authored-by: Erica Bithell <egb10@cam.ac.uk>
2023-10-04 02:10:16 +02:00
Laurent David fc26693229 MDL-77795 mod_bigbluebuttonbn: Change meetingID on duplicate
* We need to set a different meetingID when duplicating or importing a
BigBlueButtonBN activity to prevent unwanted sharing of recordings between
meetings.
2023-10-04 02:10:16 +02:00
Paul Holden 1eda3a392b MDL-78820 h5p: use fullname of current user as the xAPI actor name. 2023-10-04 02:10:16 +02:00
meirzamoodle c3c18bbb20 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:10:16 +02:00
Paul Holden c25092b232 MDL-78971 quiz_grading: escape user identity fields on display. 2023-10-04 02:10:16 +02:00
Jun Pataleta a7bdd7a007 weekly release 4.1.5+ 2023-10-04 07:49:17 +08:00
Jun Pataleta 99f4f6894f Merge branch 'install_401_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_401_STABLE 2023-10-04 07:49:15 +08:00
Daniel Ziegenberg 0839431f16 MDL-69119 qformat_xml: fix mc calculated export
The Moodle XML export of multiple choice calculated questions was
missing proper escaping of answers. Also the indentation of the
generated xml was off.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2023-10-03 12:23:20 +02:00
Jun Pataleta cf98238fdf Merge branch 'MDL-79557-401' of https://github.com/jleyva/moodle into MOODLE_401_STABLE 2023-10-03 12:18:00 +08:00
Jake Dallimore 925c36fb1d Merge branch 'MDL-79056-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-10-03 12:03:58 +08:00
Andrew Nicols d78dda7754 MDL-78580 mod_quiz: Do not concatenate lang strings 2023-10-03 12:03:55 +08:00
Andrew Nicols 2f6519d2de Merge branch 'MDL-78580_401_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_401_STABLE 2023-10-03 11:23:54 +08:00
Huong Nguyen ff7530e1d6 Merge branch 'MDL-79247_401' of https://github.com/stronk7/moodle into MOODLE_401_STABLE 2023-10-03 09:57:55 +07:00
Jun Pataleta fbcb5793c3 Merge branch 'MDL-79254_401_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_401_STABLE 2023-10-03 09:42:08 +08:00
Ilya Tregubov 109879a2a1 Merge branch 'MDL-79428-401' of https://github.com/srobotta/moodle into MOODLE_401_STABLE 2023-10-03 09:41:21 +08:00
Jun Pataleta a0d2e40b4d Merge branch 'MDL-79364-401' of https://github.com/ilyatregubov/moodle into MOODLE_401_STABLE 2023-10-03 09:16:27 +08:00
meirzamoodle 15c7909885 MDL-79539 core: handling negative input to get the upper value
Co-authored-by: Alain Corbière <alain.corbiere@univ-lemans.fr>
2023-10-02 20:57:08 +07:00
meirzamoodle c29a812323 MDL-79539 messageinbound: avoiding a null parameter value 2023-10-02 20:51:33 +07:00
Juan Leyva 8d65efee7c MDL-79557 message: Clean subject field content for get_messages WS 2023-10-02 14:52:25 +02:00
Ilya Tregubov 35312efbf9 MDL-79364 backup: Fix conversion for 1.9 backups.
1.9 backups used current plugin version as oldversion.
But quiz uses some hardcoded version numbers when processing
restore which is lower then current plugin number, so some quiz
logic was ignored.

See define_structure(), process_quiz_question_instance() within
restore_quiz_stepslib.php
2023-10-02 15:29:17 +08:00
Eloy Lafuente (stronk7) 96e62487e7 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:46:19 +02:00
Eloy Lafuente (stronk7) b342562457 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:46:19 +02:00
AMOS bot 803df36ce0 Automatically generated installer lang files 2023-09-30 00:10:27 +00:00
Jun Pataleta b3ea1a9d5b weekly release 4.1.5+ 2023-09-29 22:07:19 +08:00
Jun Pataleta fb311f1eae Merge branch 'install_401_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_401_STABLE 2023-09-29 22:07:17 +08:00
Stephan Robotta f9432283a9 MDL-79428 license: upgrading cc core licenses to version 4.0
The short name of the cc licenses are trailed with a suffix containing
the version number (current 3.0 and 4.0). The old cc* licenses become
the new cc-*-3.0 licenses and are disables, because the new cc*-4.0
licenses are the current ones.

This is a backport of MDL-43195.
2023-09-29 09:39:18 +02:00
Artur Neumann 0c4dc597d7 MDL-79487 oauth2: do not delete refresh token
when `log_out` is called from `\core\oauth2\client` it will delete the refresh token,
what it actually needs to use it to get a new access token
actually logging out is not needed here, the only thing we need to make sure is,
the invalid access token is removed from the session
that is done by storing `null`
2023-09-29 12:14:50 +08:00
Jun Pataleta adc138d1f1 MDL-79056 gradereport_user: Make column heading IDs unique
Associate column headings of user report tables to the user ID that the
report is being generated for. This will prevent duplicate IDs for the
report columns when multiple user report tables are displayed on the
User report page.
2023-09-29 11:03:36 +08:00
Jun Pataleta aff1f3a400 MDL-79056 gradereport_user: Set grade category and item names as th
* The table cells mentioned in the `headers` attribute of other table
cells need to be using the table header <th> tag. Otherwise, HTML
validation fails.
2023-09-29 11:03:36 +08:00
AMOS bot 74d66468cb Automatically generated installer lang files 2023-09-29 00:08:05 +00:00
Huong Nguyen 3b31c13678 Merge branch 'MDL-79274' of https://github.com/catalystfd/moodle into MOODLE_401_STABLE 2023-09-28 15:49:40 +07:00
Ilya Tregubov d4c9c36fcd Merge branch 'MDL-79463-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-09-28 16:41:19 +08:00
Sara Arjona 5299097da9 Merge branch 'MDL-79477-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-09-28 10:17:47 +02:00
Sara Arjona 8dad07455d Merge branch 'MDL-78918-401' of https://github.com/ssj365/moodle into MOODLE_401_STABLE 2023-09-28 09:52:49 +02:00
Sara Arjona c5707a934d Merge branch 'MDL-79350-401' of https://github.com/daledavies/moodle into MOODLE_401_STABLE 2023-09-28 07:48:06 +02:00
Huong Nguyen 6bc7b8e8be Merge branch 'MDL-78813-401' of https://github.com/mihailges/moodle into MOODLE_401_STABLE 2023-09-28 12:03:25 +07:00
Ilya Tregubov 8894b1eb42 Merge branch 'MDL-79349-m401' of https://github.com/sammarshallou/moodle into MOODLE_401_STABLE 2023-09-28 10:47:24 +08:00
Huong Nguyen f0c0dbbb06 Merge branch 'MDL-75329-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-09-28 09:36:49 +07:00
Ilya Tregubov 8e5eda32fe Merge branch 'MDL-79285_401' of https://github.com/stronk7/moodle into MOODLE_401_STABLE 2023-09-28 10:21:09 +08:00
Ilya Tregubov 20e40c3882 Merge branch 'MDL-79360/401' of https://github.com/skodak/moodle into MOODLE_401_STABLE 2023-09-28 09:38:20 +08:00
Shamiso.Jaravaza 7127744f39 MDL-78918 mod_bigbluebuttonbn: Fix notifications 2023-09-27 12:28:57 -06:00
Jun Pataleta 5d902db0d1 Merge branch 'MDL-77891-401' of https://github.com/snake/moodle into MOODLE_401_STABLE 2023-09-27 23:49:20 +08:00
Mark Johnson fbb6717550 MDL-79254 quiz_statistics: Convert recalculate task to ad-hoc
Previously, quiz statistics processing happened on a scheduled task.
This task looked for all quizzes with completed attempts, then
determined if those quizzes had a statistics calculation that's newer
than the most recent attempt, then ran the statistics calculation if
needed. It was hard coded to stop processing after 1 hour.

The queries involved in determining which quizzes needed processing
weren't terribly efficient, and combined with the 1 hour limit this made
the statistics unusable on large sites, where they are the most useful.

This converts the scheduled task to an ad-hoc task, and uses an event
observer for mod_quiz\event\attempt_submitted to queue a task when
it is needed. This removes the need for a query to work out what needs
processing, and allows the task processing to be scaled up as needed.
2023-09-27 15:42:41 +01:00
Shamim Rezaie ae0cdf3b67 Merge branch 'MDL-78239-401' of https://github.com/HuongNV13/moodle into MOODLE_401_STABLE 2023-09-27 14:41:23 +10:00
Huong Nguyen a76f40c81b Merge branch 'MDL-79467-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-09-27 10:45:07 +07:00
Ilya Tregubov 4f8a492374 Merge branch 'MDL-77708-401' of https://github.com/sarjona/moodle into MOODLE_401_STABLE 2023-09-27 09:11:38 +08:00
Eloy Lafuente (stronk7) 68a2dd57ef MDL-79285 xhprof: Add support for optional "reducedata" parameter
This new parameter / property will decide if we want to reduce
the run data before processing it:
- By default it will be disabled in table mode.
- By default it will be enabled in graph mode.
- The defaults can be changed by adding reducedata=[0|1] in the URLs
- Once data reduction is enabled, it stays enabled while
  navigating within the xhprof reports.
2023-09-26 19:40:07 +02:00
Eloy Lafuente (stronk7) c841064432 MDL-79285 xhprof: Cover the new functions with unit tests
This covers the 2 new functions with unit tests:
- xhprof_topo_sort()
- reduce_run_data()

Note that the example graph used in the provider is the
one shown in the issue to explain the reduction procedure.
2023-09-26 19:40:06 +02:00
Eloy Lafuente (stronk7) f82ca155ac MDL-79285 xhprof: Enable reducing runs data for quicker use
Here we are reducing the xhprof runs data by removing the
__Mustache==>__Mustache calls and all the orphaned data.

To save N iterations what we are doing is:

0. The information is "topologically" sorted, so we ensure that
   all the parents in the data are processed before the children.
   (this will help a lot when cleaning orphaned data, see below).
1. First pass, all the candidate (by regexp) calls are removed
   from the run data.
2. Second pass, all the orphaned information (calls that have
   ended losing his parent) are also removed, so data is consistent.
   Note that, normally we would need N passes to remove all the
   orphaned data (because each pass creates new orphan candidates),
   but, as far as we have ensured that the information is topologically
   sorted (see point 0 above), all this can be done in one unique pass.

TODO:
  - Add unit tests.
  - Enable some system to be able to decide which utilities we
    want to get the data reduced and which ones will continue
    using the complete data. Right now the reduction is being
    applied to all the utilities (both table and graph views).
  - Document the change and, if implemented, the way to select
    between complete/reduced data.
  - Consider adding some caching to speed-up the reduction process
    (some TODOs have been left in the code pointing to the critical
    points).
2023-09-26 19:40:06 +02:00
Sara Arjona b660e6979a weekly release 4.1.5+ 2023-09-26 16:17:04 +02:00
Mihail Geshoski ebf12946d6 MDL-78813 gradereport_grader: Revert border-top-width css change
Revert the modification of the border-top-width css attribute
to the grader table and the table header. This change seems to
be unnecessary.
2023-09-26 13:32:02 +02:00
Paul Holden 0195ecbf78 MDL-75329 course: defensive counting of course sections.
Avoids errors due to pre-existing integrity issues with course
data, where the absence entirely of section data would result in
PHP errors.
2023-09-26 12:18:39 +01:00
Paul Holden 98381d5ab7 MDL-79477 tool_moodlenet: better handling of network download test.
We can't assume the presense of `Content-Length` header in response
to a HEAD request. Modify test assertion to account for this.
2023-09-26 11:33:09 +01:00
Kevin Percy 00bd11b539 MDL-78813 gradereport_grader: Fixed help icon covering course average 2023-09-26 11:21:00 +02:00
Sara Arjona 54d446ce43 MDL-77708 docs: Update references from docs.moodle.org/dev 2023-09-26 10:57:33 +02:00
Huong Nguyen e8d14cde9a MDL-78239 editor_tiny: Calculate correct height for non-visible editors 2023-09-26 14:57:24 +07:00
Jun Pataleta ccbb3ce62d Merge branch 'MDL-76713-401' of https://github.com/laurentdavid/moodle into MOODLE_401_STABLE 2023-09-26 11:57:14 +08:00
Laurent David 4f620f537e MDL-76713 core_availability: Fix date restriction conflict
* Use a unique ID the date nodes in the HTML tree to be able to find the current node.
* Look for nodes in the same tree "leaf" and work on conflicts in this single leaf/branch.
2023-09-25 10:16:24 +02:00
Shamim Rezaie ff0b12cfd3 Merge branch 'MDL-75928-401' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-09-25 17:52:16 +10:00
Andrew Nicols 6988b5b328 weekly release 4.1.5+ 2023-09-23 21:38:02 +08:00
Paul Holden 282523b96a MDL-79467 output: handle empty sitename display during installation.
Causes PHP warnings when null on PHP 8.1.
2023-09-22 14:34:34 +01:00
Paul Holden d77a46c804 MDL-79463 output: invert logic in url_select change event.
Avoids eslint `consistent-return` errors (because we previously only
returned from the conditional branch).
2023-09-22 10:22:59 +01:00
Simey Lameze 3b6acb99bd MDL-75928 format_week: improve get_section_dates one week calc 2023-09-22 08:48:37 +08:00
Jun Pataleta 04461bed1c Merge branch 'MDL-79323-401-enfix' of https://github.com/vmdef/moodle into MOODLE_401_STABLE 2023-09-21 15:29:23 +02:00
Ilya Tregubov 0717d4ea0e Merge branch 'MDL-79341-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-09-21 14:51:12 +08:00
Ilya Tregubov 9e62b27d12 Merge branch 'MDL-71955-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-09-21 09:18:17 +08:00
Jake Dallimore 3c7c965a80 MDL-77891 core_calendar: support display of mod iconurl
This affects:
- event_item.mustache (day view)
- event_icon.mustache (used by month_mini and month_mini and
month_detailed templates)
2023-09-21 09:17:40 +08:00
Ilya Tregubov 3dc7b4b927 Merge branch 'MDL-68712-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-09-21 08:52:38 +08:00
Shamim Rezaie 24a5b078f7 Merge branch 'MDL-78895-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-09-20 23:43:43 +10:00
Paul Holden cee1103bec MDL-68712 enrol_self: improve detection/re-use of group enrolment keys. 2023-09-20 13:31:05 +01:00
Víctor Déniz 98419ad77a MDL-79323 lang: Fix Behat tests regressions after merging en_fix strings 2023-09-20 09:59:26 +01:00
Helen Foster 7e6930f5b9 MDL-79323 lang: Import fixed English strings (en_fix) 2023-09-20 09:59:21 +01:00
Ilya Tregubov 8e931f2073 weekly release 4.1.5+ 2023-09-20 09:03:29 +08:00
Huong Nguyen 285b364a1e Merge branch 'MDL-79370-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-09-19 14:30:53 +08:00
Jake Dallimore 2a2edcde93 Merge branch 'MDL-79186-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-09-19 11:12:51 +08:00
Dale Davies ce1f9ec96a MDL-79350 core: Do not store lang in session when readonly 2023-09-18 14:31:02 +01:00
Huong Nguyen 3720396bb4 Merge branch 'MDL-79332_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-09-18 18:57:01 +07:00
Paul Holden 47941cb17a MDL-79370 user: set profile page URL earlier, avoid subsequent error.
Co-authored-by: Dominique Palumbo <domenico.palumbo@uclouvain.be>
2023-09-18 09:26:45 +01:00
Ilya Tregubov 880e7e7298 Merge branch 'MDL-79047-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-09-18 12:25:40 +08:00
Jun Pataleta 8ebf873b65 MDL-79047 grade: Use the gradebook plugin name for the page title
* Use the appropriate gradebook plugin string for the page title.
* Improve gradebook page titles set by grade_get_plugin_info() by
listing the unique identifying information for the page first
(e.g. the gradebook plugin name), followed by broader information
(Grades + Course name), separating these bits of information using the
pipe `|` character.

For more information, check out
https://www.w3.org/WAI/WCAG21/Techniques/general/G88
2023-09-18 03:47:24 +02:00
Sara Arjona 0a09e482e4 weekly release 4.1.5+ 2023-09-15 17:34:04 +02:00
Mark Johnson e6b80e155b MDL-78580 report_statistics: Prevent database deadlocks when viewing
If a quiz had a long job to calculate statstics running, this would
cause pages that may also attempt a recalculation (the statistics report
page or question bank) to load very slowly, and possibly result in a
database deadlock.

This change will firstly prevent the question bank page performing
analysis calculations at all, since these are not required for this
page, which will speed up loading and prevent deadlocks on this page.

Secondly, this adds a lock to the recalcuation process so that it cannot
run twice concurrently. This will present the user with a message to
indicate that it is waiting for a running calculation until it is
complete, and eventually it will timeout with a message and debugging.
2023-09-15 15:16:12 +01:00
Petr Skoda e42eeb62b0 MDL-79360 filter: fix nolink tag regression from MDL-77525 2023-09-15 12:45:02 +02:00
Ilya Tregubov a5f1d86040 Merge branch 'test4' of https://github.com/ilyatregubov/moodle into MOODLE_401_STABLE 2023-09-15 17:38:42 +08:00
Jun Pataleta c0ec027149 MDL-79057 grade: Remove block-level elements within buttons
Replace <div> tags within <button> tags for the selector
buttons in the grade pages.
2023-09-15 17:37:20 +08:00
Huong Nguyen 02e7ab212a Merge branch 'MDL-79283-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-09-15 17:37:19 +08:00
Jun Pataleta 312f80d1d7 Merge branch 'MDL-79291-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-09-15 17:37:19 +08:00
Luca Bösch 767e147dac MDL-79226 questions: check for UTF-8 encoding of the import file 2023-09-15 17:35:33 +08:00
Huong Nguyen c2e501e144 Merge branch 'MDL-78728-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-09-15 17:32:44 +08:00
Huong Nguyen 978fb4f1fe Merge branch 'MDL-79057-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-09-15 17:32:44 +08:00
Ilya Tregubov 748814dc61 Merge branch 'MDL-79220-401' of https://github.com/andelacruz/moodle into MOODLE_401_STABLE 2023-09-14 17:43:57 +08:00
sam marshall f6f0787fc8 MDL-79349 core_cache: Lock on multi-layer cache can behave incorrectly 2023-09-14 09:32:09 +01:00
Paul Holden 00d7ed9518 MDL-79283 core: add title to embedded iframe, for accessibility. 2023-09-14 09:26:32 +01:00
Jun Pataleta cdb81ef363 Merge branch 'MDL-79181-401' of https://github.com/snake/moodle into MOODLE_401_STABLE 2023-09-14 14:02:29 +08:00
Ilya Tregubov 8a72397e0a Merge branch 'MDL-79195-401' of https://github.com/andelacruz/moodle into MOODLE_401_STABLE 2023-09-14 09:37:53 +08:00
Paul Holden a3ddbca835 MDL-79341 core: more robust testing of user-agent curl response.
The external test file URL concerns itself only with HTTP_USER_AGENT
matching, not sending response headers, which can differ according to
HTTP protocol in use by the endpoint (1.1 vs 2).

Given the returned response code itself is irrelevant to the testcase,
there's not much benefit to asserting it and risking random failures.
2023-09-13 13:36:28 +01:00
Ilya Tregubov f154d35e13 Merge branch 'MDL-78806-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-09-13 10:55:47 +08:00
Eloy Lafuente (stronk7) 5058c46813 weekly release 4.1.5+ 2023-09-12 18:54:06 +02:00
Tim Hunt aea590716a MDL-79332 Question stats: make loading robust to bad data
We were experiencing problems caused by old stats analysis in our
database, computed when there was a bug, causing fatal errors
when they were displayed. Therefore, this code needs to be robust to that.
2023-09-12 16:59:02 +01:00
Angelia Dela Cruz 5d23cfe21f MDL-79195 core_course: Activity and resource description display behat 2023-09-12 12:20:49 +08:00
Huong Nguyen 05c1fb3794 Merge branch 'MDL-79246-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-09-12 08:51:23 +07:00
Paul Holden 0f4b831249 MDL-71955 h5p: ensure embedded player sets up $PAGE correctly.
For module context, it should set the current cm and course to
ensure consistency in navigation API.
2023-09-11 10:18:20 +01:00
Paul Holden 721b02a270 MDL-79186 task: fix evaluation of 'X/Y' cron field format.
The above syntax is defined as supported by the class, for example the
format '5/10' means:

"At every 10th <unit> from 5 through <max>."

It is analogous to '5-<max>/10'.
2023-09-11 09:22:26 +01:00
Jake Dallimore e8e5b279b0 Merge branch 'MDL-79048-401-2' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-09-11 13:00:51 +08:00
Ilya Tregubov b0a931b48a Merge branch 'm41_MDL-63539' of https://github.com/danmarsden/moodle into MOODLE_401_STABLE 2023-09-11 11:15:33 +08:00
Jake Dallimore 35e8d7517f MDL-79181 core: update LinkedIn OAuth template to use OIDC
The old method (sign in with linkedin) is deprecated:
https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/sign-in-with-linkedin

This replaces this with the new method:
https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/sign-in-with-linkedin-v2

This is not entirely OIDC compliant, however. The well known
openid-configuration isn't present at the issuer root and the 'locale'
claim contains an object instead of a string. These are worked around.
2023-09-11 10:42:35 +08:00
Jun Pataleta 007988a5f2 MDL-78806 mod_assign: Use new Behat step for checking page title 2023-09-10 10:54:18 +08:00
Jun Pataleta 9b6ed477f8 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 10:54:18 +08:00
Jun Pataleta 94efef85bb MDL-78806 behat: More lenient checking of page title
Instead of doing an exact checking of the page title in
\behat_hooks::before_step(), do a more lenient check by checking that
the page title contains the acceptance test's site name.
2023-09-09 21:28:53 +08:00
Jun Pataleta 89e853437b MDL-78806 core: Add upgrade.txt notes 2023-09-09 08:58:03 +08:00
Jun Pataleta 6664d3ebe6 MDL-78806 admin: Consistent page title during upgrade and install
* Use the page title separator constant when displaying the page title
during upgrade and installation.
* No need to display the site name during install when because it hasn't
been set at this point.
2023-09-09 08:56:50 +08:00
Jun Pataleta d7cae15e57 MDL-78806 admin: Display the most unique information in the title first
* Page titles should display the most unique information first. For
admin pages it would be useful to display the information that
is unique to the page first before the broader categories that the
page belongs to.
* Also use the new page title separator constant.
2023-09-09 08:56:50 +08:00
Jun Pataleta 49393a1608 MDL-78806 core: Remove redundant site name
MDL-78806 core: Remove redundant site name on page titles

* With the site name now being appended to the page titles, there
is no need to manually append the page titles.
2023-09-09 08:56:50 +08:00
Jun Pataleta 143a3bf38b MDL-78806 core: Append site name on page title 2023-09-09 08:56:50 +08:00
Jun Pataleta 5c9a0a80fc MDL-78806 admin: Setting for displaying site name in page title
* A new config setting `sitenameintitle` for displaying the site name
on the page has been created.
2023-09-09 08:56:50 +08:00
Jun Pataleta d1bc94905e weekly release 4.1.5+ 2023-09-08 22:35:13 +08:00
Jun Pataleta fb8885a56e Merge branch 'install_401_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_401_STABLE 2023-09-08 22:35:11 +08:00
Jun Pataleta 0c239cb841 MDL-78549 multianswer: Prevent default when clicking feedback trigger 2023-09-08 22:23:00 +08:00
Huong Nguyen f8d8553da6 Merge branch 'MDL-78549-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-09-08 22:23:00 +08:00
Andrew Nicols b952716548 MDL-79277 tool_mobile: Correct default value for empty param 2023-09-08 22:22:59 +08:00
Andrew Nicols c9c629dcf7 Merge branch 'MDL-79277-401' of https://github.com/noeldemartin/moodle into MOODLE_401_STABLE 2023-09-08 22:22:59 +08:00
Andrew Nicols d7834ce7c3 Merge branch 'MDL-79250-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-09-08 22:22:59 +08:00
Andrew Nicols 426e4043a4 MDL-79264 tiny_equation: Correct debounce method
The debounced method was being called immediately instead of being
debounced.
2023-09-08 22:22:59 +08:00
Andrew Nicols c28639acd9 Merge branch 'MDL-79264-MOODLE_401_STABLE' of https://github.com/geichelberger/moodle into MOODLE_401_STABLE 2023-09-08 22:22:59 +08:00
Andrew Nicols a164c6b5f8 Merge branch 'MDL-68435-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-09-08 22:22:58 +08:00
Andrew Nicols 54271fa749 Merge branch 'MDL-78917-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-09-08 22:22:58 +08:00
Jun Pataleta 6e0210764a MDL-79048 course: Add editing versions of course view page titles
* Create 'editing' versions of the coursetitle and coursesectiontitle
lang strings used for the page title of the course homepage and use
these when editing mode is turned on to provide immediate information
to users, especially screen reader users, the current state of the
course homepage.
2023-09-08 21:58:45 +08:00
AMOS bot c72cd82baf Automatically generated installer lang files 2023-09-08 00:10:46 +00:00
Paul Holden 11867ee8eb MDL-79291 h5p: handle content type creation errors in test generator.
If the endpoint is temporarily down and/or misbehaving, then at least
we'll a clearer failure message.
2023-09-07 15:39:05 +01:00
Jun Pataleta 35209a1d79 Merge branch 'MDL-78795-MOODLE_401_STABLE' of https://github.com/phmemmel/moodle into MOODLE_401_STABLE 2023-09-07 14:17:00 +08:00
Angelia Dela Cruz fe07a2032c MDL-79220 mod_glossary: Behat for glossary entry with attachment 2023-09-07 10:13:08 +08:00
Francis Devine 57a1df54e1 MDL-79274 assignfeedback_editpdf: Fix permission error in conversion
This was causing the adhoc task to fail with a nopermission error, when
a user was unenrolled from a course before their assignment submission
could be converted into a pdf.

Comments from MDL-56810 indicate the correct approach is to not attempt
a conversion in those cases.
2023-09-07 09:27:22 +12:00
Paul Holden 0ef9be6004 MDL-78895 mod_url: fix double encoded ampersands in URL.
Also restore the `$attributes` property (previously `$extra` prior
to 8d8af19a) to define URL opening behaviour, e.g. in popup or new
window.
2023-09-06 13:24:46 +01:00
Jun Pataleta 51655f3485 MDL-79057 gradereport_singleview: Use proper hidden attribute value
HTML attribute hidden="1" is invalid. It either needs to be set to an
empty string or use the keyword "hidden" for its value.
2023-09-06 18:39:15 +08:00
Jun Pataleta bf9a2f43ad MDL-79057 gradereport_singleview: Remove tabindex > 0 for elements
A tab index with a non-zero value messes up with the logical tab order
of a page.
2023-09-06 18:39:15 +08:00
Noel De Martin e3bf7ce603 MDL-79277 tool_mobile: Fix warning 2023-09-06 09:08:47 +02:00
Ilya Tregubov 633d64262d Merge branch 'MDL-76865-401' of https://github.com/daledavies/moodle into MOODLE_401_STABLE 2023-09-06 14:49:02 +08:00
Andrew Nicols ba4393023f Merge branch 'MDL-79205-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-09-06 12:52:51 +08:00
Andrew Nicols 608c5044ae Merge branch 'MDL-79244-401' of https://github.com/lucaboesch/moodle into MOODLE_401_STABLE 2023-09-06 12:51:23 +08:00
Ilya Tregubov d46c7851ca Merge branch 'MDL-76459_401' of https://github.com/stronk7/moodle into MOODLE_401_STABLE 2023-09-06 10:03:19 +08:00
Luca Bösch b3b813c610 MDL-79244 backup: fix typo for questioncannotberestored.
AMOS BEGIN
 MOV [questionegorycannotberestored,backup],[questioncannotberestored,backup]
AMOS END
2023-09-05 22:30:45 +02:00
Paul Holden a2628c3345 Merge branch 'MDL-76419-401' of https://github.com/rjnl/moodle into MOODLE_401_STABLE 2023-09-05 17:18:32 +01:00
Andrew Nicols 3fddb9017e weekly release 4.1.5+ 2023-09-05 22:26:37 +08:00
Andrew Nicols 4d2d641d0c Merge branch 'install_401_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_401_STABLE 2023-09-05 22:26:33 +08:00
AMOS bot a779a64656 Automatically generated installer lang files 2023-09-05 14:25:10 +00:00
Gregor Eichelberger dadf19ad3f MDL-79264 tiny: Replace hardcoded contextid
The `contextid` argument of the `tiny_equation_filter` AJAX call is
hardcoded to 1, which causes trouble if the context table does not start
with id 1.

Signed-off-by: Gregor Eichelberger <gregor.eichelberger@tuwien.ac.at>
2023-09-05 13:27:20 +02:00
Paul Holden b1abcd1f42 MDL-79205 webservice: gracefully handle invalid functions in docs. 2023-09-05 08:51:56 +01:00
Jun Pataleta 192210f90e Merge branch 'MDL-78874-401' of https://github.com/danghieu1407/moodle into MOODLE_401_STABLE 2023-09-05 12:05:42 +08:00
Andrew Nicols 48d0cf6dd9 Merge branch 'MDL-79060-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-09-05 11:23:34 +08:00
Jun Pataleta 68b1a94a2e MDL-79060 course: Use course name for the course image link 2023-09-05 11:10:59 +08:00
Andrew Nicols 0e857d3710 Merge branch 'MDL-79230-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-09-05 10:56:55 +08:00
Andrew Nicols a898eb1964 Merge branch 'MDL-79236-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-09-05 10:44:32 +08:00
Andrew Nicols d3bb9121fd Merge branch 'MDL-79191-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-09-05 10:33:40 +08:00
Jun Pataleta b22a25f208 MDL-78549 qtype_multianswer: Configure feedback popover trigger via JS
* For some reason, the `data-trigger="hover focus"` does not work when
rendering the popover via HTML. It just defaults to click, so the
feedback popover for qtype_multianswer questions does not show on hover.
Configuring the feedback popover's trigger via JS seems to work.
2023-09-05 09:36:08 +08:00
AMOS bot 31d6d42cfc Automatically generated installer lang files 2023-09-05 00:11:50 +00:00
Rajneel Totaram 765ea5dbc3 MDL-76419 calendar: Respect $CFG->autologinguests on frontpage 2023-09-05 10:43:17 +12:00
Paul Holden 3b2690ef9c MDL-78728 forms: correctly refer to outermost form element.
Read-only forms do not belong to a <form> element, so we can't refer
to that. Instead find the `.mform` element (which exists for regular
and read-only forms).
2023-09-04 16:43:59 +01:00
Paul Holden d5dbe92232 Merge branch 'MDL-79232-401' of https://github.com/marinaglancy/moodle into MOODLE_401_STABLE 2023-09-04 11:38:13 +01:00
Paul Holden 25e159d1c5 MDL-68435 customfield: fix plugin file serving callbacks.
Incorrect parameter/method call was previously serving files with
wrong filenames.
2023-09-04 10:45:28 +01:00
Jun Pataleta b7087ee353 MDL-79250 admin: Add title to external_content_banner template 2023-09-04 16:54:16 +08:00
Paul Holden ed818157bb MDL-78917 webservice: extra data in exception for missing classpath.
Include the external function classname & methodname properties in
the thrown exception, to aid diagnostic.
2023-09-04 09:03:32 +01:00
Andrew Nicols 62648c74d8 MDL-79246 gradingform_rubric: Use i_click_on for behat clicks 2023-09-04 09:13:02 +08:00
Philipp Memmel 7b105cb467 MDL-78795 core_form: Fix repeated elements JS problem
Co-authored-by: Stefan Hanauska <stefan.hanauska@csg-in.de>
2023-09-03 14:12:39 +02:00
Eloy Lafuente (stronk7) 1e3c3ec907 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:28 +02:00
Andrew Nicols 8ac8ea416a weekly release 4.1.5+ 2023-09-02 08:18:32 +08:00
Paul Holden 2cfc22350b MDL-79236 editor_tiny: define subplugin type language strings. 2023-09-01 19:25:03 +01:00
Paul Holden 5c93b9fa6d MDL-79230 editor_tiny: fix plugin info manage URL.
Co-authored-by: Meirza <meirza.arson@moodle.com>
2023-09-01 15:19:52 +01:00
Marina Glancy 0ad9a91cf0 MDL-79232 navigation: fix undefined var warning 2023-09-01 14:28:00 +01:00
Huong Nguyen 6d381af4ab Merge branch 'MDL-74828-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-09-01 10:54:43 +07:00
Huong Nguyen 6d966ab9be Merge branch 'MDL-76092-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-09-01 10:42:24 +07:00
Andrew Nicols 4ba4250301 Merge branch 'MDL-78966-401' of https://github.com/rjnl/moodle into MOODLE_401_STABLE 2023-09-01 11:32:21 +08:00
Andrew Nicols aafe17e92a Merge branch 'MDL-78179-401' of https://github.com/sarjona/moodle into MOODLE_401_STABLE 2023-09-01 11:27:05 +08:00
Ilya Tregubov d281a2bb43 Merge branch 'MDL-74429-401' of https://github.com/roland04/moodle into MOODLE_401_STABLE 2023-09-01 11:15:51 +08:00
Andrew Nicols e3b5759ca7 Merge branch 'MDL-79190-401' of https://github.com/jbs1/moodle into MOODLE_401_STABLE 2023-09-01 11:13:07 +08:00
Ilya Tregubov c526971857 Merge branch 'MDL-78745-401' of https://github.com/meirzamoodle/moodle into MOODLE_401_STABLE 2023-09-01 10:55:41 +08:00
Andrew Nicols d474c049d1 Merge branch 'MDL-79045-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-09-01 10:47:34 +08:00
Andrew Nicols c2d8196aa2 Merge branch 'MDL-77831-401' of https://github.com/mickhawkins/moodle into MOODLE_401_STABLE 2023-09-01 10:38:29 +08:00
Ilya Tregubov 432201670d Merge branch 'MDL-79202-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-09-01 10:30:36 +08:00
Ilya Tregubov 23f56c13a6 Merge branch 'MDL-79107-401-2' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-09-01 09:27:21 +08:00
Andrew Nicols 3053acf475 MDL-79107 editor_tiny: Target correct element on editor removal 2023-09-01 09:07:59 +08:00
Paul Holden 7bd76a1230 MDL-79191 grade: correct column type for the grade column (float). 2023-08-31 15:47:24 +01:00
Jun Pataleta 183901ec6d Merge branch 'MDL-79107-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-08-31 21:09:37 +08:00
Jun Pataleta e6e6c7e7b3 MDL-79107 qtype_essay: Move non_form_fields.feature under qtype_essay 2023-08-31 21:07:07 +08:00
Andrew Nicols 4ce427c2ac MDL-79107 editor_tiny: Inform Behat of field type 2023-08-31 21:07:07 +08:00
Jun Pataleta 2a6e9817f1 Merge branch 'MDL-79017-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-31 20:32:03 +08:00
Michael Hawkins 890217e23e MDL-77831 core: Updated security.txt expiry and added additional info 2023-08-31 18:29:48 +08:00
Jun Pataleta e3cee463b1 Merge branch 'MDL-77657-401-get_extra_scss_code-wrong-order' of https://github.com/danowar2k/moodle into MOODLE_401_STABLE 2023-08-31 17:50:56 +08:00
Huong Nguyen 9b0f057357 Merge branch 'MDL-79207-401' of https://github.com/andelacruz/moodle into MOODLE_401_STABLE 2023-08-31 12:27:02 +07:00
Angelia Dela Cruz 5a61806325 MDL-79207 core_course: Behat coverage for activity and resource deletion 2023-08-31 10:40:05 +08:00
Jun Pataleta 489a9fc818 MDL-79045 grade: Don't enclose grade user_heading in $OUTPUT->heading()
Do not enclose \core_grades_renderer::user_heading() in
$OUTPUT->heading() and enclose the user's name in the user heading in
<h2> tags instead.
- Having <div> inside <h2> results in errors in HTML validation.
- Enclosing the whole user heading in <h2> results in the other
elements in the user heading (Message, Add to contacts) to be announced
to screen readers which can result in confusion.
2023-08-31 09:24:08 +08:00
Sara Arjona 8ad1cceadf Merge branch 'MDL-78612-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-08-30 17:55:45 +02:00
Andrew Nicols 92d73c9dee MDL-78612 core: Wrap modal_factory.create in pendingPromise 2023-08-30 12:42:22 +08:00
meirzamoodle c2bdabd63c MDL-78745 editor_tiny: Stored text in non-entity form
TinyMCE has a default entity_encoding 'named',
which causes text with diacritic symbols to be converted to HTML entities,
e.g. pâté will be convert to p&acirc;t&eacute;
That will be a problem with the Glossary auto-linking filter if a course has a text concept like pâté,
then the filter will likely fail to get the text concept.
Changing the TinyMCE entity_encoding to 'raw' will resolve the problem.
2023-08-30 09:18:31 +07:00
Paul Holden 6625276c7f MDL-79202 tool_mobile: correctly interpolate minutes in exception. 2023-08-30 00:12:27 +01:00
Jeremy Schulz 32412f8a13 MDL-79190 theme_boost: removed obsolete comment 2023-08-29 17:11:31 -04:00
Sara Arjona 8083d74fe2 Merge branch 'MDL-72359-401' of https://github.com/HuongNV13/moodle into MOODLE_401_STABLE 2023-08-29 16:16:02 +02:00
Huong Nguyen 41722cf56e MDL-72359 core_analytics: Better handling of MAX_TIME
We are limited by both PHP's max int value and DB (cross-db) max int allowed.
We need to use the smallest one
2023-08-29 20:37:49 +07:00
Ilya Tregubov 6e162e4bcd Merge branch 'MDL-78615-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-29 11:59:56 +08:00
Huong Nguyen 3c480d41ec Merge branch 'MDL-72359-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-08-29 10:58:27 +07:00
Huong Nguyen 5f681d2ae2 Merge branch '78241-401-tiny-recordrtc-fix-availability-conditions' of https://github.com/DSI-Universite-Rennes2/moodle into MOODLE_401_STABLE 2023-08-29 10:53:38 +07:00
Huong Nguyen 527e300076 Merge branch 'MDL-78961-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-29 10:48:10 +07:00
Andrew Nicols 0356a9ba84 Merge branch 'MDL-79059-401-2' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-08-29 11:37:07 +08:00
Andrew Nicols 04dda99502 Merge branch 'MDL-79169-int-deprecate-401' of https://github.com/Peterburnett/moodle into MOODLE_401_STABLE 2023-08-29 11:21:00 +08:00
Sara Arjona 96c8cc1590 Merge branch 'MDL-78980-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-28 16:56:36 +02:00
Sara Arjona 33847c2920 Merge branch 'MDL-78707-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-28 16:40:58 +02:00
Sara Arjona 2a6000fc36 Merge branch 'MDL-78656-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-28 16:29:57 +02:00
Sara Arjona ccd2ea3d60 Merge branch 'MDL-78749-401' of https://github.com/BruceGoodGuy/moodle into MOODLE_401_STABLE 2023-08-28 14:26:13 +02:00
Sara Arjona 8baa08a6bc MDL-78179 badges: Clean SESSION when user disconnect backpack
The token information was not being properly cleared from the $SESSION.
As a result, certain errors were occurring when users attempted to
reconnect within the same session.
2023-08-28 13:34:06 +02:00
vtos db8e366ed9 MDL-61811 enrol_manual: fixed updating of 'notifyall' field
When updating a manual enrolment instance, the value of 'notifyall' field must be calculated automatically based on the value of
'expirynotify' field. The relevant plugin's method missed that, thus, the value of 'notifyall' field was never updated when
editing a manual enrolment instance and changing the 'expirynotify' setting.

A functional test has been added to test the entire behaviour of the relevant plugin's method.
2023-08-28 16:09:45 +08:00
Ilya Tregubov bc67d4491c Merge branch 'MDL-79139-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-28 15:40:51 +08:00
dor 64f63faa3a MDL-74828 media_videojs: fix loading icon position for RTL 2023-08-27 16:58:03 +08:00
Jun Pataleta 60810e78fb weekly release 4.1.5+ 2023-08-26 11:03:23 +08:00
Jun Pataleta aca404163c Merge branch 'install_401_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_401_STABLE 2023-08-26 11:03:20 +08:00
Jun Pataleta 319cc7c82c MDL-79059 core: Use full name as alt text for user picture links
When the user picture is being rendered as a link but the user's full
name is not being included in the link and the alt text turns out to be
empty, we could end up with a link without a discernible text. This is
an accessibility issue that will affect screen reader users. If this is
the case, use the full name as the user picture's alt text.
2023-08-26 10:40:34 +08:00
Jun Pataleta 9db9ff3028 MDL-79059 mod_data: Enclose preset options within a fieldset
Enclosing the radio buttons in a fieldset to provide additional context
to the purpose of the fields.
2023-08-26 10:40:34 +08:00
Jun Pataleta bd76d860c0 MDL-79059 mod_data: Fix presets accessibility issues
* Add sr-only column headers for the select and actions columns.
* Define unique IDs for the preset name links using array indices.
* Label the radio buttons via aria-labelledby attribute pointing to
the ID of the preset's link.
2023-08-26 10:40:34 +08:00
Julien Boulen c79c417ea0 MDL-78241 tiny_recordrtc: fix availability conditions 2023-08-25 18:17:11 +02:00
Jun Pataleta e12ef27c0a Merge branch 'MDL-78397-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-25 11:52:43 +08:00
Jun Pataleta e2b9b37846 Merge branch 'MDL-78386-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-25 11:38:55 +08:00
Jun Pataleta fe72c72682 Merge branch 'MDL-77988-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-25 10:35:45 +08:00
Jun Pataleta ec3723d8d0 Merge branch 'MDL-79015-401-fix' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-08-25 09:53:33 +08:00
Peter Burnett 7dac997bdc MDL-79169 admin: Fix implicit int cast in maintenance warning 2023-08-25 11:15:07 +10:00
Simey Lameze ea1cf5d927 MDL-79015 behat: make verification step more specific 2023-08-25 08:55:08 +08:00
AMOS bot 4756f9876c Automatically generated installer lang files 2023-08-25 00:11:58 +00:00
Andrew Nicols 0d3cdb0c10 Merge branch 'MDL-79075-attempt_reviewed-401' of https://github.com/leonstr/moodle into MOODLE_401_STABLE 2023-08-25 00:16:15 +08:00
Andrew Nicols 748acadd05 Merge branch 'MDL-79063-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-08-25 00:13:21 +08:00
Andrew Nicols a9a76642a4 Merge branch 'MDL-79073-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-25 00:07:20 +08:00
Andrew Nicols bf47757ef3 Merge branch 'MDL-78811-MOODLE-401' of https://github.com/aydevworks/moodle into MOODLE_401_STABLE 2023-08-25 00:02:49 +08:00
Andrew Nicols c0ab693e4e Merge branch 'MDL-78787-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-24 23:58:57 +08:00
Sara Arjona 5c7f1b85c6 Merge branch 'MDL-78688-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-24 17:35:14 +02:00
Sara Arjona d437bdafc4 Merge branch 'MDL-78965-401' of https://github.com/andelacruz/moodle into MOODLE_401_STABLE 2023-08-24 16:38:36 +02:00
danghieu1407 fc3cbd5015 MDL-78874 accessibility: Improve descriptive text for check button 2023-08-24 20:47:58 +07:00
Huong Nguyen de8180935f Merge branch 'MDL-78533-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-24 15:36:33 +07:00
Huong Nguyen 7b720a1f56 Merge branch 'MDL-78502-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-24 15:30:34 +07:00
Huong Nguyen f12e010847 Merge branch 'MDL-78302-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-24 15:26:39 +07:00
Jun Pataleta 87a9b1c8ba Merge branch 'MDL-79015-401' of https://github.com/andelacruz/moodle into MOODLE_401_STABLE 2023-08-24 15:53:14 +08:00
Angelia Dela Cruz a16624f94c MDL-78965 mod_quiz: Behat coverage for quiz with certainty-based marking 2023-08-24 15:01:50 +08:00
Jun Pataleta e25d28ff05 Merge branch 'MDL-78941-401' of https://github.com/andelacruz/moodle into MOODLE_401_STABLE 2023-08-24 13:05:49 +08:00
Angelia Dela Cruz 1b18e3328e MDL-79015 mod_lesson: Behat coverage for lesson with access restriction 2023-08-24 12:53:58 +08:00
Huong Nguyen 3a6c0872b9 Merge branch 'MDL-69187-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-24 10:39:35 +07:00
Angelia Dela Cruz 60e74092cd MDL-78941 mod_quiz: Behat coverage for student flagging quiz questions 2023-08-24 10:56:00 +08:00
Huong Nguyen 45bd1bfa49 Merge branch 'MDL-78843-401' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-08-24 08:58:03 +07:00
Sara Arjona 6f0e80bd21 Merge branch 'MDL-65363-starred-courses-only-include-enroled-courses-MOODLE_4.1' of https://github.com/stopfstedt/moodle into MOODLE_401_STABLE 2023-08-23 15:27:48 +02:00
Paul Holden c5967dd7d0 MDL-79139 check: clarify default user role action text. 2023-08-23 13:35:44 +01:00
Daniel Poggenpohl a06d7f47be MDL-72359 core: Changed MAX_TIME from 9999999999 to PHP_INT_MAX
This prevents automatic casting from int to double on 32 bit systems
(which have a maximum for integers of 2147483647)

Whilst Moodle does not support 32-bit systems any longer, this is still
worth doing to prevent future issues.
2023-08-23 14:34:32 +08:00
Andrew Nicols 19a25450d2 MDL-76092 core_backup: Unit tests for convert_params_to_values 2023-08-23 14:19:05 +08:00
Paola Maneggia 64fe594e85 MDL-76092 core_backup: Fix PHP8.0 vulnerability convert_params_to_values 2023-08-23 13:26:44 +08:00
Paul Holden ae51bda773 MDL-78787 dml: native casting to char in SQL Server driver.
Ensure the same is used during concatentation to prevent truncation
of data, which was previously set at 255 characters per field.
2023-08-23 00:55:18 +01:00
Paul Holden 367f2bf707 MDL-78961 admin: correct smtppass preset configuration name. 2023-08-22 18:27:36 +01:00
Paul Holden f7b3caac2c MDL-78656 output: display menu item titles in primary navigation.
Since custom menu items were merged into the primary navigation/more
menu as part of 56c34d71 and related work, the "title" attribute of
each custom menu item was lost.
2023-08-22 17:30:04 +01:00
Andrew Nicols 6dcb455973 MDL-69187 core_file: Unit test for file_get_typegroup string types 2023-08-22 17:10:36 +01:00
Paul Holden ec92edec88 MDL-78688 admin: define accepted filetype for uploaded preset file. 2023-08-22 15:32:14 +01:00
Sara Arjona 4adae8e489 weekly release 4.1.5+ 2023-08-22 15:51:02 +02:00
Paul Holden 8034ad8be2 MDL-69187 files: normalize retrieval of mimetypes from groups array.
Ensure that the following both return consistently, so that filepicker
form elements behave the same for each when defining "accepted_types":

    '.html, .txt'
    ['.html', '.txt']
2023-08-22 09:56:17 +01:00
Paul Holden 08344a8c4b MDL-79073 question: detect missing context when deleting question. 2023-08-22 09:45:25 +01:00
Paul Holden 434e5af241 MDL-78386 search: specify correct parameter type for search area. 2023-08-22 08:12:07 +01:00
Paul Holden f9aa8a5d75 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:45 +01:00
Leon Stringer fe3054d05b MDL-79075 quiz: Fix transposed user IDs
In the description of "Quiz attempt reviewed" events the user IDs of
the reviewer (typically the teacher) and the reviewee (typically the
student) were the wrong way round.
2023-08-21 15:50:28 +01:00
Paul Holden 5af5c5d0a6 Merge branch 'MDL-79071-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-08-21 15:32:44 +01:00
Paul Holden 194458b229 MDL-78707 forms: improve form container collapsing mechanism.
By using a more explicit selector for matching containers we avoid
previous problems such as incorrect count, and collapsing of elements
that had the same class name.
2023-08-21 12:38:57 +01:00
Paul Holden 4538b46a96 MDL-78397 course: update module name using API after duplicating.
This ensures that various ancillary tasks are also performed (such
as ensuring the gradebook item name matches).
2023-08-21 10:56:45 +01:00
Paul Holden e4ba5d276d MDL-78533 grade: relax param type of itemname in external structures.
Ensure it conforms to the same format as allowed for course modules.
2023-08-21 10:54:24 +01:00
Paul Holden 79e12570d9 MDL-78502 grade: consider only those export formats user can access. 2023-08-21 10:47:06 +01:00
Paul Holden b971d76406 MDL-78615 cache: display failure notifications deleting lock/store. 2023-08-21 10:45:23 +01:00
Huong Nguyen 4a3603d49c Merge branch 'MDL-65887-401' of https://github.com/lucaboesch/moodle into MOODLE_401_STABLE 2023-08-21 10:57:48 +07:00
Stefan Topfstedt e4b3b1c79b MDL-65363 block_starredcourses: only list enroled courses
Filter out any starred courses that the logged-in user is not enroled in.
2023-08-18 11:06:46 -07:00
Daniel Poggenpohl bcf9d4bf68 MDL-77657 theme: Corrected return type 2023-08-18 16:21:02 +02:00
Daniel Poggenpohl 92ee1c561e MDL-77657 theme: Fix get_pre_scss_code load order
This led to problems with grandchild themes,
depending on their direct parent's prescsscallback.
2023-08-18 16:21:02 +02:00
Daniel Poggenpohl 862e1e10c2 MDL-77657 theme: Fix get_extra_scss_code load order
This led to problems with grandchild themes,
depending on their direct parent's extrascsscallback.
2023-08-18 16:21:02 +02:00
Jun Pataleta 96e0a8b04d MDL-79071 course: An empty alt text is needed for decorative images 2023-08-18 17:03:54 +08:00
Jun Pataleta 8fe9f8579d MDL-79063 course: Use .text-body for 'disabled' elements in move modal
Using the .disabled class for the course module or section that is
being moved does not have sufficient colour contrast against the
background, especially when it is being highlighted.
So instead of using .disabled, just use Bootstrap classes .text-body
and .font-italic which renders the cm/section to be moved in normal
font colour while preserving its italicised look.
2023-08-18 16:35:48 +08:00
Jun Pataleta 23d6705ad6 MDL-79063 theme_boost: Match .disabled font colour with .text-muted
* For consistency
* The font colour for .text-muted meets a contrast ratio of 4.69:1
which meets WCAG 2.1 Level AA success criterion for minimum contrast.
2023-08-18 16:29:56 +08:00
Luca Bösch 2baa3bb4a5 MDL-65887 workshop: Recalculate + fill the 'Grade for assessment' column 2023-08-18 08:58:43 +02:00
Ilya Tregubov f12e1b82a0 weekly release 4.1.5+ 2023-08-18 11:23:59 +08:00
Dan Marsden e3fb15de88 MDL-63539 mod_scorm: AICC multi-row content not saving correctly. 2023-08-18 14:45:08 +12:00
Eloy Lafuente (stronk7) 4f6df8a5b9 Merge branch 'MDL-78684-401-fix-2' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-08-17 19:56:46 +02:00
Simey Lameze fd046bf6d6 MDL-78684 behat: fix behat failures 2023-08-17 21:01:05 +08:00
Jun Pataleta 527a11e48c Merge branch 'MDL-78938-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-08-17 09:58:31 +08:00
Andrew Nicols c0b521386c Merge branch 'MDL-77695-401' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-08-16 23:23:26 +08:00
Andrew Nicols b2780aa6f6 MDL-76557 enrol_lti: Fix unit test docs and convert to provider 2023-08-16 23:04:14 +08:00
ishatalkin 0608452503 MDL-76557 enrol_lti: sync_grades accepts status codes 200,201,202,204 2023-08-16 23:04:11 +08:00
Andrew Nicols d6a9f01cc9 Merge branch 'MDL-78684-401' of https://github.com/andelacruz/moodle into MOODLE_401_STABLE 2023-08-16 22:44:35 +08:00
Andrew Nicols 558d836861 MDL-77381 qengine: Correct coverage for new test 2023-08-16 22:40:16 +08:00
Andrew Nicols 0d82ce2629 Merge branch 'MDL-77381-MOODLE_401_STABLE' of https://github.com/ScottVerbeek/moodle into MOODLE_401_STABLE 2023-08-16 22:40:12 +08:00
Simey Lameze 896763076e MDL-77695 behat: use automatic completion to award badges 2023-08-16 21:16:02 +08:00
Andrew Nicols 7e77e66350 MDL-78938 course: Wrap manual completion toggle in pending
This commit makes two changes to reduce random failures in behat:
- wrap the toggling of manually configured completion in pendingjs
- set the loading spinner content without forcing the completion toggle
  ws to wait for the loading spinner to update.
2023-08-16 20:05:24 +08:00
Andrew Nicols c2af464083 MDL-78938 report_progres: Wrap completion status update in pending 2023-08-16 20:05:24 +08:00
Mikel Martín 09500beae2 MDL-74429 core_form: Fix element url input overflow 2023-08-16 12:41:24 +02:00
Jun Pataleta 152acdd72f Merge branch 'MDL-78505/401' of https://github.com/skodak/moodle into MOODLE_401_STABLE 2023-08-15 22:21:05 +08:00
Petr Skoda 3847e0ba04 MDL-78505 core: stop mangling existing Mardown in text editors
The problem is that HTML Purifier is not compatible with Markdown,
that means we cannot sanitise Markdown texts before editing.

Luckily Markdown has to use plain text editor which does not have
XSS problems.

The only tiny downside is that Markdown cannot be allowed
in "trust text" areas any more.
2023-08-15 14:27:07 +02:00
Petr Skoda 05ffcf0579 MDL-78505 Revert "MDL-32114 form: markdown must be preserved on saving post"
This partially reverts commit 4a31dd69d6.
2023-08-15 14:27:07 +02:00
Huong Nguyen baed2a1aa1 Merge branch 'MDL-71909-m401' of https://github.com/NeillM/moodle into MOODLE_401_STABLE 2023-08-15 16:33:32 +07:00
Dale Davies ddd260ffa4 MDL-76865 core: Check lock state before attempting to acquire a lock 2023-08-14 12:36:45 +01:00
Sara Arjona b8fa7e0a0f Merge branch 'MDL-78761-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-14 10:58:56 +02:00
Sara Arjona 7fbb02cadc Merge branch 'MDL-78700-tidy_no_clean-401' of https://github.com/leonstr/moodle into MOODLE_401_STABLE 2023-08-14 09:12:34 +02:00
Jun Pataleta 954f779c5d Merge branch 'MDL-78927-m401' of https://github.com/sammarshallou/moodle into MOODLE_401_STABLE 2023-08-14 10:19:00 +08:00
Shamim Rezaie b156b18c72 Moodle release 4.1.5 2023-08-11 23:20:36 +10:00
Paul Holden f2f4c098ee MDL-78980 admin: ensure all values for multiselect presets are used.
Previously, just the first value was selected. Instead defer to the
implementation in the base class for `set_value`.
2023-08-11 11:22:35 +01:00
Jun Pataleta 88459bba94 MDL-78983 core: Preserve default behaviour of flipping question icon
Introduce a lang string `questioniconfollowlangdirection` that will
allow the current behaviour of displaying the question mark icon
in RTL languages in the same manner as the current language.
2023-08-11 16:11:05 +07:00
Huong Nguyen b201bcb878 Merge branch 'MDL-78983-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-08-11 12:53:50 +07:00
Jun Pataleta b504d19c12 MDL-78983 core: Fix question mark icon direction flipping
This fixes the changes made in MDL-75047:
* Change `thisicondirection` langconfig string to a more specific one
  like `questionicondirection`.
* Use existing direction string value `ltr` for the value of
  `questionicondirection`. Also add a comment to at least provide some
  form of documentation for it.
* Improve the logic for applying the horizontal flipping class for the
  question icon:
  - Check first if the icon is a question icon
  - Flip the icon if `questionicondirection` is set to `rtl`.
2023-08-11 11:48:10 +08:00
Huong Nguyen 1c13aba0a2 weekly release 4.1.4+ 2023-08-10 22:50:53 +07:00
Huong Nguyen 8a2c1509d7 Merge branch 'install_401_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_401_STABLE 2023-08-10 22:50:51 +07:00
sam marshall b098b9d61b MDL-78927 core_user: Profile page missing breadcrumbs if no id= 2023-08-10 15:52:42 +01:00
meirzamoodle 033f742e4a MDL-78685 auth_oauth2: Added logged-in status check 2023-08-10 18:44:29 +07:00
Jun Pataleta 9e665137d4 Merge branch 'MDL-78962_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-08-10 18:44:29 +07:00
Jun Pataleta 53b33f7b0e Merge branch 'MDL-77817-401' of https://github.com/meirzamoodle/moodle into MOODLE_401_STABLE 2023-08-10 18:44:27 +07:00
Jun Pataleta 7d7c342a2c Merge branch 'MDL-78674-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-08-10 18:44:14 +07:00
Sara Arjona ce77250706 Merge branch 'MDL-76123-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-10 18:44:14 +07:00
Jun Pataleta 770b11c3d9 Merge branch 'MDL-77378_401_v3' of https://github.com/TomoTsuyuki/moodle into MOODLE_401_STABLE 2023-08-10 18:44:14 +07:00
Michael Hawkins a18da528cc MDL-78763 tool_policy: Initialise returnurl as a moodle_url in viewall 2023-08-10 18:44:14 +07:00
Paul Holden d4cec28c30 MDL-78792 message: access checks in processor fragment callback. 2023-08-10 18:44:14 +07:00
raortegar 48dc9e6582 MDL-74289 lib: Improve the proxy bypass matching 2023-08-10 18:44:10 +07:00
Rajneel Totaram 138c3bcb99 MDL-78966 theme: Fix site event icon size in upcoming events block 2023-08-10 19:37:48 +12:00
Simey Lameze 1f43b863f3 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:05:16 +08:00
Jun Pataleta 8390f1a03d MDL-78674 calendar: No need to call get_course_and_cm_from_instance()
The course ID and CM id can already be fetched from the event object.
2023-08-10 09:38:07 +08:00
Santosh Nagargoje 2713f2ea17 MDL-78674 calendar: Added fix to rebuild module cache in calendar 2023-08-10 09:38:07 +08:00
Tim Hunt e726198d4d MDL-78962 core/loadingicon: remove jQuery requirement in the API 2023-08-09 21:20:32 +01:00
Paul Holden a11938293e MDL-78647 files: safer unserializing of file reference data. 2023-08-09 04:50:21 +00:00
Shamim Rezaie cfe33b82e3 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 04:50:21 +00:00
Matt Porritt cd95c30cb5 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 04:50:21 +00:00
Rajneel Totaram da05f15e3b MDL-71728 mod_quiz: check if user can access this page 2023-08-09 04:50:21 +00:00
Huong Nguyen efdf0e48c8 Merge branch 'MDL-78904-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-08-09 11:43:24 +07:00
Huong Nguyen 00e6ac4ad8 Merge branch 'MDL-75047-MOODLE_401_STABLE' of https://github.com/SysBind/moodle into MOODLE_401_STABLE 2023-08-09 11:30:49 +07:00
Jun Pataleta 4de338f002 Merge branch 'MDL-78872-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-09 12:10:16 +08:00
Ilya Tregubov 4732fa0b13 Merge branch 'MDL-78714-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-08-09 12:05:24 +08:00
Huong Nguyen 93ab65454a Merge branch 'MDL-78235-401' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-08-09 10:43:35 +07:00
Andrew Nicols d8c911ccb4 MDL-78714 editor_tiny: Disable HTML Sanitisation in TinyMCE
This is in keeping with other Editors such as Atto and resolves an issue
where DOM Purification incorrectly identifies HTML-like string content
as an HTML tag with a JS variable.

Moodle already performs XSS sanitisation using HTML Purifier in PHP.
2023-08-09 10:21:39 +08:00
Andrew Nicols e8eb8943e1 MDL-78714 editor_tiny: Add xss_sanitize option to TinyMCE
To address a potential data loss issue, a feature introduced in TinyMCE
6.4.0 to disable client-side XSS sanitisation must be backported.
2023-08-09 10:21:39 +08:00
Andrew Nicols 737f657bad MDL-78714 editor_tiny: Move TinyMCE import instructions to correct path 2023-08-09 09:05:23 +08:00
Huong Nguyen 8ce08d5cd1 Merge branch 'MDL-78492_aurora_mysql_rowformat_401' of https://github.com/mark-webster-catalyst/moodle into MOODLE_401_STABLE 2023-08-08 21:43:36 +07:00
Sara Arjona e250a61e40 Merge branch 'MDL-78770-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-08-08 13:55:40 +02:00
Sara Arjona bc9138ecba Merge branch 'MDL-77658-MOODLE_401_STABLE' of https://github.com/SysBind/moodle into MOODLE_401_STABLE 2023-08-08 13:29:53 +02:00
Sara Arjona fe7a12a9fd Merge branch 'MDL-78559-401' of https://github.com/rmady/moodle into MOODLE_401_STABLE 2023-08-08 13:02:06 +02:00
Paul Holden 75de5704de MDL-76123 course: multilingual module icon alt text attribute. 2023-08-08 08:29:27 +01:00
Jun Pataleta 1347048659 Merge branch 'MDL-78896-401-enfix' of https://github.com/vmdef/moodle into MOODLE_401_STABLE 2023-08-08 15:29:26 +08:00
AMOS bot 86ff18c9fe Automatically generated installer lang files 2023-08-08 00:10:31 +00:00
ScottVerbeek 59f7404d8b MDL-77381 question engine: don't query empty arrays 2023-08-08 09:04:00 +10:00
Rodrigo Mady 961c7ef3e0 MDL-78559 mod_chat: Fix chat report loading with TeX filter 2023-08-07 09:55:16 -03:00
Helen Foster 7b4d19308e MDL-78896 lang: Import fixed English strings (en_fix) 2023-08-07 11:31:43 +01:00
Paul Holden 5305ddc0a4 MDL-77988 dml: clarify logic when dropping plugin tables.
Comparison of method void return within a conditional didn't make
sense, and the aforementioned method throws an exception on error
anyway which would halt execution.
2023-08-07 10:46:47 +01:00
Paul Holden ecee875be0 MDL-78302 mod_forum: fix course module grade button parameters. 2023-08-07 10:45:21 +01:00
Ilya Tregubov c9143efd7e Merge branch 'MDL-78800_401' of https://github.com/stronk7/moodle into MOODLE_401_STABLE 2023-08-07 16:58:26 +08:00
Ilya Tregubov 52b234d69a Merge branch 'MDL-78550-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-08-07 11:34:49 +08:00
chen levy 896e87228c MDL-77658 theme: Fixed RTL manage course categories menu
fixed course checkboxes that appears on the categories menu on RTL
2023-08-06 09:54:23 +03:00
Eloy Lafuente (stronk7) 772236e08c MDL-78800 composer: Bump dependencies to current ones
This bumps direct dependencies to current ones:

- phpunit: 9.5.x No updates here, there is the 9.6.x series
  available but a lot of deprecation warnings have been
  introduced there without any alternative to use. See:
  - https://github.com/sebastianbergmann/phpunit/issues/5160
  - https://github.com/sebastianbergmann/phpunit/issues/5062
  - ...
  While that will be handy to prepare ourselves to PHPUnit 10
  in some months... we cannot force everybody to jump to 9.6.x
  because that will make a lot of tests to start emitting
  warnings.
  So we stay with PHPUnit 9.5.x for the life of this branch.
- mink-phpwebdriver: 1.2.1 No updates here, just changed the
  constraint because we cannot advance to 1.3.x yet, there is
  a change there causing some app tests to fail. See:
  - https://github.com/oleg-andreyev/MinkPhpWebDriver/pull/81
  So we stay with 1.2.x until that issue is fixed/clarified,
  only then we'll review the status.
- behat: 3.12.x => 3.13.x

And also, automatically, a bunch of 2nd and deepest dependencies.

Generated with php74 that is the lowest php version supported
by this branch and, also, by some of the dependencies, as per
documented @ https://moodledev.io/general/development/tools/composer

Worth mentioning behat/mink-goutte-driver, that we should move
to mink-browserkit-driver, but that's out from this issue scope.
2023-08-05 11:17:10 +02:00
Sara Arjona 614563082b weekly release 4.1.4+ 2023-08-04 12:40:10 +02:00
Jun Pataleta 0975a83b7a MDL-78904 user: Remove non-existent require
* And enclose context parameter in an array.
2023-08-04 14:42:49 +08:00
meirzamoodle f8691f2e28 MDL-77817 editor_tiny: Fix menu and dialogue window position
The boost theme makes the TinyMCE editor rendered in a scrollable container,
scrolling the editor’s container will cause TinyMCE UI elements to be detached from the anchor.
Therefore, to keep the tinyMCE menu in the correct position,
adjustments must be made on the page drawers style.

When using TinyMCE editor in Safari browsers, a problem may occur where the dialogue
windows (such as modal dialogs) overlap with page drawers due to a specific behavior
in Safari's rendering. This function addresses the issue by adjusting the CSS overflow
property of the page drawers, ensuring they do not obscure the dialogue windows.
2023-08-03 11:40:12 +07:00
Jun Pataleta d25c0c5448 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:32 +08:00
Ilya Tregubov cf393e9aae Merge branch 'MDL-78866-401' of https://github.com/danghieu1407/moodle into MOODLE_401_STABLE 2023-08-03 09:39:17 +08:00
Ilya Tregubov e3dd019685 Merge branch 'MDL-78742-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-03 09:25:28 +08:00
Sara Arjona ceb153b1c7 Merge branch 'MDL-78460-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-02 08:51:13 +02:00
Jun Pataleta 1967ccccc0 Merge branch 'MDL-78498-401' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-08-02 11:22:58 +08:00
Paul Holden 58836d7143 MDL-78872 grade: fix external class execute method visibility. 2023-08-02 02:18:51 +01:00
Sara Arjona d04d701c18 Merge branch 'MDL-78703-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-01 13:45:11 +02:00
danghieu1407 1b4ee84aee MDL-78866 question: question_created trigger pre-saving extra fields 2023-08-01 15:59:57 +07:00
Simey Lameze 33d829716e 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 16:08:10 +08:00
Angelia Dela Cruz 73a08e3ccd 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 16:08:10 +08:00
Angelia Dela Cruz efb38571e5 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:55:33 +08:00
Andrew Nicols 8c8cb002c0 MDL-78632 core: Update upgrade versions 2023-08-01 09:32:36 +08:00
Andrew Nicols ea6adbc72e Merge branch 'M401-MDL-78632' of https://github.com/marcusboon/moodle into MOODLE_401_STABLE 2023-08-01 09:31:42 +08:00
Tomo Tsuyuki 2ba3b8b27e MDL-77378 qtype_multianswer: Fix division by zero errors 2023-08-01 11:26:44 +10:00
Michael Aherne affda87228 MDL-78235 userprofile: Check for defaultdata with isset(). 2023-07-31 19:33:06 +08:00
Jun Pataleta ebe27cf615 MDL-78550 core: Ensure spacing between more menu item attributes 2023-07-28 17:33:07 +08:00
Jun Pataleta 27f453d6e9 MDL-78550 grade: Hide empty fillers from the accessibility tree
* And remove the title attribute for the filler as it is unnecessary.
2023-07-28 17:28:58 +08:00
Jun Pataleta b98fb9032c MDL-78550 grade: Avoid rendering an empty <h2> heading 2023-07-28 17:28:57 +08:00
Jun Pataleta e953e71c54 MDL-78550 grade: Fix HTML validator errors
* Remove invalid "text" attribute in <td> elements
* Use proper id value for grade category checkboxes.
2023-07-28 17:28:56 +08:00
Marcus Boon 3295c4bc1d MDL-78632 filetypes: Introduce yaml file type 2023-07-28 15:28:15 +10:00
Ilya Tregubov 13553c25da weekly release 4.1.4+ 2023-07-28 10:44:15 +08:00
Ilya Tregubov c9fc2bfeb4 Merge branch 'MDL-78782-401' of https://github.com/ferranrecio/moodle into MOODLE_401_STABLE 2023-07-27 10:00:01 +08:00
Ferran Recio dcd7261175 MDL-78782 behat: optimize with editing mode step
The current I am on course homepage with editing mode loads twice the
course page. This patch prevents this from happening by going directly
to editmode.php.
2023-07-26 16:19:57 +02:00
Neill Magill 612b86e193 MDL-71909 assignfeedback_editpdf: Do not queue conversions when not on
Before this change conversion tasks would be queued for assignments that
did not have the pdf annotation method enabled.

The change will also prevent queing when the plugin is disabled.
2023-07-26 09:16:48 +01:00
Huong Nguyen bca23d5477 Merge branch 'MDL-78618_401' of https://github.com/larsbonczek/moodle into MOODLE_401_STABLE 2023-07-26 14:22:42 +07:00
Mark Webster 28aaa93df9 MDL-78492 dml: Better support for auroramysql
Aurora MySQL does not support row format COMPRESSED and falls back
to COMPACT if you try to use it, cuasing column size too large
errors if you try to use it with utf8mb4 collation.
2023-07-25 11:57:38 +01:00
Alex Yeung 356e1d8f31 MDL-78811 check: fix duplicate column contextid warning 2023-07-24 22:49:52 +01:00
Leon Stringer a283cf8fbe MDL-78700 filter_tidy: Stop using 'clean'
When libtidy removed option 'drop-font-tags' the docs said to use the
'clean' option instead (see MDL-69951).  However, 'clean' replaces
legacy style information with classes, the corresponding CSS added in
<head>.  With 'show-body-only' (used because we're inserting an HTML
fragment mid-way through <body>) that <head> with its CSS is omitted.
So 'clean' with 'show-body-only' removes legacy style information,
rather than tidying it. Consequently we now drop the 'clean' option.
This means <font> tags are no longer dropped as libtidy currently has
no equivalent to the removed 'drop-font-tags' functionality.
2023-07-24 17:31:53 +01:00
Paul Holden 9437e82a31 MDL-78761 enrol: correct enrolment suspended state report filter. 2023-07-21 17:13:16 +01:00
Huong Nguyen 533ce56743 weekly release 4.1.4+ 2023-07-21 20:56:32 +07:00
Huong Nguyen e677d31003 Merge branch 'install_401_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_401_STABLE 2023-07-21 20:56:30 +07:00
Paul Holden 5f35d838d1 MDL-78742 tool_uploadcourse: configure show activity dates value. 2023-07-20 16:28:41 +01:00
Jun Pataleta 61d3f1345a MDL-78770 tiny_recordrtc: Use proper window.console.warn() function 2023-07-20 14:32:52 +08:00
Jun Pataleta 9cb8b3fa50 MDL-78770 atto_recordrtc: Use proper window.console.warn() function 2023-07-20 14:23:01 +08:00
Huong Nguyen 8eb8fb844a Merge branch 'MDL-78525-401' of github.com:HuongNV13/moodle into MOODLE_401_STABLE 2023-07-20 10:58:06 +07:00
Huong Nguyen 792530cfe6 MDL-78525 core: Update upgrade.txt for count_words and count_letters 2023-07-20 10:54:57 +07:00
Khoa Nguyen Dang 1408e3b964 MDL-78749 Accessibility\Quiz: Previous attempt table caption missing 2023-07-20 10:15:49 +07:00
Ilya Tregubov 974cbce6e8 Merge branch 'MDL-76854-subscription_deleted-401' of https://github.com/leonstr/moodle into MOODLE_401_STABLE 2023-07-20 10:49:55 +08:00
Huong Nguyen 9c47f4e461 Merge branch 'MDL-78525/401' of https://github.com/skodak/moodle into MOODLE_401_STABLE 2023-07-20 09:04:31 +07:00
Ilya Tregubov cbadd18581 Merge branch 'MDL-75115-401' of https://github.com/meirzamoodle/moodle into MOODLE_401_STABLE 2023-07-20 09:41:33 +08:00
Andrew Nicols 97c95140c3 Merge branch 'MDL-78716-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-07-20 00:29:09 +08:00
Andrew Nicols 0311f95fee Merge branch 'MDL-78715-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-07-20 00:17:33 +08:00
Andrew Nicols f852e35976 Merge branch 'MDL-77645-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-07-20 00:11:59 +08:00
Andrew Nicols 05c485dc97 Merge branch 'MDL-78704-401' of https://github.com/rjnl/moodle into MOODLE_401_STABLE 2023-07-19 21:57:52 +08:00
AMOS bot 36918dfbfc Automatically generated installer lang files 2023-07-19 00:11:00 +00:00
Shamim Rezaie d0bef0b899 Merge branch 'MDL-78564-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-07-17 20:36:00 +10:00
Leon Stringer ad5e75ddf1 MDL-76854 tool_monitor: subscription_deleted ctx
Fix course context for subscription_deleted event when deleting rules
with multiple subscriptions.
2023-07-15 08:08:22 +01:00
Paul Holden ba6143d1ac MDL-78703 behat: fix HTTP GET method capitalization on redirect. 2023-07-15 01:00:07 +01:00
Paul Holden 0c7a684fcc MDL-78715 payment: prevent action menus flowing under container. 2023-07-14 17:17:00 +01:00
Paul Holden 587ea4d3f3 MDL-78716 course: fix category idnumber updating logic.
Where only the case of the idnumber field was being updated, we
triggered an exception because checking for an exising idnumber
was not excluding the current category (i.e. the one being updated).
2023-07-14 15:14:59 +01:00
Paul Holden f6583c57c8 MDL-78460 mod_forum: correctly render timed post label information. 2023-07-14 10:15:40 +01:00
Petr Skoda f25ad012c5 MDL-78525 core: fix word and character counting 2023-07-14 08:44:15 +02:00
Ilya Tregubov 272fdb321a weekly release 4.1.4+ 2023-07-14 09:25:40 +08:00
Rajneel Totaram 962a3f866c MDL-78704 course: Render unescaped HTML for activity dates 2023-07-14 10:17:04 +12:00
Tim Hunt 0a6f40cb21 MDL-76757 delete questions: fix message generation logic
The order was getting scrambled.
2023-07-13 21:44:04 +02:00
Jun Pataleta 85232e735d Merge branch 'MDL-76046-401' of https://github.com/stevandoMoodle/moodle into MOODLE_401_STABLE 2023-07-13 11:19:30 +08:00
Huong Nguyen 90c15c62f4 Merge branch 'MDL-75195-401' of https://github.com/raortegar/moodle into MOODLE_401_STABLE 2023-07-13 09:57:23 +07:00
Huong Nguyen dcd80cff04 Merge branch 'MDL-76757-401' of https://github.com/danghieu1407/moodle into MOODLE_401_STABLE 2023-07-13 09:46:59 +07:00
Ilya Tregubov e0dc36f27e Merge branch 'mdl-7133-401' of https://github.com/juancs/moodle into MOODLE_401_STABLE 2023-07-13 10:31:28 +08:00
Huong Nguyen 73cce7054c Merge branch 'MDL-77990-401' of https://github.com/snake/moodle into MOODLE_401_STABLE 2023-07-13 09:22:19 +07:00
Jake Dallimore a6b769bddd Merge branch 'MDL-77912_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-07-13 10:09:45 +08:00
Andrew Nicols 94080683ba Merge branch 'MDL-78157-401' of https://github.com/golenkovm/moodle into MOODLE_401_STABLE 2023-07-13 09:48:19 +08:00
Andrew Nicols 10cdb9c72d Merge branch 'MDL-78556-401' of https://github.com/danghieu1407/moodle into MOODLE_401_STABLE 2023-07-13 09:29:04 +08:00
Andrew Nicols 57af739134 Merge branch 'MDL-76996_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-07-13 09:25:35 +08:00
Ilya Tregubov 8cf9b77cdb Merge branch 'MDL-73213_401' of https://github.com/pedrojordao/moodle into MOODLE_401_STABLE 2023-07-13 09:18:31 +08:00
Sara Arjona 07ef1c6aa5 Merge branch 'MDL-78673-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-07-12 18:18:13 +02:00
Andrew Nicols b3820bdc44 Merge branch 'MDL-77450-401' of https://github.com/andelacruz/moodle into MOODLE_401_STABLE 2023-07-13 00:10:14 +08:00
Andrew Nicols a80a370e0a Merge branch 'MDL-78676-401' of https://github.com/sarjona/moodle into MOODLE_401_STABLE 2023-07-13 00:06:36 +08:00
Sara Arjona 4fbc7a28ae Merge branch 'MDL-78455-401' of https://github.com/andelacruz/moodle into MOODLE_401_STABLE 2023-07-12 17:37:14 +02:00
Paul Holden 0202597261 MDL-77645 course: ensure active enrolments are considered for drawer.
Otherwise the enrolment index page tries to load the course index
drawer, which doesn't exist at this point and triggers exceptions in
the editor module.

Co-authored-by: Tim Volckmann <tim.volckmann@mastersolution.com>
2023-07-12 14:35:33 +01:00
Tim Hunt c589ced794 MDL-76996 question bank: fix errors when qbank_statistics is disabled 2023-07-12 11:47:37 +01:00
Sara Arjona 4abfc497e2 Merge branch '76319-gradebook-add-missing-continue-button-401' of https://github.com/DSI-Universite-Rennes2/moodle into MOODLE_401_STABLE 2023-07-12 08:28:15 +02:00
Miri Lipson 03a7d208f9 MDL-75115 theme_boost: Fix Bootstrap tooltips in RTL mode 2023-07-12 09:11:33 +07:00
Tim Hunt 0ece3bcfc1 MDL-77912 questions: make multi-choice stats calc robust to bad data 2023-07-11 16:57:45 +01:00
raortegar f904f52240 MDL-75195 core: Added supportemail option to install_database.php 2023-07-11 11:13:49 +02:00
danghieu1407 173da3666c MDL-78556 tablelib: flexible_table should support caption tag 2023-07-11 14:18:54 +07:00
Angelia Dela Cruz 9a55a771c1 MDL-77450 Behat: Behat cleanup and optimisation 2023-07-11 14:22:35 +08:00
Ilya Tregubov c057bc092d Merge branch 'MDL-67852_MOODLE_401_NEW' of https://github.com/aydevworks/moodle into MOODLE_401_STABLE 2023-07-11 11:12:16 +08:00
Ilya Tregubov 5cecf47fd1 Merge branch 'MDL-77690-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-07-11 09:52:05 +08:00
Ilya Tregubov f4e0c7d6bf Merge branch 'MDL-75359-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-07-11 09:30:14 +08:00
Julien Boulen 231577e4b0 MDL-76319 gradebook: add continue button after csv grades import error 2023-07-10 10:18:14 +02:00
danghieu1407 cf0b6e06e2 MDL-76757 Question bank: Can not delete the question completely 2023-07-10 14:34:32 +07:00
Andrew Nicols 43d00eaeba MDL-78673 grade: Switch test to use generators 2023-07-10 11:30:14 +08:00
Andrew Nicols 23c2c5d08e MDL-78673 grade: Switch to behat navigation steps 2023-07-10 11:30:14 +08:00
Andrew Nicols 7961e169b1 MDL-78673 grade: Address random failure due to toast 2023-07-10 11:30:09 +08:00
Andrew Nicols e0c28bebcb MDL-78673 behat: Allow plugins to define their expansion of > 2023-07-10 11:29:39 +08:00
Andrew Nicols 51dc88fa84 Merge branch 'MDL-77180-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-07-09 22:14:37 +08:00
Alex Yeung 236f4654c0 MDL-67852 tool_dataprivacy: Fix security checks 2023-07-09 14:50:10 +01:00
Juan Segarra Montesinos 031e583402 MDL-71133 mod_assign: Grade decimals missing with marking workflow 2023-07-09 08:12:22 +02:00
Sara Arjona e8897600a1 MDL-78676 mod_data: Check completion rules properly
The completion_rule_enabled() method was not checking all the fields
and, in some cases, it was returning false (because it was not checking
that "Count of entries" field was enabled).
2023-07-07 18:28:23 +02:00
Paul Holden e9191587be MDL-77180 customfield: allow entry of formatted category names.
Change the param type of the category name when editing to allow
for entry of multilang tags, the formatting of which is already
supported when returning category name.

Co-authored-by: Hiroto Kagotani <hiroto.kagotani@gmail.com>
2023-07-07 14:59:54 +01:00
Paul Holden 73939586b6 MDL-75359 reportbuilder: fixes for custom/user profile field elements.
Ensures cross-DB compatibility for all types of both custom and user
profile fields, specifically when they're filtered and/or aggregated.

Implement stress testing of both via appropriate report sources.
2023-07-07 14:43:29 +01:00
Ilya Tregubov f29f757f5f weekly release 4.1.4+ 2023-07-07 11:52:28 +08:00
Ilya Tregubov 5246118a3b Merge branch 'install_401_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_401_STABLE 2023-07-07 11:52:26 +08:00
Pedro Jordao 2ace3d54dc MDL-73213 autocomplete: keep selected value when the state changes.
The selected value of the dropdown was being cleared when the dropdown
was opened, this was causing an error when submitting the form if the
field was required. The main cause was that we were emptying the
select before loading new values, this solution was created because
of an issue where we could not deselect values if the list was
reloaded. To fix this problem, I added an empty option as the first
element of the select only when deselecting a certain item.
2023-07-06 15:33:47 -03:00
Lars Bonczek 24b8efe27a MDL-78618 core_course: use UNION in get_nearest_editable_subcategory 2023-07-06 18:52:36 +02:00
Sara Arjona d9c911598c Merge branch 'MDL-78391-401' of https://github.com/HuongNV13/moodle into MOODLE_401_STABLE 2023-07-06 11:03:18 +02:00
Huong Nguyen 7a582cf628 MDL-78391 atto_recordrtc: Fix recording issue with Chrome 2023-07-06 15:49:56 +07:00
Huong Nguyen 0f7151e2ba MDL-78391 tiny_recordrtc: Fix recording issue with Chrome 2023-07-06 15:49:55 +07:00
Sara Arjona 082a862366 Merge branch 'MDL-77375-401-patch' of https://github.com/ilyatregubov/moodle into MOODLE_401_STABLE 2023-07-06 10:12:00 +02:00
Misha Golenkov d06d29ef5d MDL-78379 js: Add missing newline character 2023-07-06 16:16:39 +10:00
Ilya Tregubov c7877e7bb3 MDL-77375 tool_dataprivacy: Fix menus going floaty. 2023-07-06 13:12:53 +08:00
Jun Pataleta 6509d6d944 Merge branch 'MDL-78391-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-07-06 11:59:46 +08:00
Jun Pataleta 3601d38c01 Merge branch 'MDL-78488_401' of https://github.com/t-schroeder/moodle into MOODLE_401_STABLE 2023-07-06 11:17:57 +08:00
Ilya Tregubov fa52ecfdf2 Merge branch 'MDL-69983-401' of https://github.com/davewoloszyn/moodle into MOODLE_401_STABLE 2023-07-06 10:26:27 +08:00
Ilya Tregubov 83748b3b19 Merge branch 'MDL-78608_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-07-06 09:57:21 +08:00
Jun Pataleta 461c0bd947 Merge branch 'MDL-78484-401' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_401_STABLE 2023-07-06 09:41:24 +08:00
Ilya Tregubov ff652d5c2c Merge branch 'MDL-77375-401' of https://github.com/rezaies/moodle into MOODLE_401_STABLE 2023-07-06 09:21:18 +08:00
Jun Pataleta d584ca7b7f Merge branch 'MDL-74893-MOODLE_401_STABLE-fix_auto_login_guest' of https://github.com/praxisdigital/moodle into MOODLE_401_STABLE 2023-07-06 09:14:09 +08:00
Paul Holden c537169f84 Merge branch 'MDL-78542-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-07-05 17:13:18 +01:00
Andrew Nicols b3246582c4 Merge branch 'MDL-78644-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-07-05 22:10:42 +08:00
Andrew Nicols c3c39d78c4 Merge branch 'MDL-78338-401_toolbrickfieldlinkinnewwindow' of https://github.com/brickfield/moodle into MOODLE_401_STABLE 2023-07-05 22:03:04 +08:00
Andrew Nicols 2811bedd48 Merge branch 'MDL-78622_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-07-05 21:56:35 +08:00
Andrew Nicols ba32d69255 Merge branch 'MDL-64152-401' of https://github.com/snake/moodle into MOODLE_401_STABLE 2023-07-05 21:49:20 +08:00
Andrew Nicols 17b4837fb6 Merge branch 'MDL-78614-401' of https://github.com/noeldemartin/moodle into MOODLE_401_STABLE 2023-07-05 20:30:42 +08:00
Paul Holden f09241fafe MDL-78644 files: more fault tolerant resizing of logos/icons.
If we cannot resize the given file (files such as ICO can't be, for
SVG it makes no sense), then we should just return the original file
as is rather than an error.
2023-07-05 12:51:41 +01:00
Ilya Tregubov a9fe9bbb0c Merge branch 'MDL-78485-401' of https://github.com/stevandoMoodle/moodle into MOODLE_401_STABLE 2023-07-05 11:52:11 +08:00
Andrew Nicols e5f747ffa4 Merge branch 'MDL-78158-401' of https://github.com/andelacruz/moodle into MOODLE_401_STABLE 2023-07-05 10:24:07 +08:00
Huong Nguyen 28263edd35 Merge branch 'MOODLE_401_MDL-77396' of https://github.com/Dineshdurai/moodle into MOODLE_401_STABLE 2023-07-04 16:15:48 +07:00
Huong Nguyen 25432feda8 Merge branch 'MDL-78596-coursecard-divider-401' of https://github.com/leonstr/moodle into MOODLE_401_STABLE 2023-07-04 15:28:30 +07:00
Huong Nguyen e8058e6981 Merge branch 'MDL-78578-401' of https://github.com/snake/moodle into MOODLE_401_STABLE 2023-07-04 15:16:15 +07:00
Huong Nguyen d19936b1c6 Merge branch 'MDL-76853-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-07-04 12:46:26 +07:00
Huong Nguyen 1751f4e658 Merge branch 'MDL-78138-401' of https://github.com/lucaboesch/moodle into MOODLE_401_STABLE 2023-07-04 12:38:59 +07:00
Stevani Andolo 419db61006 MDL-78485 editor_tiny: Allowed script tag to be added in tinyMCE editor 2023-07-04 13:36:47 +08:00
Andrew Nicols 48a4ad4d4c Merge branch 'MDL-75324-401' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-07-04 13:30:15 +08:00
Andrew Nicols daccd01a0e Merge branch 'MDL-76840_401' of https://github.com/uzimike/moodle into MOODLE_401_STABLE 2023-07-04 13:21:30 +08:00
Simey Lameze a34591cc0b MDL-75324 behat: use a proper step to verify completion status 2023-07-04 11:20:23 +08:00
Jun Pataleta 5db1843de2 Merge branch 'MDL-78572_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-07-04 09:47:43 +08:00
Angelia Dela Cruz 241a8eb343 MDL-78158 behat: Behat cleanup and optimisation 2023-07-04 08:36:58 +08:00
AMOS bot 55ba6b010a Automatically generated installer lang files 2023-07-04 00:11:38 +00:00
Sara Arjona b90771ef97 Merge branch 'MDL-77868-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-07-03 17:29:40 +02:00
Sara Arjona 7cf23d5396 Merge branch 'MDL-76661-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-07-03 17:26:29 +02:00
Angelia Dela Cruz 0d5b8d1337 MDL-78158 Behat: Use data generators to add blocks 2023-07-03 19:17:35 +08:00
Tim Hunt bcf0112c36 MDL-78622 quiz: add question query must include contextid
It is logically requried and necessary for the query to use the index
2023-07-03 11:51:19 +01:00
Paul Holden d88a8851ac MDL-76661 mod_bigbluebuttonbn: fix meeting attendee role comparison. 2023-07-03 11:41:13 +01:00
Noel De Martin 73fcdb1bf4 MDL-78614 behat: Remove trailing quotes 2023-07-03 11:18:42 +02:00
Andrew Nicols 0830ca48f9 MDL-78391 atto_recordrtc: Improve MacOS codec compatability 2023-07-03 16:52:28 +08:00
Andrew Nicols ed6054fdf8 MDL-78391 tiny_recordrtc: Set filename according to container 2023-07-03 16:52:26 +08:00
Andrew Nicols 3faf81d578 MDL-78391 tiny_recordrtc: Switch to mp4 container for h264
Theh WebM container does not support H.264 / AVC.

For more information see:
https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Containers#webm

General purpose video, preferably in an open format
WebM (ideally with MP4 fallback)
2023-07-03 16:52:07 +08:00
Andrew Nicols 756d9fa18d MDL-78391 tiny_recordrtc: Improve codec selection
From my experimentation I have discovered that Safari does not properly
respect the standard MediaRecorder mimetype. Instead of using `codecs=`
it uses `codecs:`.

This change copies the codec array to have the list of possible codecs
include both codecs= and codecs: whilst remaining in order.
2023-07-03 16:50:12 +08:00
Andrew Nicols d73ad3b532 MDL-78391 tiny_recordrtc: Respect codec options
The audio and video plugins were overriding the wrong method, and thus
preventing selection of a relevant codec and breaking playback on some
devices.
2023-07-03 16:50:11 +08:00
Andrew Nicols 9c97536a9f MDL-76853 editor_tiny: Refactor behat helpers into trait 2023-07-03 09:38:24 +08:00
Karen Holland 1f6fa90a02 MDL-78338 tool_brickfield: Allow link open in new window with warning 2023-07-01 23:14:26 +01:00
Shamim Rezaie 2d8c924d71 MDL-77375 core_grades: set boundary of the dropdowns in grade setup page 2023-07-02 00:40:15 +10:00
Shamim Rezaie ddb1b56f36 MDL-77375 gradereport_singleview: set boundary of the dropdowns 2023-07-02 00:06:14 +10:00
Shamim Rezaie f30316be5d MDL-77375 tool_dataprivacy: set boundary of the dropdowns 2023-07-02 00:06:13 +10:00
Shamim Rezaie 2f108b6430 MDL-77375 mod_forum: set boundary of the dropdown
Also removed the unnecessary button role from the <button> element
2023-07-02 00:06:13 +10:00
Shamim Rezaie ebe8674636 MDL-77375 mod_assign: set overflow constraint boundary of the dropdowns 2023-07-02 00:06:13 +10:00
Shamim Rezaie 88f66617a0 MDL-77375 output: Allow additional options for dropdowns 2023-07-02 00:06:13 +10:00
Shamim Rezaie ba07bb42e1 MDL-77375 theme: Re-fix the bootstrap scrollbar issue 2023-07-02 00:06:13 +10:00
Paul Holden 315e8dd327 MDL-78564 mod_assign: ensure submission statement is present.
Don't require acceptance of statement, if no such statements exists,
during assignment submission.
2023-06-30 14:20:09 +01:00
Jun Pataleta 14d4f0aed3 MDL-77690 mod_lesson: Lesson accessibility fixes
* Set the heading levels of lesson pages appropriately to avoid skipped
heading issues.
* Add appropriate labels for tertiary navigation select menus.
2023-06-30 17:51:12 +08:00
Jun Pataleta 213223d162 MDL-77690 core: New activity_header method get_heading_level()
Add a new method for activity_header that determines the heading level
depending on whether the theme displays a heading for the activity
header (usually a h2 heading with the activity name).

E.g. in Boost, the activity name is already being displayed in a
heading. So page headings can be rendered as h2. However, on Classic,
the activity name is being displayed as a h2 heading. So headings need
to be adjusted for the activity pages.
2023-06-30 17:51:12 +08:00
Tim Schroeder be118c06b3 MDL-78488 question bank: don't load statistics when they are disabled 2023-06-30 11:47:04 +02:00
Jun Pataleta 415de4b23e MDL-77690 user: Add sr-only heading for the user profile page 2023-06-30 17:46:57 +08:00
Jun Pataleta 2f305e5a10 MDL-78542 mod_url: clicktoopen lang string fix
- Improve the grammatical structure of the lang string.
- Remove the mention of "link", for sighted users, it should already
be obvious that it's a link. For screen reader users, screen readers
already announce links. So it would be confusing for them to hear
something like "Click 'Moodle.org, link' link to open resource"
2023-06-30 17:27:32 +08:00
Jun Pataleta 7ffbc23426 MDL-78542 mod_url: Add a help text for URL resource name field
Add a help text explaining that the URL resource's name field will be
used for the link text. Also add basic guidelines about naming links for
the benefit of screen reader users.
2023-06-30 17:27:32 +08:00
Jun Pataleta f6c05b8980 MDL-78542 mod_url: Use the module name for the URL resource's link text 2023-06-30 17:27:32 +08:00
Jake Dallimore 32ad202b06 MDL-64152 library: Fix legacy LTI launches when using reverse proxy
LTI 1.1 uses OAuth 1.0, which requires 'hostname', among other things,
as part of signature verification. When Moodle is run behind a reverse
proxy, $_SERVER['SERVER_NAME'] is an unreliable way to fetch hostname.
It isn't always equal to the external hostname but instead can contain
the local host, meaning the signature verification will fail. This
change replaces the use of $_SERVER vars with $FULLME - which already
takes this into account - to fix the signature verification.

Co-authored-by: Berengar W. Lehr <Berengar.Lehr@uni-jena.de>
2023-06-30 16:42:37 +08:00
Jun Pataleta 1d92fd1ed3 Merge branch 'MDL-78068-401' of https://github.com/laurentdavid/moodle into MOODLE_401_STABLE 2023-06-30 16:42:31 +08:00
Franziska Hübler 09a97ba0bf MDL-69983 backup: Save async backups in correct area. 2023-06-30 10:13:17 +10:00
AMOS bot cc4ed8ebb4 Automatically generated installer lang files 2023-06-30 00:08:41 +00:00
Stevani Andolo 322e681c65 MDL-76046 core: Fixed secondary navigation on smaller screen 2023-06-30 06:31:22 +08:00
Luca Bösch 18dfb832d1 MDL-78138 theme_boost: Reliably remove TYPE_CATEGORY breadcrumbs. 2023-06-29 21:48:41 +02:00
Tim Hunt 2a2dd08ff1 MDL-78608 question stats: avoid loading data for missing contexts
It turns out that there are plugins which don't (currently)
clean up their question attempts when a context is deleted.
Therefore, we need to make Moodle core robust to that.
2023-06-29 16:27:01 +01:00
Huong Nguyen 6628845087 weekly release 4.1.4+ 2023-06-29 22:22:22 +07:00
Sara Arjona 9137b58fca Merge branch 'MDL-78554-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-06-29 17:39:05 +08:00
Andrew Nicols d949e40268 Merge branch 'MDL-78599-401' of https://github.com/snake/moodle into MOODLE_401_STABLE 2023-06-29 11:33:22 +08:00
Jun Pataleta 648aa897cf Merge branch 'MDL-77993-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-29 11:28:07 +08:00
Jun Pataleta d73c514909 Merge branch 'MDL-78432-401' of https://github.com/laurentdavid/moodle into MOODLE_401_STABLE 2023-06-29 11:25:12 +08:00
Andrew Nicols 2fd55eddff Merge branch 'MDL-78018-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-29 11:02:09 +08:00
Ilya Tregubov 76ec26032e Merge branch 'MDL-77286-401' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-06-29 09:44:32 +08:00
Ilya Tregubov de210a84e7 Merge branch 'MDL-78521-401' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-06-29 09:35:06 +08:00
Huong Nguyen 52cd821ac9 Merge branch 'MDL-77679_401' of https://github.com/mkassaei/moodle into MOODLE_401_STABLE 2023-06-28 21:19:10 +07:00
Jake Dallimore 0c0b1ac1d6 MDL-78599 enrol_lti: fix SQL syntax error in course grade sync 2023-06-28 18:13:27 +08:00
Jake Dallimore 07b0f65aac MDL-78599 enrol_lti: test covering decoupled, course context grade syncs
This covers the case where a course is published and the launch data
doesn't include the 'lineitem' property of the ags claim, meaning the
tool can manage its own line items.
2023-06-28 18:13:26 +08:00
Leon Stringer fa9705a870 MDL-78596 core_course: Remove divider
With courselistshortnames enabled Moodle 3.11 and earlier showed
"Category | Short name" on the first line of course cards (for example
in block_myoverview).  From Moodle 4.0 the category is moved to the last
line making the first line "Short name |".  This change removes that
stray "|".
2023-06-27 17:40:41 +01:00
Dinesh Durai 201c577a85 MDL-77396 wiki: Fix print without background 2023-06-27 17:59:37 +05:30
Simey Lameze edf6ad1ee2 MDL-77286 behat: change window size to large to avoid random fails 2023-06-27 17:12:21 +08:00
Laurent David 54e62e6997 MDL-78432 mod_label: Process markdown in label name
* Process markdown and other allowed formats (see FORMAT_XXX) in get_label_name
so it does not display it as a litteral string in the course index menu.
2023-06-27 08:12:57 +02:00
Andrew Nicols ea900c4def Merge branch 'MDL-78459-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-27 13:14:50 +08:00
Ilya Tregubov aa44a1643e Merge branch 'MDL-78443-401' of https://github.com/jleyva/moodle into MOODLE_401_STABLE 2023-06-27 11:01:44 +08:00
Jake Dallimore 8d3fd17313 MDL-78578 enrol_lti: permit launch cache access during launch redirects
This handles things like site policies, which store the current URL,
redirect to the policy agreement, then redirect back the current URL
afterwards. In such cases, we want to redirect back with 'launchid' set
so that we can fetch the id_token from the session cache. This is the
same thing we already do during account binding, so the patch only
makes sure the PAGE->url is properly set before calling require_login.
2023-06-27 10:07:25 +08:00
mkassaei fff6af7c20 MDL-77679 Drag and drop question type weird behavior 2023-06-26 17:07:51 +01:00
Jun Pataleta 6f0dfe8b4b Merge branch 'MDL-76724_401' of https://github.com/stronk7/moodle into MOODLE_401_STABLE 2023-06-26 19:38:03 +08:00
Huong Nguyen d53b1b1cfe MDL-78554 tiny_link: Fix cannot create link for selection text
Backport of MDL-78065
2023-06-26 15:47:33 +08:00
Paul Holden 32f9d1eeb5 MDL-78554 tiny_link: define help link text language string.
Backport of MDL-77874
2023-06-26 15:47:14 +08:00
Huong Nguyen 684889be8f MDL-78554 tiny_link: Add a TinyMCE link plugin
Backport of MDL-76520

Co-authored-by: Andrew Lyons <andrew@nicols.co.uk>
2023-06-26 15:45:56 +08:00
Laurent David 29eb09287a MDL-78068 mod_h5pactivity: Fix sort the paragraph activity
* Fix sort the paragraph/sequencing activity report in H5P.
2023-06-26 08:42:39 +02:00
Simey Lameze 31c2baeafd MDL-78521 behat: reload page before asserting content
This commit also reword a Scenario name to make it unique
2023-06-26 11:19:48 +08:00
Sara Arjona 78ec9c1c12 MDL-78572 badges: Improve debugging information for Badgr
This is a backport from MDL-77842.

In MDL-77086 some extra information was added when a badge can't be
sent to a backpack. However, as the Badgr is not following the
specification, it's still hard to debug it when it fails (as
raised in MDL-75552, Badgr is not working because, in some cases,
it's returning the "Method Not Allowed / Request method 'POST'
not supported" error.
2023-06-25 17:40:32 +01:00
Sara Arjona 8e965a9661 MDL-78572 badges: Improve debugging
Display more information, like the status error, when the badge can't
be sent to the backpack.

Backport from MDL-77086
2023-06-25 17:40:03 +01:00
Andrew Nicols d9745d9852 Merge branch 'MDL-78237-401' of https://github.com/davewoloszyn/moodle into MOODLE_401_STABLE 2023-06-24 23:21:58 +08:00
Andrew Nicols 378eae6144 Merge branch 'MDL-76673-401' of https://github.com/meirzamoodle/moodle into MOODLE_401_STABLE 2023-06-24 22:47:10 +08:00
Andrew Nicols 889e1d4e35 Merge branch 'MDL-78544-401' of https://github.com/snake/moodle into MOODLE_401_STABLE 2023-06-24 22:26:57 +08:00
Andrew Nicols 99d941bd6a Merge branch 'MDL-77152-MOODLE_401_STABLE' of https://github.com/sh-csg/moodle into MOODLE_401_STABLE 2023-06-24 22:18:00 +08:00
Andrew Nicols 904e04a14f Merge branch 'MDL-78172-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-24 22:00:12 +08:00
Eloy Lafuente (stronk7) 3c99a0a9ec 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:01 +02:00
Stefan Hanauska e3c84dcb32 MDL-77152 files: Ensure trailing/leading slash 2023-06-24 10:32:02 +02:00
Sara Arjona eb1fab720a weekly release 4.1.4+ 2023-06-23 09:00:18 +02:00
Andrew Nicols 4e7a476651 Merge branch 'MDL-78004_401' of https://github.com/mwehr/moodle into MOODLE_401_STABLE 2023-06-22 14:37:45 +02:00
Ilya Tregubov 84a7937643 Merge branch 'MDL-78434-m401' of https://github.com/sammarshallou/moodle into MOODLE_401_STABLE 2023-06-22 14:37:45 +02:00
Julien Boulen fd7e43ef34 MDL-77986 backup: trim extra white spaces on search forms 2023-06-22 14:37:44 +02:00
Andrew Nicols acb9789b89 Merge branch 'MDL-78071-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-22 14:37:44 +02:00
Andrew Nicols fd87f7b46d Merge branch 'MDL-78541/401' of https://github.com/skodak/moodle into MOODLE_401_STABLE 2023-06-22 14:37:44 +02:00
Andrew Nicols 675ca18cfa Merge branch 'MDL-78350-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-22 14:37:44 +02:00
Andrew Nicols 1186e8a7e5 Merge branch 'MDL-68067-41' of https://github.com/Chocolate-lightning/moodle into MOODLE_401_STABLE 2023-06-22 14:37:44 +02:00
Andrew Nicols 70a0c87fd3 Merge branch 'MDL-78056-401' of https://github.com/laurentdavid/moodle into MOODLE_401_STABLE 2023-06-22 14:37:44 +02:00
Andrew Nicols e67fd9663d Merge branch 'MDL-78263-401' of https://github.com/jleyva/moodle into MOODLE_401_STABLE 2023-06-22 14:37:43 +02:00
Andrew Nicols 0e3c4ad99b Merge branch 'MDL-78435-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-22 14:37:43 +02:00
Andrew Nicols de329f8268 Merge branch 'MDL-75913-401' of https://github.com/davewoloszyn/moodle into MOODLE_401_STABLE 2023-06-22 14:37:43 +02:00
Andrew Nicols 3488b2ae01 Merge branch 'MDL-78477_401' of https://github.com/AnupamaSarjoshi/moodle into MOODLE_401_STABLE 2023-06-22 14:37:43 +02:00
Andrew Nicols 2452db088e Merge branch 'MDL-77865_MOODLE_401_STABLE' of https://github.com/tuanngocnguyen/moodle into MOODLE_401_STABLE 2023-06-22 14:37:43 +02:00
hieuvu 14079fa738 MDL-78484 formslib: Move enable checkbox display before the date picker 2023-06-22 11:08:47 +07:00
Jake Dallimore 331f47a4f3 MDL-78544 forms: fix string to number comparison bug in duration element
Prior to PHP 8, 0 == "", but now no more. We should use empty instead.
See: https://www.php.net/manual/en/migration80.incompatible.php
2023-06-22 11:01:17 +08:00
Paul Holden e8526347a3 MDL-78350 reportbuilder: parse javascript before rendering template. 2023-06-21 17:33:33 +01:00
Paul Holden 61ae9500d7 MDL-78350 output: parse returned dynamic tab javascript when loading.
Ensure we don't create nested <script> tags when rendering templates,
which triggers console errors since 1ef815cd.

Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2023-06-21 17:25:40 +01:00
Juan Leyva 8cbf1bb945 MDL-78263 airnotifier: keep notification name as part of the payload 2023-06-21 18:00:58 +02:00
Petr Skoda 9fee59de2a MDL-78541 admin: ignore headings in admin_apply_default_settings()
This is a workaround for plugins that do not have
unique setting names.
2023-06-21 15:47:06 +02:00
Sara Arjona 97b7c894f3 Merge branch 'MDL-76635-401' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-06-21 14:02:22 +02:00
Sara Arjona c047801eb6 Merge branch 'MDL-63120_Badges_cron_task_fails-MOODLE_401_STABLE' of https://github.com/mebis-lp/moodle into MOODLE_401_STABLE 2023-06-21 11:50:28 +02:00
Anupama Sarjoshi e954482cb0 MDL-78477 qbank_history: Fix and improve UI for edit menu delete option
Changes done to fix the warnings thrown in the history view when the
last version of a question is deleted and improved UI to display the
message and a Continue button, to navigate back to the Question bank.
2023-06-21 10:44:38 +01:00
Ilya Tregubov e34bb395fc Merge branch 'MDL-77591-401' of https://github.com/justusdieckmann/moodle into MOODLE_401_STABLE 2023-06-21 16:58:44 +08:00
Ilya Tregubov f64e9f96aa Merge branch 'MDL-76174_401' of https://github.com/larsbonczek/moodle into MOODLE_401_STABLE 2023-06-21 14:27:10 +08:00
Simey Lameze 39811c4b40 MDL-76635 comment: render the delete icon in the right place
Special thanks to Andrew Lyons.
2023-06-21 12:45:36 +08:00
Simey Lameze 8bcadeff35 MDL-76635 behat: improve submission comments test 2023-06-21 12:45:36 +08:00
Justus Dieckmann 049815cd5f MDL-77591 mod_assign: Fix feedback zip import for group submissions
Import now checks whether assignment is an group submission and
matches group ids instead of user ids in that case.

Additionally check for original unchanged files to not import in
group files instead of user files.
2023-06-20 20:19:44 +02:00
Lars Bonczek 44f60f1b8e MDL-76174 core_course: get_nearest_editable_subcategory performance fix 2023-06-20 14:43:16 +02:00
Ilya Tregubov a69d5ffe33 Merge branch 'MDL-78259-htmlpurify-media-tags-401' of https://github.com/ilyatregubov/moodle into MOODLE_401_STABLE 2023-06-20 16:38:43 +08:00
Julien Boulen 4001902464 MDL-78259 weblib: purify audio/video tags as inline elements 2023-06-20 16:37:02 +08:00
Ilya Tregubov dea9c9534c Merge branch 'MDL-77525/401' of https://github.com/skodak/moodle into MOODLE_401_STABLE 2023-06-20 13:05:29 +08:00
eWallah 71a818f0ff MDL-68067 tool_mobile: Mobile tool link does not have a class attribute. 2023-06-20 10:27:01 +08:00
Jun Pataleta d963201f0a Merge branch 'MDL-74021-401' of https://github.com/andelacruz/moodle into MOODLE_401_STABLE 2023-06-20 10:13:22 +08:00
Jun Pataleta 64f4f58cb8 Merge branch 'MDL-78369_401' of https://github.com/AnupamaSarjoshi/moodle into MOODLE_401_STABLE 2023-06-19 23:16:46 +08:00
Paul Holden 2060b48377 MDL-78071 cohort: disable report actions for managed cohorts. 2023-06-19 15:05:26 +01:00
Paul Holden 7f8d290022 MDL-78459 tool_mobile: use site context in mobile manifest file.
Prevents debugging notices when the site shortname is formatted in
the response data.
2023-06-19 13:03:36 +01:00
Angelia Dela Cruz 07df782303 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:14:19 +08:00
David Woloszyn 86a2213223 MDL-75913 behat: Use alternatives to Atto in tests 2023-06-19 16:38:18 +10:00
David Woloszyn 94b98082a3 MDL-75913 behat: Switch to TinyMCE editor iframe 2023-06-19 16:38:18 +10:00
David Woloszyn 7f6d6d240f MDL-75913 behat: Private files data generator 2023-06-19 16:38:18 +10:00
Andrew Nicols a6e11f20da MDL-75913 behat: Add support for file uploads in page generators 2023-06-19 16:38:18 +10:00
Andrew Nicols 1f553279d2 MDL-75913 behat: Add support for file uploads in generators 2023-06-19 16:38:18 +10:00
Anders Rasmussen c5471d260e MDL-74893 authentication: Fix auto-login guest
Fixed auto-login as guest, when Guest login button is hidden
2023-06-19 07:49:24 +02:00
Laurent David 301f556e41 MDL-78056 mod_h5pactivity: Fix incorrect attempt report
* Fix interpretation of the results on the attempt report whenever case
sensitive option is enabled.
2023-06-19 06:12:05 +02:00
Paul Holden 38e53fdcb6 MDL-77868 mod_bigbluebuttonbn: default config for welcome editable.
The property was added to the config options in c3f4123b, however no
default value was provided, meaning if it was ever unset then a PHP
type error would be triggered on the null return.
2023-06-18 19:19:53 +01:00
Petr Skoda 52e39db7ad MDL-77525 filter: add filtering stages 2023-06-17 16:49:34 +02:00
Paul Holden 0f052d1c35 MDL-78435 mod_assign: ensure due date is always after start date. 2023-06-16 18:42:10 +01:00
Juan Leyva bc2fb3b5e8 MDL-78443 course: Missing require for course_request 2023-06-16 10:17:45 +02:00
Andrew Nicols 64b701190d weekly release 4.1.4+ 2023-06-16 12:04:26 +08:00
Andrew Nicols 202e6a788f Merge branch 'install_401_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_401_STABLE 2023-06-16 12:04:23 +08:00
Angelia Dela Cruz e08630b394 MDL-78455 Behat: Behat cleanup and optimisation for blog/tests/behat 2023-06-16 09:19:13 +08:00
Angelia Dela Cruz e4a8e344ba MDL-78455 Behat: Add Behat for adding, editing and deleting blog entries 2023-06-16 09:16:32 +08:00
Nathan Nguyen 35f0386bd3 MDL-77865 qtype_ddwtos: fix incorrect inplace class 2023-06-15 15:03:54 +10:00
Ilya Tregubov a3692234ed Merge branch 'MDL-70152-401-fix' of https://github.com/ilyatregubov/moodle into MOODLE_401_STABLE 2023-06-15 12:12:18 +08:00
Simey Lameze 460e2c0c1e MDL-70152 behat: reply to post using data generator 2023-06-15 12:05:41 +08:00
Andrew Nicols 4997295c38 Merge branch 'MDL-77224-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-15 12:02:40 +08:00
Andrew Nicols b66d82ccb4 Merge branch 'MDL-77569-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-15 12:00:55 +08:00
Andrew Nicols e2f07cf2b4 Merge branch 'MDL-78066-401' of https://github.com/snake/moodle into MOODLE_401_STABLE 2023-06-15 11:27:02 +08:00
Andrew Nicols dedfbb7e63 Merge branch 'MDL-78461-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-15 11:23:27 +08:00
Andrew Nicols 196ed7530b Merge branch 'MDL-69231-401' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-06-15 10:56:53 +08:00
Ilya Tregubov 7e523dfff9 Merge branch 'MDL-77542-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-15 10:36:34 +08:00
Ilya Tregubov 053ad4a57e Merge branch 'MDL-76733-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-06-15 10:23:36 +08:00
Andrew Nicols 46f3dc6538 Merge branch 'MDL-78478-401' of https://github.com/dasistwas/moodle into MOODLE_401_STABLE 2023-06-15 09:56:18 +08:00
Jake Dallimore 68b6ca2f69 MDL-78066 enrol_lti: fix deep linking error in multiple grade items case
If an activity, like workshop or forum, has multiple grade items,
declarative binding of the grade item (line item) isn't supported.
Instead of throwing an exception, handle the case more elegantly
and just omit the 'add to gradebook' option for these activities.
2023-06-15 09:44:21 +08:00
Jake Dallimore 32a34f805f MDL-78066 enrol_lti: test showing multi-grade-items failure
This test demonstrates the failure of the repository to properly fetch
published resources which are compatible with declarative line item
binding.
2023-06-15 09:44:17 +08:00
Andrew Nicols 1adbb84d07 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:06 +08:00
Andrew Nicols b5fa1ee8dc MDL-76733 mod_assign: Address random failure
This random failure was happening because of the time required to render
and interact with the file picker which sometimes exceeded 2 seconds,
depending on the speed of the machine running the 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:33:42 +08:00
Ilya Tregubov 5472d69233 Merge branch 'MDL-78102-401' of https://github.com/sarjona/moodle into MOODLE_401_STABLE 2023-06-15 09:04:09 +08:00
AMOS bot ba4f42dfff Automatically generated installer lang files 2023-06-15 00:16:23 +00:00
Sara Arjona 36a7924b64 Merge branch 'MDL-78055-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-14 16:54:57 +02:00
Sara Arjona 4dcf2db446 Merge branch 'MDL-74824-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-14 16:51:11 +02:00
Sara Arjona 86b030d671 Merge branch 'MDL-76733-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-06-14 16:22:26 +02:00
David Bogner c461b4d8fc MDL-78478 forms: Fix repeated elements in dynamic forms 2023-06-14 15:30:32 +02:00
Paul Holden b8f3aa4d12 MDL-78055 themes: account for undefined extrascsscallback config.
Where a theme didn't define this property, it would raise debugging
deprecation warnings in PHP8.1.
2023-06-14 13:51:12 +01:00
Sara Arjona 29d1702f82 Merge branch 'MDL-76715-401' of https://github.com/aanabit/moodle into MOODLE_401_STABLE 2023-06-14 13:19:03 +02:00
Sara Arjona 4c6e5c977d Merge branch 'MDL-64648-401_enrol_manual_expirynotify_default_in_enrol_instance' of https://github.com/vtos/moodle into MOODLE_401_STABLE 2023-06-14 13:08:25 +02:00
Jun Pataleta 302d6f2a3e Merge branch 'MDL-78466-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-06-14 16:05:55 +08:00
Ilya Tregubov beb0328060 Merge branch 'MDL-70152-401' of https://github.com/andelacruz/moodle into MOODLE_401_STABLE 2023-06-14 13:25:03 +08:00
Jun Pataleta e460f1ed4e Merge branch 'MDL-76445-401-patch' of https://github.com/ilyatregubov/moodle into MOODLE_401_STABLE 2023-06-14 12:19:03 +08:00
Ilya Tregubov c162f90445 MDL-76445 gradereport_singleview: Fix Behat test
When you unenrol a user, the notification blocks some tertiary
navigation links.
2023-06-14 11:38:04 +08:00
Andrew Nicols fdf7ea57f0 MDL-78466 cache: Add new result_found helper
This helper is intended to prevent recurrences of this issue by moving
the guess-work to something well tested.
2023-06-14 09:35:40 +08:00
Ilya Tregubov b699da1461 MDL-76445 core_grades: Use group select instead of group search
On Moodle 4.1 we don't have group search on grader report.
That is only available in 4.2+
2023-06-14 09:34:22 +08:00
Andrew Nicols 02652c7651 MDL-78466 cache: Perform strict test on static cache values
If a statically accelerated cache returns an empty array then the value
was still fetched from the non-static cache store.

The check of the `$result` should be strictly checked against `false`,
which is the value used if no value was found.
2023-06-14 09:28:48 +08:00
vtos e0145522c9 MDL-64648 enrol_manual: fixed default setting of 'expirynotify'
When creating a course, a manual enrolment instance is added by default. The instance settings should inherit the values of those
for the manual enrolment plugin and properly calculate its extra settings. The 'expirynotify' setting wasn't inherited correctly
in case it had 'Enroller + Enrolled' value.
A functional test was added to test the behaviour of settings inheritance.
2023-06-13 18:23:35 +02:00
Paul Holden 43d715777a MDL-78461 core: fix base plugininfo class reference to root directory. 2023-06-13 14:05:31 +01:00
Sara Arjona 7e74ec4a3c MDL-78102 badges: Check empty backpack email/password
For backpack connection using OBv2.0, email and password can't be
blank.
This patch adds some extra checks to validate this and displays an
error to the users before trying to connect to the backpack.
Besides, the error displayed when any error is returned by the
backpack (like invalid credentials), has also been improved, to
make it clearer for the users.
2023-06-13 11:21:52 +02:00
sam marshall 673576142e MDL-78434 Lib: PHP 8.1 incompatible code relating to LDAP\Connection 2023-06-13 09:45:04 +01:00
Ilya Tregubov f6650607d6 Merge branch 'MDL-76445-401-2' of https://github.com/mihailges/moodle into MOODLE_401_STABLE 2023-06-13 15:46:29 +08:00
Amaia Anabitarte 789361ae13 MDL-76715 mod_data: Remove data_records when the last field is deleted 2023-06-13 09:35:09 +02:00
Mihail Geshoski 6ceb137f04 MDL-76445 gradereport_singleview: Usability fixes 2023-06-13 15:20:03 +08:00
Mihail Geshoski e60edbf0cb MDL-76445 gradereport_user: Usability fixes 2023-06-13 15:20:03 +08:00
Mihail Geshoski f057a2aef9 MDL-76445 grade: Helper that returns all gradable users in a course 2023-06-13 15:20:03 +08:00
Jake Dallimore f5e4dcf609 Merge branch 'MDL-73052-401' of https://github.com/sarjona/moodle into MOODLE_401_STABLE 2023-06-13 14:44:52 +08:00
Andrew Nicols a4cc94f3d0 MDL-78297 core: Bump version to update cache config
The missing version bump caused cache configuration to not be updated,
and the static acceleration cache size was therefore not updated. The
result here was that the static acceleration cache was constantly
emptied leading to an increased page load time.
2023-06-13 11:06:20 +08:00
michaelkotlyar c893e3f9b8 MDL-76840 mod_assign: Account for extension when calculating time left. 2023-06-13 14:54:11 +12:00
Anupama Sarjoshi 6664e73599 MDL-78369 Multiple choice: Increase Choice and feedback boxes size 2023-06-12 12:02:21 +01:00
Jun Pataleta fcdad9f31c Merge branch 'MDL-75937-401' of https://github.com/stevandoMoodle/moodle into MOODLE_401_STABLE 2023-06-12 16:10:45 +08:00
Stevani Andolo f0211bbfb1 MDL-75937 admin: Fixed config data display inconsistency 2023-06-12 15:29:54 +08:00
Andrew Nicols 73a55b6268 Merge branch 'MDL-78297-401' of https://github.com/MartinGauk/moodle into MOODLE_401_STABLE 2023-06-12 10:19:43 +08:00
Paul Holden d9c8e2561e MDL-77224 mod_h5pactivity: clean up attempt data on activity deletion. 2023-06-11 18:37:13 +01:00
Paul Holden 99681d7df8 MDL-77993 mod_lesson: ensure report action menu always present. 2023-06-11 18:35:14 +01:00
Paul Holden 05074c1ca3 MDL-74824 user: fix custom change password URL in login notification. 2023-06-11 17:41:09 +01:00
Paul Holden 3215a7b190 MDL-78018 mod_assign: format group name in grading table. 2023-06-11 15:02:36 +01:00
Paul Holden afe9d11746 MDL-77542 mod_assign: remove duplicate grade heading from grader.
It's already part of the subsequent rendered form.
2023-06-11 15:01:35 +01:00
Paul Holden 9ed9a010d6 MDL-78172 mod_forum: ensure group names are correctly formatted. 2023-06-11 15:00:28 +01:00
Ilya Tregubov 76fe404dd5 Moodle release 4.1.4 2023-06-10 14:08:05 +08:00
Ilya Tregubov f3400f4fc5 weekly release 4.1.3+ 2023-06-09 13:14:27 +08:00
Sara Arjona c872490dcf Merge branch 'MDL-78415-401-enfix' of https://github.com/vmdef/moodle into MOODLE_401_STABLE 2023-06-08 20:33:14 +02:00
Helen Foster e518de15f3 MDL-78415 lang: Import fixed English strings (en_fix) 2023-06-08 12:02:34 +01:00
Paul Holden eea061bc42 MDL-77569 reportbuilder: cache custom report element persistents.
During request lifecycle ensure that column, filter and condition
persistents are only loaded a single time to prevent additional
database reads.

Provide invalidation method, used by the report helpers, to ensure
that the persistents are re-loaded appropriately.

This is a backport of MDL-76901.

Co-authored-by: Marina Glancy <marina@moodle.com>
2023-06-08 10:00:19 +01:00
David Woloszyn 0596ff2d2b MDL-78237 editor_tiny: Prevent navbar obscuring modal content 2023-06-08 17:15:13 +10:00
David Woloszyn 2d677835ec MDL-78237 css: Make navbar height available for non sass-use 2023-06-08 17:15:13 +10:00
Sara Arjona 4fffa81e41 Merge branch 'MDL-77946-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-08 06:56:56 +02:00
Sara Arjona fcd946c862 Merge branch 'MDL-78308-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-08 06:48:40 +02:00
Andrew Nicols b272406c74 Merge branch 'MDL-75696_401_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_401_STABLE 2023-06-08 12:31:16 +08:00
Andrew Nicols d0e0225a1a Merge branch 'MDL-78364-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-08 12:19:31 +08:00
Andrew Nicols 2649d1a01e Merge branch 'MDL-78008_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-06-08 12:10:42 +08:00
Andrew Nicols aa77a76c7a Merge branch 'MDL-77933-401' of https://github.com/snake/moodle into MOODLE_401_STABLE 2023-06-08 12:03:37 +08:00
Andrew Nicols 1b27cfd795 MDL-76838 core: Add unit test for invalid unicode sequences 2023-06-08 11:59:23 +08:00
Jake Dallimore da10ccd8d4 MDL-77933 enrol_lti: return site name and logo during registration
Instead of the Moodle icon and the 'moodle' lang string, return the
site fullname and compact logo during dynamic registration.
2023-06-08 11:56:31 +08:00
Andrew Nicols cc7ea9fecd Merge branch 'MDL-76838-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-08 11:54:42 +08:00
Jun Pataleta 2cf0da5dc6 Merge branch 'MDL-75898-41' of https://github.com/matthewhilton/moodle into MOODLE_401_STABLE 2023-06-08 11:43:06 +08:00
Andrew Nicols a6fde372ab Merge branch 'MDL-78026-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-08 11:36:54 +08:00
Andrew Nicols 7dc747ea99 Merge branch 'MDL-77264-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-08 11:32:46 +08:00
Andrew Nicols 5a8881ac37 Merge branch 'MDL-76821-401' of https://github.com/snake/moodle into MOODLE_401_STABLE 2023-06-08 11:30:09 +08:00
Andrew Nicols b4eb274d7a Merge branch 'MDL-77799-m401' of https://github.com/sammarshallou/moodle into MOODLE_401_STABLE 2023-06-08 11:21:35 +08:00
Andrew Nicols 21443080c8 Merge branch 'MDL-78408-401' of https://github.com/snake/moodle into MOODLE_401_STABLE 2023-06-08 11:05:34 +08:00
Jun Pataleta ea1a8336e5 Merge branch 'MDL-78036_401' of https://github.com/stronk7/moodle into MOODLE_401_STABLE 2023-06-08 11:03:24 +08:00
Andrew Nicols f68fedcf77 Merge branch 'wip_MDL-78400_m41' of https://github.com/gjb2048/moodle into MOODLE_401_STABLE 2023-06-08 10:51:50 +08:00
Andrew Nicols cf3ae5bc2a Merge branch 'MDL-76406-401' of https://github.com/safatshahin/moodle into MOODLE_401_STABLE 2023-06-08 10:38:58 +08:00
Jun Pataleta c8bb7a6911 Merge branch 'MDL-76842-401' of https://github.com/snake/moodle into MOODLE_401_STABLE 2023-06-08 10:34:17 +08:00
Jun Pataleta bf448de7aa Merge branch 'MDL-78229-401' of https://github.com/lucaboesch/moodle into MOODLE_401_STABLE 2023-06-08 10:30:23 +08:00
Jake Dallimore cbacf8ee58 MDL-76842 enrol_lti: fix user record updates in user_repository
Only call user_update_user when the relevant user data has changed,
preventing unnecessary user_updated events. This also removes the
line setting timemodified on the user since user_update_user already
handles this.
2023-06-08 10:29:01 +08:00
Jun Pataleta 37a29f7950 Merge branch 'MDL-78431-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-06-08 10:28:18 +08:00
Jake Dallimore b1dcb08e3f MDL-76842 enrol_lti: test confirming the erroneous user_updated events
This test will fail until the fix - only updating users when data has
changed - is put in place in the following commit.
2023-06-08 09:40:29 +08:00
Jake Dallimore 0ccf800f01 MDL-76842 auth_lti: don't update the user unless data has changed
When receiving data from the LTI launch, or service call, only update
the user record when we know something has changed. This prevents the
creation of many \core\event\user_updated events.
2023-06-08 09:40:28 +08:00
Jake Dallimore b097d38fb3 MDL-76842 auth_lti: don't update the user after membership creation
This isn't required and generates excess events. The only thing update
does, other than update the user fields, is to update the picture, but
in this case, that's unset in membership-based auths anyway, so it's
entirely safe to remove this.
2023-06-08 09:39:09 +08:00
Jake Dallimore 1858e29d23 MDL-76842 auth_lti: test confirming the erroneous user_updated events
This test will fail until the fix - only updating users when data has
changed - is put in place in the following commit.
2023-06-08 09:39:09 +08:00
Stevani Andolo bd5329b1a5 MDL-78215 core: Added support unit test 2023-06-08 09:37:02 +08:00
Stevani Andolo 69596a6bb2 MDL-78215 core: support checking if 0.0.0.0 is in subnet 2023-06-08 09:37:01 +08:00
Jun Pataleta 79510d5d73 Merge branch 'MDL-78378-401' of https://github.com/sarjona/moodle into MOODLE_401_STABLE 2023-06-07 23:25:19 +08:00
Jun Pataleta fce2d2f407 Merge branch 'MDL-78368-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-06-07 23:22:25 +08:00
Jun Pataleta 3b8e3ba59e Merge branch 'MDL-76745_401_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_401_STABLE 2023-06-07 22:53:45 +08:00
Andrew Nicols 2279eee0ab MDL-78431 core: Abort after config for source maps 2023-06-07 21:07:52 +08:00
Sara Arjona 411f43dc5a Merge branch 'MDL-78322-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-07 12:43:08 +02:00
Sara Arjona ef2a553bd4 Merge branch 'MDL-78352-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-07 12:41:16 +02:00
Sara Arjona af1bd51b99 Merge branch 'MDL-78047-401' of https://github.com/stevandoMoodle/moodle into MOODLE_401_STABLE 2023-06-07 18:17:40 +08:00
Sara Arjona b89ece2484 Merge branch 'MDL-78010-401' of https://github.com/ferranrecio/moodle into MOODLE_401_STABLE 2023-06-07 18:17:40 +08:00
Martin Gauk 190db6962e MDL-78297 core: Less cache lookups in deprecated capabilities feature
Avoid use of $cache->has.
2023-06-07 12:04:36 +02:00
sam marshall 0c3b3c9b92 MDL-77799 webservice_rest: unhandled exception should go in server log 2023-06-07 10:04:07 +01:00
Jake Dallimore 7fd423acfc MDL-78408 core: fix restoration of anchor to wantsurl during login 2023-06-07 14:30:37 +08:00
Stevani Andolo abac304ba9 MDL-78047 core_courseformat: Wrapping added to text and media activity 2023-06-07 12:58:38 +08:00
Paul Holden 677b67ac05 MDL-77193 mnet: correct sorting of access control table. 2023-06-07 09:53:44 +08:00
Ferran Recio 5f30a47660 MDL-78010 mod_label: improve upgrade performance 2023-06-06 21:33:14 +02:00
Eloy Lafuente (stronk7) 7abeaf37ea MDL-78036 behat: Move all links from old docs to new counterparts 2023-06-06 12:39:21 +02:00
Petr Skoda 79981290d9 MDL-76683 core_group: fix template 2023-06-06 09:30:27 +00:00
Sara Arjona e96dab8594 Merge branch 'MDL-76936-401' of https://github.com/HirotoKagotani/moodle into MOODLE_401_STABLE 2023-06-06 11:22:15 +02:00
Paul Holden 6843ba0aad MDL-78364 reportbuilder: earlier calculation of schedule recipients. 2023-06-05 16:22:33 +01:00
Gareth Barnard 257e2b414a MDL-78400 JavaScript: Building JS puts build files in src dir on Win. 2023-06-05 14:52:16 +01:00
Sara Arjona 8caeea5c47 MDL-73052 page: Fix page description when it has only an image
This is as regression of MDL-72413, when description was moved to a
standard module API.
In some cases, when description has only images, it's was not
displayed.
2023-06-02 08:20:38 +02:00
Sara Arjona b17d91c6f8 MDL-78378 survey: Display default introduction when description is empty
This is a regression when the activity pages were redessigned in Moodle
4.0. The default introduction should be displayed when the activity
description is empty.
2023-06-02 08:19:49 +02:00
Simey Lameze fc10598d63 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:42:35 +08:00
Andrew Nicols b67b10af29 MDL-69231 behat: Update tests to use new generator 2023-06-02 12:42:35 +08:00
Andrew Nicols c4cd52ce5a MDL-69231 tests: Add role capability setting generator 2023-06-02 12:42:35 +08:00
Andrew Nicols c49877c8f5 MDL-69231 tests: Improve existing role generator
Support definition of context levels and permissions.
2023-06-02 12:42:35 +08:00
Safat 7debcb85b4 MDL-76406 core: Add environment check for versions not supporting 8.2 2023-06-02 12:09:15 +10:00
Ilya Tregubov 03b605f2eb weekly release 4.1.3+ 2023-06-02 09:55:42 +08:00
Ilya Tregubov de0bab848d Merge branch 'install_401_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_401_STABLE 2023-06-02 09:55:39 +08:00
Mark Johnson dfdf8ba7c9 MDL-76745 cache: Implement cache_loader_with_locking in cache_disabled
If a plugin attempts to do something that would lock coursemodinfo cache
during install (such as creating a course module), this currently fails
as check_lock_state is not implemented in cache_disabled. Adding the
cache_loader_with_locking interface ensures that all lock methods are
implemented.
2023-06-01 15:03:33 +01:00
Andrew Nicols f1f87dbd6b Merge branch 'MDL-77749-unset-config-duration-MOODLE_401_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_401_STABLE 2023-06-01 12:03:26 +08:00
Jun Pataleta 2885b47377 Merge branch 'MDL-78092-m401' of https://github.com/sammarshallou/moodle into MOODLE_401_STABLE 2023-06-01 11:36:21 +08:00
Andrew Nicols 036cb9a997 Merge branch 'MDL-78327_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-06-01 10:52:47 +08:00
Ilya Tregubov 732f27c770 Merge branch 'MDL-78196-401' of https://github.com/jleyva/moodle into MOODLE_401_STABLE 2023-06-01 10:40:36 +08:00
Andrew Nicols d6a8581abe Merge branch 'MDL-78262-401' of https://github.com/danghieu1407/moodle into MOODLE_401_STABLE 2023-06-01 09:57:03 +08:00
Ilya Tregubov d37efc5160 Merge branch 'MDL-77259-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-01 09:30:02 +08:00
Ilya Tregubov e0dc9aa297 Merge branch 'MDL-75961-401' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-06-01 09:08:28 +08:00
AMOS bot e939cee281 Automatically generated installer lang files 2023-06-01 00:11:03 +00:00
Sara Arjona 17be7f62d6 Merge branch 'MDL-76693-401' of https://github.com/roland04/moodle into MOODLE_401_STABLE 2023-05-31 17:09:03 +02:00
Simey Lameze b512186fce MDL-77547 behat: run recalculate task before checking values 2023-05-31 15:04:56 +02:00
Tim Hunt ee3752e639 MDL-78327 question stats: store same timestamp for all question stats 2023-05-31 12:03:56 +01:00
Sara Arjona e47c5527f6 Merge branch 'MDL-77547-401' of https://github.com/andelacruz/moodle into MOODLE_401_STABLE 2023-05-31 12:51:34 +02:00
Sara Arjona 99a48299f0 Merge branch 'MDL-77907-401' of https://github.com/andelacruz/moodle into MOODLE_401_STABLE 2023-05-31 12:18:12 +02:00
Sara Arjona 5a84debc90 Merge branch 'MDL-78148-401' of https://github.com/ferranrecio/moodle into MOODLE_401_STABLE 2023-05-31 11:42:16 +02:00
Sara Arjona 70e6fb0a7d Merge branch 'MDL-73648-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-31 11:38:21 +02:00
Ilya Tregubov 95ec4161f5 Merge branch 'MDL-73138-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-30 12:54:24 +08:00
Ilya Tregubov bd41a5bbec Merge branch 'MDL-77723-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-30 12:44:54 +08:00
AMOS bot f02891c647 Automatically generated installer lang files 2023-05-30 00:10:36 +00:00
Jun Pataleta 2d99010fc9 Merge branch 'MDL-78314-401' of https://github.com/lucaboesch/moodle into MOODLE_401_STABLE 2023-05-29 17:35:04 +08:00
Luca Bösch 23ba0d96ef MDL-78314 quiz: style button fieldset in "Manually grade question". 2023-05-29 10:54:27 +02:00
Mikel Martín 11205ec5ef MDL-76693 core_course: Fix activity chooser summary overlap
In activity chooser modal, there is an overlap issue in the information "sub-page".
Changing some classes in the layout solves the problem.
2023-05-29 09:38:28 +02:00
Ferran Recio b01dd76331 MDL-78148 core_courseformat: reduce the use of uniqid in templates 2023-05-29 08:40:18 +02:00
Angelia Dela Cruz 948ac8f62b MDL-70152 behat: Forum behat generators use UI
Behat cleanup and optimisation
2023-05-29 10:28:04 +08:00
Angelia Dela Cruz d7752f9576 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-05-29 10:27:33 +08:00
Andrew Nicols c38a977f3d 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-05-29 10:27:33 +08:00
Meirza e076d036c2 MDL-76673 atto: Check color contrast only on elements that have text
If the content in Atto is wrapped by an element with only a background color, without text color,
the accessibility checker will use the parent text-color as the foreground color, which is owned by form-control,
it becomes a problem if the wrapped element background using #34274f and the parent text-color is #495057 then
the low contrast as a result.

To avoid such a situation, the patch will only calculate color contrast if only the element has text,
so it will give results per element if the accessibility checker is unsatisfied.
2023-05-27 13:56:50 +07:00
Meirza c6b52f6822 MDL-76673 tiny: Check color contrast only on elements that have text
If the content in Tiny is wrapped by an element with only a background color, without text color,
the accessibility checker will use the parent text-color as the foreground color, which is owned by form-control,
it becomes a problem if the wrapped element background using #34274f and the parent text-color is #495057 then
the low contrast as a result.

To avoid such a situation, the patch will only calculate color contrast if only the element has text,
so it will give results per element if the accessibility checker is unsatisfied.

The patch also changes the selected element from 'body > *' to 'body *',
so it will return all elements (parents and children) in the content instead of parents only.

And minor modifications on the warning_content.mustache to fix the numbering format.
2023-05-27 13:56:50 +07:00
Eloy Lafuente (stronk7) 278ce49b7f MDL-78036 behat: Fix php81 deprecation warning 2023-05-26 18:04:26 +02:00
Dani Palou 4cbe98f2e7 MDL-78368 airnotifier: Fix data encrypted several times
Backport of MDL-78054.
2023-05-26 21:46:35 +08:00
Paul Holden a22aabb29f MDL-78352 webservice: use default user context page heading. 2023-05-26 12:27:46 +01:00
Wehr Mario d7194d3de0 MDL-78004 cache: Fix deprecated null value in Redis connect 2023-05-26 13:22:35 +02:00
Paul Holden 1ff279717e MDL-73648 badges: add Behat generator class for creating badges. 2023-05-26 12:19:27 +01:00
Paul Holden 017f8a9c4d MDL-73138 group: remove double encoding of group/role names. 2023-05-26 10:25:50 +01:00
Paul Holden 16c5835a80 MDL-73138 user: avoid double encoding participant filter values. 2023-05-26 10:25:50 +01:00
Sara Arjona 090baf556e weekly release 4.1.3+ 2023-05-26 09:28:53 +02:00
Sara Arjona 0b46994b0c Merge branch 'install_401_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_401_STABLE 2023-05-26 09:28:45 +02:00
Adrien Loison a229905760 MDL-78262 lib_spout: Update box/spout to address PHP 8.1 deprecation 2023-05-26 08:50:17 +07:00
Jun Pataleta 1c7f1e0bed Merge branch 'MDL-78346-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-05-25 16:56:14 +02:00
Jun Pataleta 59596ddedc Merge branch 'MDL-76065-401' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-05-25 16:56:14 +02:00
Jun Pataleta 34dd7e7978 Merge branch 'MDL-78320-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-25 16:56:14 +02:00
Jun Pataleta e7d2f494c3 Merge branch 'MDL-78346-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-05-25 16:56:14 +02:00
Andrew Nicols 9c5febc47c MDL-78346 tool_langimport: Print any notifications before redirect 2023-05-25 14:55:01 +08:00
Andrew Nicols 4ddbcf2aec MDL-78346 tool_langimport: Redirect after action to prevent resubmission 2023-05-25 11:14:15 +08:00
Andrew Nicols 9dc72be2d4 MDL-78346 tool_langimport: Prevent uninstallation of invalid targets 2023-05-25 11:14:14 +08:00
Andrew Nicols 05a5ed676c Merge branch 'MDL-77995-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-25 09:50:47 +08:00
Paul Holden aaf17fc8b6 MDL-78320 quiz_overview: format group names in overview report. 2023-05-24 16:19:34 +01:00
Andrew Nicols b870bc0577 Merge branch 'MDL-77983-401' of https://github.com/rjnl/moodle into MOODLE_401_STABLE 2023-05-24 21:15:17 +08:00
= 282a908540 MDL-63120 core_badges: Avoid multiple joins in sql statement 2023-05-24 13:36:41 +02:00
Jun Pataleta 9e582a6099 Merge branch 'MDL-78072-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-05-24 17:56:27 +08:00
Jun Pataleta ff402c26e5 Merge branch 'MDL-78005-401' of https://github.com/davewoloszyn/moodle into MOODLE_401_STABLE 2023-05-24 12:06:17 +08:00
Simey Lameze b12f914708 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:41:41 +08:00
Angelia Dela Cruz e7d32b89ac 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:41:41 +08:00
Sara Arjona 22705fa4fb Merge branch 'MDL-78176_401' of https://github.com/AnupamaSarjoshi/moodle into MOODLE_401_STABLE 2023-05-23 17:45:57 +02:00
Sara Arjona 7c0954ccd1 Merge branch 'MDL-78242-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-23 17:37:00 +02:00
Jun Pataleta 0479c711c2 Merge branch 'MDL-76688/401' of https://github.com/skodak/moodle into MOODLE_401_STABLE 2023-05-23 15:22:04 +08:00
Angelia Dela Cruz de6c14ee71 MDL-77547 Behat: Coverage to check for bad multichoice questions 2023-05-23 15:17:43 +08:00
Simey Lameze 1936b30c88 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 12:23:26 +08:00
Angelia Dela Cruz f19f31736a 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:15:25 +08:00
Andrew Nicols 1450dade43 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 10:58:07 +08:00
Andrew Nicols 2b01af17be Merge branch 'MDL-78170-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-23 10:28:33 +08:00
AMOS bot 439f75e6e1 Automatically generated installer lang files 2023-05-23 00:10:27 +00:00
Paul Holden dec3d56032 MDL-76838 backup: remove invalid utf8 code sequences writing XML.
The surrogate blocks FFFE and FFFF are non-characters, specifically
disallowed in the character range for XML documents.
2023-05-22 21:04:12 +01:00
Paul Holden 452c7c72e0 MDL-78322 tool_cohortroles: don't assign roles to deleted users. 2023-05-22 20:14:39 +01:00
Tim Hunt 0d0868ee97 MDL-78008 qtype_multianswer: random guess score with missing subqs
Sometimes, due to other bugs, subquestions can get lost, so the code
needs to be robust to this.
2023-05-22 17:02:22 +01:00
Sara Arjona c98e7e7dbf Merge branch 'MDL-78211-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-22 17:41:48 +02:00
Sara Arjona 90e18e28a2 Merge branch 'MDL-78226-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-22 17:29:27 +02:00
Sara Arjona db7c650f8c Merge branch 'MDL-78225-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-22 12:04:19 +02:00
sam marshall 79d0e63b18 MDL-78092 Cache: Modinfo locking with Redis store does not work
The feature added in 4.1 to lock the modinfo cache does not work when
using Redis, because:

* The API to acquire a cache lock is confusing, and the code did not
  check that it successfully acquired a lock before going on to build
  the cache anyway.

* Unlike the other types of cache lock, the Redis store did not retry
  the lock for a timeout period before giving up and failing.

This change fixes both points.
2023-05-22 10:45:13 +01:00
Jun Pataleta 962c8ef477 Merge branch 'MDL-78157-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-05-22 15:29:30 +08:00
Andrew Nicols 2036f2439e MDL-78157 js: Be more careful about inserting missing module names
It is perfectly legitimate to create and/or use a method named `define`
in JS outside of RequireJS.

Unfortunately our requirejs.php wrapper is dumb and does not understand
this.

In the long term we need to stop doing this at all. We really should be
able to already, but every time I try to something prevents it.

In the interim, this change adds a secondary check to see if there is an
existing define which _does_ have the right name in it already.
2023-05-22 14:40:41 +08:00
Luca Bösch 6bb4351e8b MDL-78229 quiz: quiz editing page less narrow.
This is a backport of MDL-77872.
2023-05-19 18:13:07 +02:00
Anupama Sarjoshi 80fa181a26 MDL-78176 Question: Fix D&D onto image and D&D markers theme issue 2023-05-19 16:28:53 +01:00
Jun Pataleta 6ca70dd59f weekly release 4.1.3+ 2023-05-19 21:13:57 +08:00
Jun Pataleta 712737e955 Merge branch 'install_401_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_401_STABLE 2023-05-19 21:13:54 +08:00
Andrew Nicols 5e32d574c6 MDL-77733 behat: Remove extraneous no-axe option
There is no need for no-axe if we make axe a boolean value. We already
have automatic support for negated boolean flags.
2023-05-19 11:28:08 +08:00
Mark Johnson 5620e0059a MDL-75696 quiz: Fix restoring pre-4.0 quizzes with random questions
Restoring multiple quizzes from a pre-4.0 backup was broken when
the quizzes shared a random question. This is because after the
first quiz created a set reference in place of the random question,
it deleted the question record so it was not there for the second
quiz to use. This change tracks the IDs of random questions so
they can be deleted at the end.
2023-05-18 15:59:53 +01:00
Mark Johnson 85b1e992e9 MDL-75696 quiz: Set default value for includingsubcategories on restore 2023-05-18 15:56:02 +01:00
Mark Johnson 8d50911af5 MDL-75696 backup: Fix backup version checks
Several version checks were incorrectly using
restore_controller::info::moodle_release instead of moodle_version as a
version number. This replaces all of those checks with a common pair of
methods to make the checks clearer and more maintainable.
2023-05-18 15:56:02 +01:00
Paul Holden 5c871bff29 MDL-78308 output: better parsing of custom menu item configuration.
Previously certain values would cause deprecation notices in PHP8.1.
2023-05-18 10:19:18 +01:00
Jun Pataleta 096f1e67c8 Merge branch 'MDL-78116-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-05-18 12:11:31 +08:00
Andrew Nicols 21cc09fa2d Merge branch 'MDL-77451-401' of https://github.com/rezaies/moodle into MOODLE_401_STABLE 2023-05-18 11:56:33 +08:00
Jun Pataleta e2a7a44d3e Merge branch 'MDL-78135-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-18 11:54:46 +08:00
Andrew Nicols b28a28ef0f Merge branch 'MDL-78260_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-05-18 11:51:47 +08:00
Andrew Nicols 30e9810589 Merge branch 'MDL-78151-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-18 11:48:39 +08:00
Andrew Nicols cf83791269 Merge branch 'MDL-77733-401' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-05-18 11:44:18 +08:00
David Woloszyn 3f07fc246f MDL-78005 editor_tiny: Declared vars to supress error logging 2023-05-18 13:03:04 +10:00
Tim Hunt 3d023db5b0 MDL-78260 quiz stats: fix View details for random questions 2023-05-17 09:04:49 +01:00
Rajneel Totaram 13b48a0ae8 MDL-77983 core_user: Avoid passing nulls to base64_decode 2023-05-17 19:39:52 +12:00
Ilya Tregubov 87223abc7a Merge branch 'MDL-78152-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-17 15:07:38 +08:00
AMOS bot e7458d017a Automatically generated installer lang files 2023-05-17 00:10:58 +00:00
Jun Pataleta d2b81dd116 Merge branch 'MDL-77439-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-05-16 20:39:09 +08:00
Peter Mayer 361f0fa524 MDL-77439 lib_filebrowser: Splitup query to speedup get_courses 2023-05-16 20:37:57 +08:00
Paul Holden 7a23da59ce MDL-78026 group: format retrieved group names from external methods. 2023-05-16 10:10:06 +01:00
Paul Holden 01ae473823 MDL-77264 grade: define fallback name of abstract export event. 2023-05-16 09:54:40 +01:00
Paul Holden 0aff5ccd01 MDL-77259 tool_monitor: use core component API for event list.
The previous method of hardcoded filepaths, specifically for events
belonging to core, meant that any events belongs to core subsystems
were omitted (core_customfield, core_h5p, core_payment, etc).
2023-05-16 09:50:22 +01:00
Angelia Dela Cruz 7a511874b8 MDL-77907 Behat: Coverage for duplicating competency framework 2023-05-16 16:11:58 +08:00
Andrew Nicols a1b37845a8 MDL-78072 core: Skip mobile encryption if Sodium is not available 2023-05-16 12:51:14 +08:00
Jake Dallimore 071adb2fb1 Merge branch 'MDL-77930-401' of https://github.com/rjnl/moodle into MOODLE_401_STABLE 2023-05-16 10:50:04 +08:00
Jake Dallimore aa39ebbb99 Merge branch 'MDL-78120-401' of https://github.com/lucaboesch/moodle into MOODLE_401_STABLE 2023-05-16 10:45:27 +08:00
Jun Pataleta 4818dae2fc Merge branch 'MDL-75576_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-05-16 09:59:01 +08:00
Ilya Tregubov dc38a92ec6 Merge branch 'MDL-77840-401' of https://github.com/davewoloszyn/moodle into MOODLE_401_STABLE 2023-05-16 09:47:48 +08:00
Andrew Nicols 946405d44b Merge branch 'MDL-77432-401' of https://github.com/lucaboesch/moodle into MOODLE_401_STABLE 2023-05-15 22:12:44 +08:00
Andrew Nicols bdeda3ea9b Merge branch 'MDL-78149-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-15 22:07:13 +08:00
Andrew Nicols 01c04f4cf8 Merge branch 'MDL-78140-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-15 22:03:30 +08:00
Paul Holden 9ef8025e4c MDL-78242 roles: consistently check course contact config. 2023-05-15 13:04:48 +01:00
Tim Hunt efe895f1bb MDL-75576 quiz/question statistics: don't expire by time
Previously, a set of calculated quiz statistics would only 'last' for
15 minutes. Then they would be considered invalid and not used.

Now, computed statistics are kept indefinitely. Instead, when a new
batch of values are computed for a particular set of settings, older numbers
for the same settings are deleted first. Therefore,
question_stats_cleanup_task is no more.
2023-05-15 10:04:34 +01:00
Tim Hunt a532f407bb MDL-75576 quiz statistics: don't time-limit the use of cached values
This should have been done as part of  MDL-74762, but was missed.
2023-05-15 10:04:33 +01:00
Tim Hunt 86932a330b MDL-75576 quiz statistics: don't compute when a user views the qbank
Previously, when users viewed the question bank, if the quiz statistics
had not already been calculated, we would try to compute them there an then.
This could be very, very slow, leading to session lock problems.

Now, we never try to compute the statistics on the fly. Instead, we rely
on the existing \quiz_statistics\task\recalculate scheduled task to do it.
2023-05-15 10:04:33 +01:00
Tim Hunt db9a0e296a MDL-75576 question bank: bulk-load statistics for all questions at once
There is a new method on the column class, for the column to declare any
statistics it requires. The question then efficiently loads all those
statistics in one go, and makes them available as the columns are
rendererd, or do any subsequent processing.
2023-05-15 10:04:33 +01:00
Tim Hunt 9ff59e99ff MDL-75576 qbank_statistics: remove copy-pasted PHPdoc comments
These methods are already correctly documented on the base class.
2023-05-15 10:04:32 +01:00
Luca Bösch 997990f94f MDL-78120 login: handle empty wantsurl on login with alternateloginurl. 2023-05-15 10:19:00 +02:00
Paul Holden e5132eff2f MDL-77995 javascript: more precise path matching building JS. 2023-05-15 09:05:51 +01:00
Paul Holden 7093578baf MDL-77723 user: ensure identity refers to a valid custom profile field. 2023-05-15 09:03:40 +01:00
Jun Pataleta 28026b923a Merge branch 'MDL-76903-401' of https://github.com/laurentdavid/moodle into MOODLE_401_STABLE 2023-05-15 12:06:02 +08:00
Andrew Nicols 0e4426818a Merge branch 'MDL-78125-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-05-15 11:58:59 +08:00
Jun Pataleta e9f6b9c2d6 MDL-78125 qtype_multianswer: Convert popover trigger to link
According to Boostrap Popovers documentation for popovers triggered
on focus:
"For proper cross-browser and cross-platform behavior, you must use the
<a> tag, not the <button> tag, and you also must include a tabindex
attribute."
2023-05-12 22:47:11 +08:00
Luca Bösch f1dd604fce MDL-77432 mod_assign: Confirm submission page standard and not incourse 2023-05-12 09:44:22 +02:00
Ilya Tregubov 017a3274fe weekly release 4.1.3+ 2023-05-12 08:56:50 +08:00
Ilya Tregubov 3b9bfc1d79 Merge branch 'install_401_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_401_STABLE 2023-05-12 08:56:48 +08:00
Cameron Ball 77eb2ed79b MDL-75898 assignfeedback_editpdf: Add randomness to PDF annotations
The behat step "I draw on the pdf" creates the exact same line every
time it is called. This can cause issues in a situation like the following:

- Student uploads PDF
- Teacher annotates page 1
- Student edits submission, adding another PDF
- Teacher annotates page 1 again
- When the student looks at their annotated PDF it appears the same as
  before they added the second PDF (i.e., they don't see extra pages for
  the second PDF)

Exactly why this happens isn't clear, and in practice this probably never
happens because the chances of drawing the exact same line twice are almost
0. However, when testing the functionality added in MDL-45580 it was causing
issues.
2023-05-12 09:14:03 +10:00
Cameron Ball 90350915c2 MDL-75898 assignfeedback_editpdf: Don't poll readonly pages
When requesting the readonly version of pages (which contain
teacher annotations), they should always be available - the
PHP side even throws an exception when they're not. This
means we don't need to worry about polling document converters
from the JS side and can just return the pages immediately.
2023-05-12 09:14:03 +10:00
Cameron Ball 825609ae08 MDL-75898 assignfeedback_editpdf: Improve page count mismatch logic
MDL-45580 introduced the readonlypages filearea, and when loading
page images for an attempt, the code would check if the pages existed
, creating them if not. The code inside this block also contained
a guard clause for the case where no readonly pages existed - which
is a situation that should not happen. Whenever readonly pages are
requested, they should exist.

MDL-66626 introduced a situation where page counts not matching would
also retrigger page generation. However this led to a situation where
the guard clause could be entered when requesting readonly pages.

This patch refactors the guard clause, and improves the logic to
regenerate pages.
2023-05-12 09:14:03 +10:00
Paul Holden 5b3d55def7 MDL-78226 contentbank: verify presence of bank heading element. 2023-05-11 23:16:33 +01:00
Paul Holden 67effa603e MDL-78225 output: add sesskey for post requests only in renderables. 2023-05-11 22:48:54 +01:00
Laurent David 20b4efad5c MDL-76903 mod_book: Fix activity completion
* Check only visibles pages to set completion status.
* Make sure we have consistent completion value in API and on the view page.
2023-05-11 12:09:24 +02:00
Paul Holden 11af0c5388 MDL-78140 analytics: improve context restrictions manager test.
This test apparently fails sporadically on Oracle, without obvious
causes. The failure however was hard to interpret, and the test
itself made a lot of assumptions about the system re. naming of
categories/courses. This could be prone to errors, so improve that.
2023-05-11 09:38:01 +01:00
Paul Holden 683840999d MDL-77946 access: fix category sort order of capability contexts. 2023-05-11 08:33:32 +01:00
Jun Pataleta f8537a9536 Merge branch 'MDL-76344-401-fix' of https://github.com/stevandoMoodle/moodle into MOODLE_401_STABLE 2023-05-11 14:35:30 +08:00
Stevani Andolo 7b1e0a6980 MDL-76344 course: Fixed course image 'non image file' layout 2023-05-11 14:11:16 +08:00
Jake Dallimore 838047106d Merge branch 'MDL-75552-401' of https://github.com/sarjona/moodle into MOODLE_401_STABLE 2023-05-11 11:23:49 +08:00
Sara Arjona 84175f399f Merge branch 'MDL-78040-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-10 19:45:18 +02:00
Paul Holden 9e0f8fc7bf MDL-78211 contentbank: fix context option when formatting categories. 2023-05-10 17:42:29 +01:00
Paul Holden c228866a46 MDL-78151 core: account for timezone differences in intl extension.
Recent additions to timezones from the IANA TZDB are not necessarily
reflected in those used by the intl extension and/or ICU zones:

 * America/Ciudad_Juarez
 * America/Nuuk
 * Europe/Kyiv
 * Pacific/Kanton

Create mapping to allow these zones to be used without errors.
2023-05-10 17:12:33 +01:00
Juan Leyva d82f68742b MDL-78196 user: Fix files used space check 2023-05-10 17:17:48 +02:00
Andrew Nicols da78523b15 Merge branch 'MDL-77592-401' of https://github.com/golenkovm/moodle into MOODLE_401_STABLE 2023-05-10 13:03:57 +08:00
Andrew Nicols 5ceb711355 Merge branch 'MDL-78034-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-10 13:00:30 +08:00
Ilya Tregubov 1d5ef6aa9a Merge branch 'MDL-75623-MOODLE_401_STABLE' of https://github.com/sh-csg/moodle into MOODLE_401_STABLE 2023-05-10 11:46:40 +08:00
Paul Holden d3b4e4a9a5 MDL-78170 rating: consistently calculate average rating aggregation.
Ensure it's always cast by the database as a float, to avoid loss of
precision.
2023-05-09 15:57:43 +01:00
Paul Holden d7ba3f656d MDL-78149 mod_data: ensure group selector is always present. 2023-05-09 12:20:35 +01:00
Paul Holden 48963bb7a7 MDL-78152 mod_book: set permissions required for page editing. 2023-05-09 12:11:32 +01:00
Shamim Rezaie f36c96411d MDL-77451 gradereport: stress handling for multiple clicks 2023-05-09 19:15:37 +10:00
Andrew Nicols 50d1e69df6 MDL-75552 badges: move apiBase consumption to backpack
The apiBase in .well-known/badgeconnect.json was ignored and it was
causing some failures when connecting or sending badges to an
external backpack.
For OBv2.1, it has been changed to always use the apiBase defined
in the badgeconnect.json backpack provider.
2023-05-09 08:51:30 +02:00
Rajneel Totaram f6c5fa3bfc MDL-77930 accesslib: php81 deprecation warnings on missing plugins 2023-05-09 17:37:00 +12:00
Juan Leyva d838917d28 MDL-78072 airnotifier: Apply payload size optimisation to all push
Backport of MDL-77893.

Co-authored by: Andrew Lyons <andrew@nicols.co.uk>
2023-05-09 13:07:10 +08:00
Juan Leyva 1af4ace4d6 MDL-78072 airnotifier: Allow configuring how to process encrypted notifs
Backport of MDL-77893.

Co-authored by: Andrew Lyons <andrew@nicols.co.uk>
2023-05-09 13:07:09 +08:00
Juan Leyva 5c85fb975d MDL-78072 airnotifier: Leave only message data processed by: Airnotifier
Backport of MDL-77893.

Co-authored by: Andrew Lyons <andrew@nicols.co.uk>
2023-05-09 13:07:09 +08:00
Juan Leyva 2ad6fecca5 MDL-78072 airnotifier: Allow to set publickey when creating new device
Backport of MDL-77893.

Co-authored by: Andrew Lyons <andrew@nicols.co.uk>
2023-05-09 13:07:09 +08:00
Sara Arjona 1201526dbc MDL-78072 core: Fix upgrade failures with MariaDB
Backport of MDL-76722.

Co-authored by: Andrew Lyons <andrew@nicols.co.uk>

The 'enable' field doesn't exist, and this is causing some failures
with MariaDB (and probably with MySQL too).
2023-05-09 12:26:00 +08:00
Alex Morris 6ccb50ea9d MDL-78072 message_airnotifier: Add encrypted notifications
Backport of MDL-76722.

Co-authored by: Andrew Lyons <andrew@nicols.co.uk>
2023-05-09 12:25:47 +08:00
Alex Morris 25498b6b62 MDL-78072 user: Add new update_user_device_public_key webservice
Backport of MDL-76722.

Co-authored by: Andrew Lyons <andrew@nicols.co.uk>
2023-05-09 12:25:29 +08:00
Alex Morris a2179f028c MDL-78072 lib/db: Add new publickey field to user_devices table
Backport of MDL-76722.

Co-authored by: Andrew Lyons <andrew@nicols.co.uk>
2023-05-09 12:25:16 +08:00
Petr Skoda a7920b3860 MDL-76688 filter_text: prevent LaTeX3 syntax 2023-05-08 10:12:46 +02:00
AMOS bot 893fe94c89 Automatically generated installer lang files 2023-05-07 00:07:26 +00:00
Paul Holden ba904934ec MDL-78135 completion: include required criteria library in test. 2023-05-05 16:45:48 +01:00
Jake Dallimore b3feea921d MDL-76821 enrol_lti: prevent legacy launches via upgraded enrolment
If the enrolment instance (the 'published resource') has been upgraded
from LTI 1.1/2.0 to LTI 1.3 (i.e. a new instance was not created),
prevent legacy launches which may occur from old resource links. Only
LTI Advantage launches should be permitted through the method.
2023-05-05 17:11:09 +08:00
Jake Dallimore 22c346831e MDL-76821 enrol_lti: fix bug in repo causing return of legacy lti users
If the enrolment method is updated from an LTI 1.1/2.0 tool to an LTI
1.3 tool, it may have associated enrol_lti_users records not having
ltideploymentid values. These are legacy users and must not be returned
by the repository, which deals only with LTI 1.3 LTI users.
2023-05-05 17:11:06 +08:00
Jake Dallimore 75ba439f5b MDL-77990 enrol_lti: fix http_client shim by using curl getResponse
Fixes an error in the parsing of response headers containing multiple
HTTP responses in the raw response. Curl already handles this, so let
it do the work.
2023-05-05 10:44:19 +08:00
Jake Dallimore 159a131989 MDL-77990 enrol_lti: test covering the response header parsing
Makes sure the http_client shim properly returns the correct, final
http headers, not intermediate headers such as 302, 100 etc.
2023-05-05 10:44:18 +08:00
Jun Pataleta 0703a8db55 Merge branch 'MDL-76344-401' of https://github.com/stevandoMoodle/moodle into MOODLE_401_STABLE 2023-05-05 10:34:56 +08:00
Sara Arjona 176a323b4e weekly release 4.1.3+ 2023-05-04 12:42:50 +02:00
Eloy Lafuente (stronk7) 42f3874b80 MDL-78116 core: Run tests against Windows on GHA
Signed-off-by: Andrew Nicols <andrew@nicols.co.uk>
2023-05-04 15:40:18 +08:00
Stevani Andolo 1f07219332 MDL-76344 course: Fixed course image 'non image file' layout 2023-05-04 10:28:15 +08:00
Paul Holden 0c7e7645d5 MDL-78040 block_glossary_random: switch to block test generator.
Random failures after manually adding block instances (specifically
on slow/Oracle systems) can be entirely avoided by using the block
test generator for scenarios that are not specifically concerned with
manually adding blocks.
2023-05-03 17:16:22 +01:00
Laurent David 9117af48ac MDL-77781 core_completion: Completion view must be deleted too
When resetting a course, completion view entries should also be
deleted

Co-authored-by: Georg Moser <georg@moser.link>
2023-05-03 16:05:28 +02:00
Jun Pataleta d1c24b02ab Merge branch 'MDL-77398-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-03 20:36:18 +08:00
Jake Dallimore 79fe493ab4 Merge branch 'MDL-77384-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-03 16:52:45 +08:00
Jake Dallimore d66398c356 Merge branch 'MDL-78023-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-03 16:15:59 +08:00
Sara Arjona 6064ce62f5 Merge branch 'MDL-77312-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-03 09:59:22 +02:00
Ilya Tregubov 88113fc983 Merge branch 'MDL-77320-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-03 15:37:00 +08:00
Ilya Tregubov e19573d6bf Merge branch 'MDL-77810-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-03 13:08:52 +08:00
Ilya Tregubov 3994ab206b Merge branch 'MDL-77987_401' of https://github.com/AnupamaSarjoshi/moodle into MOODLE_401_STABLE 2023-05-03 12:40:34 +08:00
Ilya Tregubov b9d84d03ca Merge branch 'MDL-77546-401' of https://github.com/mihailges/moodle into MOODLE_401_STABLE 2023-05-03 10:57:29 +08:00
Jun Pataleta f8fdd198a9 Merge branch 'MDL-77394-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-03 10:31:00 +08:00
Jun Pataleta 394d592fab Merge branch 'MDL-78038-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-03 10:25:30 +08:00
Jun Pataleta 64c625e590 Merge branch 'MDL-78011-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-03 09:57:56 +08:00
Ilya Tregubov be0eb4369b Merge branch 'MDL-76835-401' of https://github.com/aya-saad1/moodle into MOODLE_401_STABLE 2023-05-03 09:29:59 +08:00
David Woloszyn b3424d620d MDL-77840 enrol_lti: Avoid passing nulls to base64_encode 2023-05-03 09:36:17 +10:00
Sara Arjona 767419571e Merge branch 'MDL-77858-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-02 16:49:53 +02:00
Sara Arjona aa63dca768 Merge branch 'MDL-77791_401' of https://github.com/dvdcastro/moodle into MOODLE_401_STABLE 2023-05-02 12:03:59 +02:00
Jun Pataleta 2dc4853ba5 Merge branch 'MDL-76857-401' of https://github.com/sarjona/moodle into MOODLE_401_STABLE 2023-05-02 15:44:55 +08:00
David Woloszyn 5ab74afad4 MDL-77840 lti: Avoid passing nulls to base64_encode 2023-05-02 13:52:12 +10:00
David Woloszyn f25ecd9bfa MDL-77840 backup: Avoid passing nulls to base64_encode 2023-05-02 13:52:12 +10:00
David Woloszyn 88496af850 MDL-77840 mnet: Avoid passing nulls to base64_encode 2023-05-02 13:52:12 +10:00
Ilya Tregubov d28386a29d Merge branch 'MDL-78025_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-05-02 11:43:30 +08:00
Jake Dallimore 4fa9ed7956 Merge branch 'MDL-78009-401' of https://github.com/marinaglancy/moodle into MOODLE_401_STABLE 2023-04-28 13:26:02 +08:00
Paul Holden 569a71daea MDL-77810 gradereport_summary: show localised plugin name in report. 2023-04-27 15:19:33 +01:00
Ilya Tregubov 4901ffe1ba weekly release 4.1.3+ 2023-04-27 19:28:38 +08:00
Sara Arjona b10f6f5036 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 11:21:36 +02:00
Paul Holden 30e419078f MDL-77320 tool_licensemanager: restrict exposure of user sesskey. 2023-04-27 09:32:37 +01:00
Mihail Geshoski f90a55979a MDL-77546 gradereport_singleview: Fix item order in grade item selector 2023-04-27 12:01:23 +08:00
Jun Pataleta 013735af51 Merge branch 'MDL-77883-401' of https://github.com/danghieu1407/moodle into MOODLE_401_STABLE 2023-04-27 11:08:54 +08:00
Jun Pataleta 6c890a6330 Merge branch 'MDL-77997_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-04-27 10:40:43 +08:00
Paul Holden 4f7dd1a54b MDL-78038 mod_bigbluebuttonbn: observe course format section config. 2023-04-26 16:10:52 +01:00
Tim Hunt de8607067f MDL-78025 questions: improve the comment on question_references.version 2023-04-26 15:45:12 +01:00
Tim Hunt 15ff1352c2 MDL-78025 questions: fix PHPdoc on question_require_capability_on 2023-04-26 15:45:00 +01:00
Tim Hunt 384ab12c55 MDL-78025 quiz: fix the quiz_questions_in_use logic 2023-04-26 15:44:54 +01:00
Tim Hunt 4a9c0b1410 MDL-78025 questions: questions_in_use should check question_references
This avoids the needs for plugins to do separate queries, which is
easier for them, and better performing.
2023-04-26 15:40:41 +01:00
Tim Hunt d2d9d762ad MDL-78025 question generator: make the behaviour less surprising
* The object returned by update_question is alwasy a new clone
  and the $question passed in will not be modified.

* The returned object has the fields like questionbankentryid and
  the ones related to versionning, so it is more like the data
  returned by question_bank::load_question_data.
2023-04-26 15:40:36 +01:00
Tim Hunt a9fa52295a MDL-78025 question: move hiding logic into question_delete_question
This logic belongs in the API, so it is applied consistently.

Also this avoids calling the expensive function questions_in_use
twice per question.
2023-04-26 15:38:57 +01:00
Paul Holden eca7a9ce2b MDL-78034 mod_bigbluebuttonbn: format instance group names. 2023-04-26 15:31:44 +01:00
Aya Saad bba6cc2f02 MDL-76835 theme: Fix unordered lists indentation 2023-04-26 13:57:49 +02:00
David Castro e5c89630af MDL-77791 data: Fix file attachment to search doc 2023-04-25 19:49:33 -05:00
Paul Holden 491ee67cd9 MDL-78023 tool_policy: cast timemodified column on table download. 2023-04-25 14:51:13 +01:00
Sara Arjona 9a3430f3fe Merge branch 'MDL-77313-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-04-25 15:18:42 +02:00
Paul Holden 79982a82a4 Merge branch 'MDL-78007-401' of https://github.com/HuongNV13/moodle into MOODLE_401_STABLE 2023-04-25 12:36:09 +01:00
Paul Holden 4ee0bdfda6 Merge branch 'MDL-73331_401_toolbrickfieldadvancedtab' of https://github.com/brickfield/moodle into MOODLE_401_STABLE 2023-04-25 11:54:17 +01:00
Paul Holden d10d553890 Merge branch 'MDL-77766-401-2' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-04-25 09:38:37 +01:00
Paul Holden 22b481f73c MDL-77384 check: clarify statistics check name. 2023-04-25 09:04:41 +01:00
Paul Holden b867e4db40 MDL-78011 qbank_managecategories: require library for pagesize const. 2023-04-24 15:35:54 +01:00
Marina Glancy ccdaef7a68 MDL-78009 auth: require necessary files 2023-04-24 13:38:58 +01:00
Jun Pataleta 952c8770b6 MDL-77766 qtype_truefalse: Respect showstandardinstruction
* When showstandardinstruction is set to no, replace the standard
instruction with the generic "Answer" text for the answer options
fieldset's legend.
2023-04-24 20:11:20 +08:00
Jun Pataleta 132ac7486d MDL-77766 qtype_multichoice: Respect showstandardinstruction
* When showstandardinstruction is set to no, replace the standard
instruction with the generic "Answer" text for the answer options
fieldset's legend.
2023-04-24 20:11:20 +08:00
Tim Hunt a9f629fbf9 MDL-77997 questions: add back Export as XML to the preview screen
The used the exist in Moodle up to 3.11, but then was removed with
insufficient thought in 4.0 (because we had grander long-term plans
which still have not happened). Until those plans happen, this
commit adds the simple link back on the preview screen.
2023-04-24 11:23:47 +01:00
Anupama Sarjoshi c6708db889 MDL-77987 Backup: add progress tracking to some slow steps 2023-04-24 11:17:34 +01:00
Paul Holden 0d7393c7ee MDL-77312 files: exclude drafts when determining license usage. 2023-04-24 11:07:38 +01:00
Paul Holden f3ae5116d0 MDL-77313 restore: re-add field to indicate course/category search.
When the two restore forms for searching courses and categories were
converted to core templates in eb9935c9 they lost the named submit
button, which broke searching.
2023-04-24 11:04:26 +01:00
Paul Holden b01ce337f6 MDL-77858 javascript: correct core/notification exception imports. 2023-04-24 10:44:14 +01:00
Paul Holden bb433919cc MDL-77394 mod_forum: de-couple discussion pinned/starred options. 2023-04-24 10:38:01 +01:00
Paul Holden 1e16260ba7 MDL-77398 mod_assign: disable form submit protection for batch options. 2023-04-24 10:35:15 +01:00
Huong Nguyen 4ec5aac734 MDL-78007 tiny_media: Fix wrong condition for the Tiny Media
Including in this commit:
 - Switched to Tiny editor in manually_mark_question.feature
2023-04-24 15:59:32 +07:00
danghieu1407 b04fab1a2a MDL-77883 forms: fix display of client-side validation for textareas 2023-04-24 13:54:37 +07:00
Max Larkin 60a2798da7 MDL-73331 tool_brickfield: Update advanced tab display 2023-04-19 12:57:37 +01:00
Simey Lameze 5d000c6f35 MDL-77733 behat: enable Axe accessibility tests by default 2023-04-04 09:18:19 +08:00
Stefan Hanauska df0f9fa06d MDL-75623 backup: Encode pluginfile URLs 2023-04-01 09:09:39 +02:00
Mikhail Golenkov af7422edc0 MDL-77592 filter_tex: Use request dir instead of temp shared storage 2023-03-31 14:34:54 +11:00
Brendan Heywood 25edc77d10 MDL-77749 admin: Fix code error with unset config duration 2023-03-26 16:18:13 +11:00
Miri Lipson a10f75360b MDL-75047 icons: Define the orientation of the question mark in right-to-left languages. 2023-01-23 17:26:45 +02:00
Hiroto Kagotani 5fa1ec0dfa MDL-76936 course: purge course cache on resetting start date 2023-01-19 20:08:58 +09:00
1174 changed files with 19331 additions and 8938 deletions
+144
View File
@@ -0,0 +1,144 @@
name: Windows Testing
on:
workflow_dispatch
env:
php: 8.1
jobs:
Grunt:
runs-on: windows-latest
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checking out code
uses: actions/checkout@v3
- name: Configuring node & npm
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Installing node stuff
run: npm ci
- name: Running grunt
run: npx grunt
- name: Looking for uncommitted changes
# Add all files to the git index and then run diff --cached to see all changes.
# This ensures that we get the status of all files, including new files.
# We ignore npm-shrinkwrap.json to make the tasks immune to npm changes.
run: |
git add .
git reset -- npm-shrinkwrap.json
git diff --cached --exit-code
PHPUnit:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
php: 8.1
# Ideally we should use mysql/mariadb, but they are 4x slower without tweaks and configuration
# so let's run only postgres (1.5h vs 6h) only, If some day we want to improve the mysql runs,
# this is the place to enable them.
# db: mysqli
db: pgsql
extensions: exif, fileinfo, gd, intl, pgsql, mysql, redis, soap, sodium
- os: windows-latest
php: 8.0
db: pgsql
extensions: exif, fileinfo, gd, intl, pgsql, mysql, redis, soap, sodium
steps:
- name: Setting up DB mysql
if: ${{ matrix.db == 'mysqli' }}
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: 8.0
user: test
password: test
- name: Creating DB mysql
if: ${{ matrix.db == 'mysqli' }}
run: mysql --host 127.0.0.1 -utest -ptest -e 'CREATE DATABASE IF NOT EXISTS test COLLATE = utf8mb4_bin;';
- name: Setting up DB pgsql
if: ${{ matrix.db == 'pgsql' }}
run: |
# TODO: Remove these conf. modifications when php74 or php80 are lowest.
# Change to old md5 auth, because php73 does not support it.
# #password_encryption = scram-sha-256
(Get-Content "$env:PGDATA\postgresql.conf"). `
replace('#password_encryption = scram-sha-256', 'password_encryption = md5') | `
Set-Content "$env:PGDATA\postgresql.conf"
(Get-Content "$env:PGDATA\pg_hba.conf"). `
replace('scram-sha-256', 'md5') | `
Set-Content "$env:PGDATA\pg_hba.conf"
$pgService = Get-Service -Name postgresql*
Set-Service -InputObject $pgService -Status running -StartupType automatic
Start-Process -FilePath "$env:PGBIN\pg_isready" -Wait -PassThru
& $env:PGBIN\psql --command="CREATE USER test PASSWORD 'test'" --command="\du"
- name: Creating DB pgsql
if: ${{ matrix.db == 'pgsql' }}
run: |
& $env:PGBIN\createdb --owner=test test
$env:PGPASSWORD = 'test'
& $env:PGBIN\psql --username=test --host=localhost --list test
- name: Configuring git vars
uses: rlespinasse/github-slug-action@v4
- name: Setting up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
ini-values: max_input_vars=5000
coverage: none
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checking out code from ${{ env.GITHUB_REF_SLUG }}
uses: actions/checkout@v3
# Needs to be done after php is available, git configured and Moodle checkout has happened.
- name: Setting up moodle-exttests service
run: |
git clone https://github.com/moodlehq/moodle-exttests.git
nssm install php-built-in C:\tools\php\php.exe -S localhost:8080 -t D:\a\moodle\moodle\moodle-exttests
nssm start php-built-in
- name: Setting up redis service
run: |
choco install redis-64 --version 3.0.503 --no-progress
nssm install redis redis-server
nssm start redis
- name: Setting up PHPUnit
env:
dbtype: ${{ matrix.db }}
shell: bash
run: |
echo "pathtophp=$(which php)" >> $GITHUB_ENV # Inject installed pathtophp to env. The template config needs it.
cp .github/workflows/config-template.php config.php
mkdir ../moodledata
php admin/tool/phpunit/cli/init.php --no-composer-self-update
- name: Running PHPUnit tests
env:
dbtype: ${{ matrix.db }}
phpunit_options: ${{ secrets.phpunit_options }}
run: vendor/bin/phpunit $phpunit_options
+1 -1
View File
@@ -16,4 +16,4 @@ Moodle - the world's open source learning platform
This generated documentation includes API documentation for JavaScript written in the AMD and ES2015 module formats within Moodle.
## Related information
See [https://docs.moodle.org/dev](https://docs.moodle.org/dev) for other related Developer Documentation.
See [https://moodledev.io](https://moodledev.io) for other related Developer Documentation.
+1 -1
View File
@@ -114,7 +114,7 @@ module.exports = {
],
"menu": {
"Developer Docs": {
href: "https://docs.moodle.org/dev",
href: "https://moodledev.io",
target: "_blank",
"class": "menu-item",
id: "devdocs"
+2 -3
View File
@@ -30,10 +30,9 @@
* @param {String} srcPath the matched src path
* @return {String} The rewritten destination path.
*/
const 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;
};
+3 -3
View File
@@ -6,7 +6,7 @@ of developers, designers, teachers, testers, translators and other users. We
work in universities, schools, companies and other places. You are very welcome
to join us and contribute to the project.
See <https://docs.moodle.org/dev/Contributing_to_Moodle> for the many ways you
See <https://moodledev.io/general/community/contribute> for the many ways you
can help, not only with coding.
Moodle is open to community contributions to core, though all code must go
@@ -35,7 +35,7 @@ submitted patches has evolved.
* New features are developed on the master branch. Bug fixes are also
backported to currently supported maintenance (stable) branches.
For further details, see <https://docs.moodle.org/dev/Process>.
For further details, see <https://moodledev.io/general/development/process>.
Moodle plugins
--------------
@@ -53,4 +53,4 @@ be easily installed and updated via the Moodle administration interface.
the plugins directory. We do not pull from your code repository; you must do
it explicitly.
For further details, see <https://docs.moodle.org/dev/Plugin_contribution>.
For further details, see <https://moodledev.io/general/community/plugincontribution>.
+1 -1
View File
@@ -20,7 +20,7 @@ Moodle is widely used around the world by universities, schools, companies and
all manner of organisations and individuals.
Moodle is provided freely as open source software, under the GNU General Public
License <https://docs.moodle.org/dev/License>.
License <https://moodledev.io/general/license>.
Moodle is written in PHP and JavaScript and uses an SQL database for storing
the data.
+1 -2
View File
@@ -131,8 +131,7 @@ if ($savebutton) {
$outputhtml .= html_writer::end_tag('div');
}
$visiblepathtosection = array_reverse($settingspage->visiblepath);
$PAGE->set_title("$SITE->shortname: " . implode(": ",$visiblepathtosection));
$PAGE->set_title(implode(moodle_page::TITLE_SEPARATOR, $settingspage->visiblepath));
$PAGE->set_heading($SITE->fullname);
if ($buttons) {
$PAGE->set_button($buttons);
+11
View File
@@ -57,6 +57,7 @@ Options:
--fullname=STRING Name of the site
--shortname=STRING Name of the site
--summary=STRING The summary to be displayed on the front page
--supportemail=STRING Email address for support and help.
-h, --help Print out this help
Example:
@@ -98,6 +99,7 @@ list($options, $unrecognized) = cli_get_params(
'fullname' => '',
'shortname' => '',
'summary' => '',
'supportemail' => '',
'agree-license' => false,
'help' => false
),
@@ -136,6 +138,15 @@ if (!empty($options['adminemail']) && !validate_email($options['adminemail'])) {
cli_error(get_string('cliincorrectvalueerror', 'admin', $a));
}
// Validate that the supportemail provided was an e-mail address.
if (!empty($options['supportemail']) && !validate_email($options['supportemail'])) {
$a = (object) [
'option' => 'supportemail',
'value' => $options['supportemail']
];
cli_error(get_string('cliincorrectvalueerror', 'admin', $a));
}
$options['lang'] = clean_param($options['lang'], PARAM_SAFEDIR);
if (!file_exists($CFG->dirroot.'/install/lang/'.$options['lang'])) {
$options['lang'] = 'en';
+192
View File
@@ -3751,6 +3751,7 @@
<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>
@@ -4113,4 +4114,195 @@
</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>
</COMPATIBILITY_MATRIX>
+3 -3
View File
@@ -224,7 +224,7 @@ if (!core_tables_exist()) {
$strlicense = get_string('license');
$PAGE->navbar->add($strlicense);
$PAGE->set_title($strinstallation.' - Moodle '.$CFG->target_release);
$PAGE->set_title($strinstallation . moodle_page::TITLE_SEPARATOR . 'Moodle ' . $CFG->target_release, false);
$PAGE->set_heading($strinstallation);
$PAGE->set_cacheable(false);
@@ -267,7 +267,7 @@ if (!core_tables_exist()) {
upgrade_init_javascript();
$PAGE->navbar->add($strdatabasesetup);
$PAGE->set_title($strinstallation.' - Moodle '.$CFG->target_release);
$PAGE->set_title($strinstallation . moodle_page::TITLE_SEPARATOR . $CFG->target_release, false);
$PAGE->set_heading($strinstallation);
$PAGE->set_cacheable(false);
@@ -811,7 +811,7 @@ $context = context_system::instance();
if (!has_capability('moodle/site:config', $context)) {
// Do not throw exception display an empty page with administration menu if visible for current user.
$PAGE->set_title($SITE->fullname);
$PAGE->set_title(get_string('home'));
$PAGE->set_heading($SITE->fullname);
echo $OUTPUT->header();
echo $OUTPUT->footer();
+4 -8
View File
@@ -96,20 +96,16 @@ function core_admin_pluginfile($course, $cm, $context, $filearea, $args, $forced
send_file_not_found();
}
// No need for resizing, but if the file should be cached we save it so we can serve it fast next time.
if (empty($maxwidth) && empty($maxheight)) {
// Check whether width/height are specified, and we can resize the image (some types such as ICO cannot be resized).
if (($maxwidth === 0 && $maxheight === 0) ||
!$filedata = $file->resize_image($maxwidth, $maxheight)) {
if ($lifetime) {
file_safe_save_content($file->get_content(), $candidate);
}
send_stored_file($file, $lifetime, 0, false, $options);
}
// Proceed with the resizing.
$filedata = $file->resize_image($maxwidth, $maxheight);
if (!$filedata) {
send_file_not_found();
}
// If we don't want to cached the file, serve now and quit.
if (!$lifetime) {
send_content_uncached($filedata, $filename);
+1 -1
View File
@@ -21,7 +21,7 @@
* Displays the list of found local plugins, their version (if found) and
* a link to delete the local plugin.
*
* @see http://docs.moodle.org/dev/Local_customisation
* @see https://moodledev.io/docs/apis/plugintypes/local
* @package admin
* @copyright 2010 David Mudrak <david.mudrak@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+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) {
+1 -1
View File
@@ -20,7 +20,7 @@
* Displays the list of found plagiarism plugins, their version (if found) and
* a link to uninstall the plagiarism plugin.
*
* @see http://docs.moodle.org/dev/Plagiarism_API
* @see https://moodledev.io/docs/apis/subsystems/plagiarism
* @package admin
* @copyright 2012 Dan Marsden <dan@danmarsden.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -26,42 +26,14 @@ namespace core_adminpresets\local\setting;
*/
class adminpresets_admin_setting_configmultiselect extends adminpresets_setting {
/**
* Ensure that the $value values are setting choices.
*
* @param mixed $value Setting value
* @return mixed Returns false if wrong param value
*/
protected function set_value($value) {
if ($value) {
$options = explode(',', $value);
foreach ($options as $option) {
foreach ($this->settingdata->choices as $key => $choice) {
if ($key == $option) {
$this->value = $option;
$this->set_visiblevalue();
return true;
}
}
}
$value = implode(',', $options);
}
$this->value = $value;
$this->set_visiblevalue();
return true;
}
protected function set_visiblevalue() {
$values = explode(',', $this->value);
$visiblevalues = [];
foreach ($values as $value) {
if (!empty($this->settingdata->choices[$value])) {
// Ensure that each value exists as a setting choice.
if (array_key_exists($value, $this->settingdata->choices)) {
$visiblevalues[] = $this->settingdata->choices[$value];
}
}
+8 -6
View File
@@ -44,7 +44,7 @@ class core_admin_renderer extends plugin_renderer_base {
$output .= $this->heading(get_string('copyrightnotice'));
$output .= $this->box($copyrightnotice, 'copyrightnotice');
$output .= html_writer::empty_tag('br');
$output .= $this->confirm(get_string('doyouagree'), $continue, "http://docs.moodle.org/dev/License");
$output .= $this->confirm(get_string('doyouagree'), $continue, "https://moodledev.io/general/license");
$output .= $this->footer();
return $output;
@@ -746,10 +746,10 @@ class core_admin_renderer extends plugin_renderer_base {
//////////////////////////////////////////////////////////////////////////////////////////////////
//// IT IS ILLEGAL AND A VIOLATION OF THE GPL TO HIDE, REMOVE OR MODIFY THIS COPYRIGHT NOTICE ///
$copyrighttext = '<a href="http://moodle.org/">Moodle</a> '.
'<a href="http://docs.moodle.org/dev/Releases" title="'.$CFG->version.'">'.$CFG->release.'</a><br />'.
'<a href="https://moodledev.io/general/releases" title="'.$CFG->version.'">'.$CFG->release.'</a><br />'.
'Copyright &copy; 1999 onwards, Martin Dougiamas<br />'.
'and <a href="http://moodle.org/dev">many other contributors</a>.<br />'.
'<a href="http://docs.moodle.org/dev/License">GNU Public License</a>';
'<a href="https://moodledev.io/general/license">GNU Public License</a>';
//////////////////////////////////////////////////////////////////////////////////////////////////
return $this->box($copyrighttext, 'copyright');
@@ -898,7 +898,8 @@ class core_admin_renderer extends plugin_renderer_base {
$url = "https://campaign.moodle.org/current/lms/{$lang}/install/";
$params = [
'url' => $url,
'iframeid' => 'campaign-content'
'iframeid' => 'campaign-content',
'title' => get_string('campaign', 'admin'),
];
return $this->render_from_template('core/external_content_banner', $params);
@@ -919,7 +920,8 @@ class core_admin_renderer extends plugin_renderer_base {
$url = "https://campaign.moodle.org/current/lms/{$lang}/servicesandsupport/";
$params = [
'url' => $url,
'iframeid' => 'services-support-content'
'iframeid' => 'services-support-content',
'title' => get_string('supportandservices', 'admin'),
];
return $this->render_from_template('core/external_content_banner', $params);
@@ -991,7 +993,7 @@ class core_admin_renderer extends plugin_renderer_base {
* @return string HTML to output.
*/
protected function release_notes_link() {
$releasenoteslink = get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/dev/Releases');
$releasenoteslink = get_string('releasenoteslink', 'admin', 'https://moodledev.io/general/releases');
$releasenoteslink = str_replace('target="_blank"', 'onclick="this.target=\'_blank\'"', $releasenoteslink); // extremely ugly validation hack
return $this->box($releasenoteslink, 'generalbox alert alert-info');
}
+2 -2
View File
@@ -32,7 +32,7 @@ require_once($CFG->libdir . '/adminlib.php');
admin_externalpage_setup('searchareas', '', null, (new moodle_url('/admin/searchreindex.php'))->out(false));
// Get area parameter and check it exists.
$areaid = required_param('areaid', PARAM_ALPHAEXT);
$areaid = required_param('areaid', PARAM_ALPHANUMEXT);
$area = \core_search\manager::get_search_area($areaid);
if ($area === false) {
throw new moodle_exception('invalidrequest');
@@ -44,7 +44,7 @@ $PAGE->set_secondary_active_tab('modules');
// Start page output.
$heading = get_string('gradualreindex', 'search', '');
$PAGE->set_title($PAGE->title . ': ' . $heading);
$PAGE->set_title($areaname . ' - ' . get_string('gradualreindex', 'search', ''));
$PAGE->navbar->add($heading);
echo $OUTPUT->header();
echo $OUTPUT->heading($heading);
+1 -3
View File
@@ -129,9 +129,7 @@ if (empty($SITE->fullname)) {
$PAGE->set_button($buttons);
}
$visiblepathtosection = array_reverse($settingspage->visiblepath);
$PAGE->set_title("$SITE->shortname: " . implode(": ",$visiblepathtosection));
$PAGE->set_title(implode(moodle_page::TITLE_SEPARATOR, $settingspage->visiblepath));
$PAGE->set_heading($SITE->fullname);
echo $OUTPUT->header();
+12
View File
@@ -244,6 +244,18 @@ reports,core_reportbuilder|/reportbuilder/index.php',
// "htmlsettings" settingpage
$temp = new admin_settingpage('htmlsettings', new lang_string('htmlsettings', 'admin'));
$sitenameintitleoptions = [
'shortname' => new lang_string('shortname'),
'fullname' => new lang_string('fullname'),
];
$sitenameintitleconfig = new admin_setting_configselect(
'sitenameintitle',
new lang_string('sitenameintitle', 'admin'),
new lang_string('sitenameintitle_help', 'admin'),
'shortname',
$sitenameintitleoptions
);
$temp->add($sitenameintitleconfig);
$temp->add(new admin_setting_configcheckbox('formatstringstriptags', new lang_string('stripalltitletags', 'admin'), new lang_string('configstripalltitletags', 'admin'), 1));
$temp->add(new admin_setting_emoticons());
$ADMIN->add('appearance', $temp);
+1 -1
View File
@@ -145,7 +145,7 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$temp->add(new admin_setting_heading('adminpresets', new lang_string('siteadminpresetspluginname', 'core_adminpresets'), ''));
$sensiblesettingsdefault = 'recaptchapublickey@@none, recaptchaprivatekey@@none, googlemapkey3@@none, ';
$sensiblesettingsdefault .= 'secretphrase@@url, cronremotepassword@@none, smtpuser@@none, ';
$sensiblesettingsdefault .= 'smtppass@none, proxypassword@@none, quizpassword@@quiz, allowedip@@none, blockedip@@none, ';
$sensiblesettingsdefault .= 'smtppass@@none, proxypassword@@none, quizpassword@@quiz, allowedip@@none, blockedip@@none, ';
$sensiblesettingsdefault .= 'dbpass@@logstore_database, messageinbound_hostpass@@none, ';
$sensiblesettingsdefault .= 'bind_pw@@auth_cas, pass@@auth_db, bind_pw@@auth_ldap, ';
$sensiblesettingsdefault .= 'dbpass@@enrol_database, bind_pw@@enrol_ldap, ';
@@ -42,8 +42,8 @@ class import_form extends moodleform {
$mform->setType('name', PARAM_TEXT);
// File upload.
$mform->addElement('filepicker', 'xmlfile',
get_string('selectfile', 'tool_admin_presets'));
$mform->addElement('filepicker', 'xmlfile', get_string('selectfile', 'tool_admin_presets'), null,
['accepted_types' => ['.xml']]);
$mform->addRule('xmlfile', null, 'required');
$this->add_action_buttons(true, get_string('import', 'tool_admin_presets'));
@@ -34,8 +34,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).
@@ -51,8 +54,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 -10
View File
@@ -49,7 +49,7 @@ list($options, $unrecognized) = cli_get_params(
'torun' => 0,
'optimize-runs' => '',
'add-core-features-to-theme' => false,
'axe' => false,
'axe' => null,
'disable-composer' => false,
'composer-upgrade' => true,
'composer-self-update' => true,
@@ -69,7 +69,7 @@ Behat utilities to initialise behat tests
Usage:
php init.php [--parallel=value [--maxruns=value] [--fromrun=value --torun=value]]
[--axe] [-o | --optimize-runs] [-a | --add-core-features-to-theme]
[--no-axe] [-o | --optimize-runs] [-a | --add-core-features-to-theme]
[--no-composer-self-update] [--no-composer-upgrade]
[--disable-composer]
[--help]
@@ -79,7 +79,7 @@ Options:
-m, --maxruns Max parallel processes to be executed at one time
--fromrun Execute run starting from (Used for parallel runs on different vms)
--torun Execute run till (Used for parallel runs on different vms)
--axe Include axe accessibility tests
--no-axe Disable axe accessibility tests.
-o, --optimize-runs
Split features with specified tags in all parallel runs.
@@ -102,7 +102,7 @@ Options:
Example from Moodle root directory:
\$ php admin/tool/behat/cli/init.php --parallel=2
More info in http://docs.moodle.org/dev/Acceptance_testing#Running_tests
More info in https://moodledev.io/general/development/tools/behat/running
";
if (!empty($options['help'])) {
@@ -110,6 +110,12 @@ if (!empty($options['help'])) {
exit(0);
}
if ($options['axe']) {
echo "Axe accessibility tests are enabled by default, to disable them, use the --no-axe option.\n";
} else if ($options['axe'] === false) {
echo "Axe accessibility tests have been disabled.\n";
}
// Check which util file to call.
$utilfile = 'util_single_run.php';
$commandoptions = "";
@@ -118,9 +124,7 @@ if ($options['parallel'] && $options['parallel'] > 1) {
$utilfile = 'util.php';
// Sanitize all input options, so they can be passed to util.
foreach ($options as $option => $value) {
if ($value) {
$commandoptions .= " --$option=\"$value\"";
}
$commandoptions .= behat_get_command_flags($option, $value);
}
} else {
// Only sanitize options for single run.
@@ -130,9 +134,7 @@ if ($options['parallel'] && $options['parallel'] > 1) {
];
foreach ($cmdoptionsforsinglerun as $option) {
if (!empty($options[$option])) {
$commandoptions .= " --$option='$options[$option]'";
}
$commandoptions .= behat_get_command_flags($option, $options[$option]);
}
}
+1 -1
View File
@@ -87,7 +87,7 @@ Options:
Example from Moodle root directory:
\$ php admin/tool/behat/cli/run.php --tags=\"@javascript\"
More info in http://docs.moodle.org/dev/Acceptance_testing#Running_tests
More info in https://moodledev.io/general/development/tools/behat/running
";
if (!empty($options['help'])) {
+5 -10
View File
@@ -57,7 +57,7 @@ list($options, $unrecognized) = cli_get_params(
'torun' => 0,
'optimize-runs' => '',
'add-core-features-to-theme' => false,
'axe' => false,
'axe' => true,
),
array(
'h' => 'help',
@@ -73,7 +73,7 @@ $help = "
Behat utilities to manage the test environment
Usage:
php util.php [--install|--drop|--enable|--disable|--diag|--updatesteps|--axe|--help] [--parallel=value [--maxruns=value]]
php util.php [--install|--drop|--enable|--disable|--diag|--updatesteps|--no-axe|--help] [--parallel=value [--maxruns=value]]
Options:
--install Installs the test environment for acceptance tests
@@ -82,7 +82,7 @@ Options:
--disable Disables test environment
--diag Get behat test environment status code
--updatesteps Update feature step file.
--axe Include axe accessibility tests
--no-axe Disable axe accessibility tests.
-j, --parallel Number of parallel behat run operation
-m, --maxruns Max parallel processes to be executed at one time.
@@ -94,7 +94,7 @@ Options:
Example from Moodle root directory:
\$ php admin/tool/behat/cli/util.php --enable --parallel=4
More info in http://docs.moodle.org/dev/Acceptance_testing#Running_tests
More info in https://moodledev.io/general/development/tools/behat/running
";
if (!empty($options['help'])) {
@@ -320,12 +320,7 @@ function commands_to_execute($options) {
}
foreach ($extraoptions as $option => $value) {
if ($options[$option]) {
$extra .= " --$option";
if ($value) {
$extra .= "=\"$value\"";
}
}
$extra .= behat_get_command_flags($option, $value);
}
if (empty($options['parallel'])) {
+4 -4
View File
@@ -52,7 +52,7 @@ list($options, $unrecognized) = cli_get_params(
'updatesteps' => false,
'optimize-runs' => '',
'add-core-features-to-theme' => false,
'axe' => false,
'axe' => true,
),
array(
'h' => 'help',
@@ -79,7 +79,7 @@ Options:
--disable Disables test environment
--diag Get behat test environment status code
--updatesteps Update feature step file.
--axe Include axe accessibility tests
--no-axe Disable axe accessibility tests.
-o, --optimize-runs Split features with specified tags in all parallel runs.
-a, --add-core-features-to-theme Add all core features to specified theme's
@@ -89,7 +89,7 @@ Options:
Example from Moodle root directory:
\$ php admin/tool/behat/cli/util_single_run.php --enable
More info in http://docs.moodle.org/dev/Acceptance_testing#Running_tests
More info in https://moodledev.io/general/development/tools/behat/running
";
if (!empty($options['help'])) {
@@ -186,7 +186,7 @@ if ($options['install']) {
behat_config_manager::set_behat_run_config_value('behatsiteenabled', 1);
}
// Define whether to run Behat with axe tests.
// Configure axe according to option.
behat_config_manager::set_behat_run_config_value('axe', $options['axe']);
// Enable test mode.
+1 -1
View File
@@ -30,7 +30,7 @@ $string['errordataroot'] = '$CFG->behat_dataroot is not set or is invalid.';
$string['errorsetconfig'] = '$CFG->behat_dataroot, $CFG->behat_prefix and $CFG->behat_wwwroot need to be set in config.php.';
$string['erroruniqueconfig'] = '$CFG->behat_dataroot, $CFG->behat_prefix and $CFG->behat_wwwroot values need to be different than $CFG->dataroot, $CFG->prefix, $CFG->wwwroot, $CFG->phpunit_dataroot and $CFG->phpunit_prefix values.<br/>Or, if $CFG->behat_prefix is the same, $CFG->behat_dbname or $CFG->behat_dbhost need to be different from $CFG->phpunit_dbname and $CFG->phpunit_dbhost and from $CFG->dbname and $CFG->dbhost.';
$string['fieldvalueargument'] = 'Field value arguments';
$string['fieldvalueargument_help'] = 'This argument should be completed by a field value. There are many field types, including simple ones like checkboxes, selects or textareas, or complex ones like date selectors. See the dev documentation <a href="https://docs.moodle.org/dev/Acceptance_testing" target="_blank">Acceptance_testing</a> for details of expected field values.';
$string['fieldvalueargument_help'] = 'This argument should be completed by a field value. There are many field types, including simple ones like checkboxes, selects or textareas, or complex ones like date selectors. See the dev documentation <a href="https://moodledev.io/general/development/tools/behat" target="_blank">Acceptance_testing</a> for details of expected field values.';
$string['giveninfo'] = 'Given. Processes to set up the environment';
$string['infoheading'] = 'Info';
$string['installinfo'] = 'Read {$a} for installation and tests execution info';
+3 -2
View File
@@ -184,9 +184,10 @@ class tool_behat_renderer extends plugin_renderer_base {
// Info.
$installurl = behat_command::DOCS_URL;
$installlink = html_writer::tag('a', $installurl, array('href' => $installurl, 'target' => '_blank'));
$writetestsurl = 'https://docs.moodle.org/dev/Writing acceptance tests';
$writetestsurl = 'https://moodledev.io/general/development/tools/behat/writing';
$writetestslink = html_writer::tag('a', $writetestsurl, array('href' => $writetestsurl, 'target' => '_blank'));
$writestepsurl = 'https://docs.moodle.org/dev/Writing_new_acceptance_test_step_definitions';
$writestepsurl = 'https://moodledev.io/general/development/tools/behat/writing#' .
'writing-new-acceptance-test-step-definitions';
$writestepslink = html_writer::tag('a', $writestepsurl, array('href' => $writestepsurl, 'target' => '_blank'));
$infos = array(
get_string('installinfo', 'tool_behat', $installlink),
@@ -100,8 +100,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
@@ -135,17 +134,11 @@ Feature: Set up contextual data for tests
When I log in as "user1"
And I am on site homepage
Then edit mode should be available on the current page
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
Then edit mode should be available on the current page
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
Then edit mode should be available on the current page
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
Then edit mode should be available on the current page
And I log out
And I log in as "user5"
@@ -187,8 +180,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"
@@ -304,9 +296,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"
@@ -327,9 +317,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 open the action menu in "Test Grade Item 1" "table_row"
And I choose "Edit" in the open action menu
@@ -358,9 +346,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"
@@ -379,9 +365,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 navigate to "More > Outcomes" in the course gradebook
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 press "Manage outcomes"
@@ -407,9 +391,7 @@ Feature: Set up contextual data for tests
| Test Outcome Grade Item 1 | C1 | OT1 | Grade category 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 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 Outcome Grade Item 1"
And I open the action menu in "Test Outcome Grade Item 1" "table_row"
And I choose "Edit" in the open action menu
@@ -425,6 +407,5 @@ Feature: Set up contextual data for tests
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| online_users | Course | C1 | course-view-* | site-pre |
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 "Online users"
@@ -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,16 +51,12 @@ Feature: Edit capabilities
And "mod/forum:addquestion" capability has "Allow" permission
Scenario: Module capabilities overrides
Given I log in as "teacher1"
And the following "activity" exists:
Given the following "activity" exists:
| activity | forum |
| course | C1 |
| idnumber | 00001 |
| name | I'm the name |
| intro | I'm the introduction |
| section | 1 |
And I am on "Course 1" course homepage with editing mode on
And I follow "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 |
+2
View File
@@ -1,5 +1,7 @@
This files describes API changes in the tool_behat code.
=== 4.1.4 ===
* Behat is initialised with Axe accessibility tests enabled by default, if you want to disable them please use the --no-axe option.
=== 3.7 ===
* Behat will now look for behat step definitions in the current
theme and any parents the theme may have.
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2022112801; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2022112802; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2022111800; // Requires this Moodle version.
$plugin->component = 'tool_behat'; // Full name of the plugin (used for diagnostics)
@@ -376,19 +376,61 @@ class brickfield_accessibility_test {
return false;
}
/**
* Returns an array of the newwindowphrases for all enabled language packs.
* @return array of the newwindowphrases for all enabled language packs.
*/
public static function get_all_newwindowphrases(): array {
// Need to process all enabled lang versions of newwindowphrases.
return static::get_all_phrases('newwindowphrases');
}
/**
* Returns an array of the invalidlinkphrases for all enabled language packs.
* @return array of the invalidlinkphrases for all enabled language packs.
*/
public static function get_all_invalidlinkphrases(): array {
// Need to process all enabled lang versions of invalidlinkphrases.
return static::get_all_phrases('invalidlinkphrases');
}
/**
* Returns an array of the relevant phrases for all enabled language packs.
* @param string $stringname the language string identifier you want get the phrases for.
* @return array of the invalidlinkphrases for all enabled language packs.
*/
protected static function get_all_phrases(string $stringname): array {
$stringmgr = get_string_manager();
$allstrings = [];
$enabledlangs = get_string_manager()->get_list_of_translations();
// Somehow, an invalid string was requested. Add exception handling for this in the future.
if (!$stringmgr->string_exists($stringname, manager::PLUGINNAME)) {
return $allstrings;
}
// Need to process all enabled lang versions of invalidlinkphrases.
$enabledlangs = $stringmgr->get_list_of_translations();
foreach ($enabledlangs as $lang => $value) {
$tmpstring = (string)new \lang_string('invalidlinkphrases', manager::PLUGINNAME, null, $lang);
$tmpstring = (string)new \lang_string($stringname, manager::PLUGINNAME, null, $lang);
$tmplangarray = explode('|', $tmpstring);
$allstrings = array_merge($allstrings, $tmplangarray);
}
// Removing duplicates if a lang is enabled, yet using default 'en' due to no relevant lang file.
$allstrings = array_unique($allstrings);
return $allstrings;
}
/**
* Assesses whether a string contains any readable text, which is text that
* contains any characters other than whitespace characters.
*
* @param string $text
* @return bool
*/
public static function is_text_readable(string $text): bool {
// These characters in order are a space, tab, line feed, carriage return,
// NUL-byte, vertical tab and non-breaking space unicode character \xc2\xa0.
$emptycharacters = " \t\n\r\0\x0B\xc2\xa0";
return trim($text, $emptycharacters) != '';
}
}
@@ -39,9 +39,27 @@ class a_links_dont_open_new_window extends brickfield_accessibility_test {
* The main check function. This is called by the parent class to actually check content.
*/
public function check(): void {
// Need to process all enabled lang versions of newwindowphrases.
$text = brickfield_accessibility_test::get_all_newwindowphrases();
foreach ($this->get_all_elements('a') as $a) {
if ($a->hasAttribute('target') && !in_array($a->getAttribute('target'), $this->allowedtargets)) {
$this->add_report($a);
$phrasefound = false;
foreach ($text as $phrase) {
// Sanity check for readable text.
if (!brickfield_accessibility_test::is_text_readable($phrase)) {
break;
}
$pos = stripos($a->nodeValue, $phrase);
if ($pos !== false) {
$phrasefound = true;
break;
}
}
if (!$phrasefound) {
$this->add_report($a);
}
}
}
}
@@ -39,9 +39,26 @@ class area_dont_open_new_window extends brickfield_accessibility_test {
* The main check function. This is called by the parent class to actually check content
*/
public function check(): void {
// Need to process all enabled lang versions of newwindowphrases.
$text = brickfield_accessibility_test::get_all_newwindowphrases();
foreach ($this->get_all_elements('area') as $area) {
if ($area->hasAttribute('target') && !in_array($area->getAttribute('target'), $this->allowedtargets)) {
$this->add_report($area);
$phrasefound = false;
foreach ($text as $phrase) {
// Sanity check for readable text.
if (!brickfield_accessibility_test::is_text_readable($phrase)) {
break;
}
$pos = stripos($area->getAttribute('alt'), $phrase);
if ($pos !== false) {
$phrasefound = true;
break;
}
}
if (!$phrasefound) {
$this->add_report($area);
}
}
}
}
@@ -16,6 +16,8 @@
namespace tool_brickfield\local\tool;
use tool_brickfield\manager;
/**
* Class advanced.
*
@@ -51,12 +53,36 @@ class advanced extends tool {
return 'advanced';
}
/**
* Builds context data used to render a single grid item on the advanced page.
* @param string $icon
* @param string $heading
* @param string $content
* @return array
*/
protected function get_grid_item_context(string $icon, string $heading, string $content): array {
return [
"icon" => "pix/i/$icon.png",
"iconalt" => get_string("icon:$icon", manager::PLUGINNAME),
"heading" => get_string($heading, manager::PLUGINNAME),
"content" => get_string($content, manager::PLUGINNAME)
];
}
/**
* Return the data for renderer / template display.
* @return \stdClass
*/
protected function fetch_data(): \stdClass {
$data = (object)[
'griditems' => [
$this->get_grid_item_context("analytics-custom", "headingone", "contentone"),
$this->get_grid_item_context("tools-custom", "headingtwo", "contenttwo"),
$this->get_grid_item_context("file-edit-custom", "headingthree", "contentthree"),
$this->get_grid_item_context("search-plus-custom", "headingfour", "contentfour"),
$this->get_grid_item_context("wand-magic-custom", "headingfive", "contentfive"),
$this->get_grid_item_context("hands-helping-custom", "headingsix", "contentsix"),
],
'valid' => true,
'error' => '',
];
@@ -93,6 +93,7 @@ $string['invalidcourseid'] = 'Invalid course, please check your input';
$string['invalidlinkphrases'] = 'click|click here|here|more|more here|info|info here|information|information here|read more|read more here|further information|further information here|further details|further details here';
$string['module'] = 'Module';
$string['modulename'] = 'Name';
$string['newwindowphrases'] = 'new window|new-window|new_window';
$string['noerrorsfound'] = 'No common accessibility errors were found for your search parameters. Congratulations!';
$string['norecords'] = 'No relevant records were found for your search parameters.';
$string['notregistered'] = 'Your accessibility toolkit needs to be registered.';
@@ -270,3 +271,9 @@ $string['headingthree'] = 'Accessible file formats';
$string['headingfour'] = 'Focus effort';
$string['headingfive'] = 'HTML fixes';
$string['headingsix'] = 'Performance support';
$string['icon:analytics-custom'] = 'Analytics icon';
$string['icon:tools-custom'] = 'Tools icon';
$string['icon:file-edit-custom'] = 'Edit file icon';
$string['icon:search-plus-custom'] = 'Search icon';
$string['icon:wand-magic-custom'] = 'Magic wand icon';
$string['icon:hands-helping-custom'] = 'Helping hands icon';
+48 -71
View File
@@ -10,49 +10,22 @@
/* Advanced Page CSS */
@media only screen and (min-width: 768px) {
.tool_brickfield_grid_item {
width: 33.333333333333336%;
}
#tool_brickifeld_advanced_page {
margin: 20px 20px 20px 10px;
}
@media only screen and (max-width: 767px) {
.tool_brickfield_grid_item {
width: 100%;
}
}
.tool_brickfield_grid {
max-width: 1140px;
margin-right: auto;
margin-left: auto;
}
.tool_brickfield_grid_inner {
width: 100%;
.tool_brickfield_banner_heading {
display: flex;
flex-wrap: wrap;
}
.tool_brickfield_grid_item_shape {
height: 96%;
background-color: #fff;
padding: 10% 10% 10% 10%;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.05);
margin: 1% 1% 1% 1%;
border-radius: 15px 15px 15px 70px;
}
.tool_brickfield_grid_display {
display: grid;
grid-template-columns: 0.6fr 1.4fr 1fr;
grid-template-rows: 1fr 1fr;
}
.tool_brickfield_grid_spacing {
justify-content: space-between;
margin-bottom: 20px;
margin-left: auto;
margin-right: 1em;
}
.tool_brickfield_banner_heading > img {
height: 50px;
}
.tool_brickfield_banner > p {
text-align: center;
}
.tool_brickfield_grid_heading {
@@ -60,59 +33,63 @@
font-size: 20px;
font-weight: 400;
color: #040d29;
padding-bottom: 4px;
}
.tool_brickfield_grid_content {
color: #040d29;
font-size: 16px;
line-height: 1.4em;
margin: 0;
padding: 0;
}
.tool_brickfield_logo_height {
height: 3em;
}
.tool_brickfield_logo_position {
padding-bottom: 2em;
}
.tool_brickfield_icon_position {
line-height: 1;
font-size: 50px;
}
.tool_brickfield_icon_height {
.tool_brickfield_grid_heading > img {
height: 30px;
padding-right: 16px;
}
.tool_brickfield_center_button {
text-align: center;
.tool_brickfield_grid {
display: flex;
flex-wrap: wrap;
justify-content: center;
margin: 20px 20px 30px;
}
.tool_brickfield_advanced_button {
.tool_brickfield_grid > div {
margin: 10px;
padding: 20px;
flex-basis: 30%;
border: 1px solid grey;
max-width: 500px;
min-width: 250px;
flex-grow: 4;
border-radius: 15px 15px 15px 50px;
}
.tool_brickfield_grid_heading {
display: flex;
}
.tool_brickfield_footer > a {
font-size: 18px;
letter-spacing: 1px;
color: #fff;
background-color: #4054b2;
border-style: solid;
border-color: #fff;
border-radius: 5px 5px 5px 5px;
padding: 15px 50px 15px 50px;
border-radius: 5px;
padding: 15px 50px;
transition: 0.3s;
margin-bottom: 20px;
}
.tool_brickfield_advanced_button:hover {
.tool_brickfield_footer {
text-align: center;
}
.tool_brickfield_footer > a:hover {
color: #fff;
background-color: #253687;
text-decoration: none;
}
.tool_brickfield_banner_heading {
margin-bottom: 1.5em;
}
.tool_brickfield_banner {
height: 10em;
padding: 2.5em;
margin-bottom: 2em;
.tool_brickfield_footer > p {
margin-bottom: 25px;
}
+31 -173
View File
@@ -21,184 +21,42 @@
Example context (json):
{
"pagetitle": "Advanced"
"griditems": [
{
"icon": "some-icon-name",
"iconalt": "some-icon-alt",
"heading": "some-heading",
"content": "some-content"
}
]
}
}}
<link rel="stylesheet" href="styles.css">
<h3>{{{pagetitle}}}</h3>
<section class="tool_brickfield_banner">
<div class="tool_brickfield_banner_heading">
<img src="pix/i/Brickfield-logo-black.png" alt="Brickfield Logo" class="pull-right tool_brickfield_logo_height">
<h2>{{# str }}bannerheadingone, tool_brickfield{{/ str }}</h2>
<div id="tool_brickifeld_advanced_page">
<div class="tool_brickfield_banner">
<div class="tool_brickfield_banner_heading">
<h2>{{#str}} bannerheadingone, tool_brickfield{{/str}}</h2>
<img src="pix/i/Brickfield-logo-black.png" alt="Brickfield Logo">
</div>
<p>{{#str}} bannercontentone, tool_brickfield, https://www.brickfield.ie/moodle_talk_to_sales/{{/str}}</p>
</div>
<p>
{{# str }}bannercontentone, tool_brickfield, https://www.brickfield.ie/moodle_talk_to_sales/{{/ str }}
</p>
</section>
<div class="tool_brickfield_grid">
<div class="tool_brickfield_grid_inner">
<div class="tool_brickfield_grid">
{{#griditems}}
<div class="tool_brickfield_grid_item">
<div class="tool_brickfield_grid_item_shape">
<div class="tool_brickfield_grid_display" style="grid-template-areas: 'al ar ar' 'al ar ar'; grid-area: a;">
<div style="grid-area: al;">
<div class="tool_brickfield_grid_spacing">
<span class="tool_brickfield_icon_position">
<img src="pix/i/analytics-custom.png" alt="Analytics icon" class="tool_brickfield_icon_height">
</span>
</div>
</div>
<div style="grid-area: ar;">
<h3>
<span class="tool_brickfield_grid_heading">
{{# str }}headingone, tool_brickfield{{/ str }}
</span>
</h3>
<p class="tool_brickfield_grid_content">
{{# str }}contentone, tool_brickfield{{/ str }}
</p>
</div>
</div>
<div class="tool_brickfield_grid_heading">
<img src="{{icon}}" alt="{{iconalt}}">
<h3>{{heading}}</h3>
</div>
<div class="tool_brickfield_grid_content">
<p>{{content}}</p>
</div>
</div>
<div class="tool_brickfield_grid_item">
<div class="tool_brickfield_grid_item_shape">
<div class="tool_brickfield_grid_display" style="grid-template-areas: 'bl br br' 'bl br br'; grid-area: b;">
<div style="grid-area: bl;">
<div class="tool_brickfield_grid_spacing">
<span class="tool_brickfield_icon_position">
<img src="pix/i/tools-custom.png" alt="Tools icon" class="tool_brickfield_icon_height">
</span>
</div>
</div>
<div style="grid-area: br;">
<h3>
<span class="tool_brickfield_grid_heading">
{{# str }}headingtwo, tool_brickfield{{/ str }}
</span>
</h3>
<p class="tool_brickfield_grid_content">
{{# str }}contenttwo, tool_brickfield{{/ str }}
</p>
</div>
</div>
</div>
</div>
<div class="tool_brickfield_grid_item">
<div class="tool_brickfield_grid_item_shape">
<div class="tool_brickfield_grid_display" style="grid-template-areas: 'cl cr cr' 'cl cr cr'; grid-area: c;">
<div style="grid-area: cl;">
<div class="tool_brickfield_grid_spacing">
<span class="tool_brickfield_icon_position">
<img src="pix/i/file-edit-custom.png" alt="Edit file icon" class="tool_brickfield_icon_height">
</span>
</div>
</div>
<div style="grid-area: cr;">
<h3>
<span class="tool_brickfield_grid_heading">
{{# str }}headingthree, tool_brickfield{{/ str }}
</span>
</h3>
<p class="tool_brickfield_grid_content">
{{# str }}contentthree, tool_brickfield{{/ str }}
</p>
</div>
</div>
</div>
</div>
<div class="tool_brickfield_grid_item">
<div class="tool_brickfield_grid_item_shape">
<div class="tool_brickfield_grid_display" style="grid-template-areas: 'dl dr dr' 'dl dr dr'; grid-area: d;">
<div style="grid-area: dl;">
<div class="tool_brickfield_grid_spacing">
<span class="tool_brickfield_icon_position">
<img src="pix/i/search-plus-custom.png" alt="Search icon" class="tool_brickfield_icon_height">
</span>
</div>
</div>
<div style="grid-area: dr;">
<h3>
<span class="tool_brickfield_grid_heading">
{{# str }}headingfour, tool_brickfield{{/ str }}
</span>
</h3>
<p class="tool_brickfield_grid_content">
{{# str }}contentfour, tool_brickfield{{/ str }}
</p>
</div>
</div>
</div>
</div>
<div class="tool_brickfield_grid_item">
<div class="tool_brickfield_grid_item_shape">
<div class="tool_brickfield_grid_display" style="grid-template-areas: 'el er er' 'el er er'; grid-area: e;">
<div style="grid-area: el;">
<div class="tool_brickfield_grid_spacing">
<span class="tool_brickfield_icon_position">
<img src="pix/i/wand-magic-custom.png" alt="Magic wand icon" class="tool_brickfield_icon_height">
</span>
</div>
</div>
<div style="grid-area: er;">
<h3>
<span class="tool_brickfield_grid_heading">
{{# str }}headingfive, tool_brickfield{{/ str }}
</span>
</h3>
<p class="tool_brickfield_grid_content">
{{# str }}contentfive, tool_brickfield{{/ str }}
</p>
</div>
</div>
</div>
</div>
<div class="tool_brickfield_grid_item">
<div class="tool_brickfield_grid_item_shape">
<div class="tool_brickfield_grid_display" style="grid-template-areas: 'fl fr fr' 'fl fr fr'; grid-area: f;">
<div style="grid-area: fl;">
<div class="tool_brickfield_grid_spacing">
<span class="tool_brickfield_icon_position">
<img src="pix/i/hands-helping-custom.png" alt="Helping hands icon" class="tool_brickfield_icon_height">
</span>
</div>
</div>
<div style="grid-area: fr;">
<h3>
<span class="tool_brickfield_grid_heading">
{{# str }}headingsix, tool_brickfield{{/ str }}
</span>
</h3>
<p class="tool_brickfield_grid_content">
{{# str }}contentsix, tool_brickfield{{/ str }}
</p>
</div>
</div>
</div>
</div>
{{/griditems}}
</div>
<div class="tool_brickfield_footer">
<h2 class="accesshide">{{#str}} footerheading, tool_brickfield {{/str}}</h2>
<p>{{#str}}bannercontenttwo, tool_brickfield{{/str}}</p>
<a href="https://www.brickfield.ie/moodle_free_demo/">
{{#str}}buttonone, tool_brickfield{{/str}}
</a>
</div>
</div>
<section class="tool_brickfield_banner">
<h2 class="accesshide">{{# str }}footerheading, tool_brickfield{{/ str }}</h2>
<p>
{{# str }}bannercontenttwo, tool_brickfield{{/ str }}
</p>
<div class="tool_brickfield_center_button">
<form action="https://www.brickfield.ie/moodle_free_demo/">
<button class="tool_brickfield_advanced_button">
{{# str }}buttonone, tool_brickfield{{/ str }}
</button>
</form>
</div>
</section>
@@ -87,6 +87,19 @@ EOD;
</html>
EOD;
/** @var string Html pass 4 */
private $htmlpass4 = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>A link can indicate that it will open in a new window</title>
</head>
<body>
<a href="www.youtube.com" target="_blank">This is youtube (opens in a new window)</a>
</body>
</html>
EOD;
/**
* Test for links opening a new tab or window
*/
@@ -102,5 +115,8 @@ EOD;
$results = $this->get_checker_results($this->htmlpass3);
$this->assertEmpty($results);
$results = $this->get_checker_results($this->htmlpass4);
$this->assertEmpty($results);
}
}
@@ -87,6 +87,19 @@ EOD;
</html>
EOD;
/** @var string Html pass 4 */
private $htmlpass4 = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>A link can indicate that it will open in a new window</title>
</head>
<body>
<area target="_blank" alt="(opens in a new window)"></area>
</body>
</html>
EOD;
/**
* Test Area tags opening new window without warning
*/
@@ -102,5 +115,8 @@ EOD;
$results = $this->get_checker_results($this->htmlpass3);
$this->assertEmpty($results);
$results = $this->get_checker_results($this->htmlpass4);
$this->assertEmpty($results);
}
}
+1
View File
@@ -179,6 +179,7 @@ class api {
AND ra.roleid = :roleid
AND ra.userid = :userid
WHERE cm.cohortid ' . $cohortsql . '
AND u.deleted = 0
AND ra.id IS NULL';
$toadd = $DB->get_records_sql($sql, $params);
@@ -0,0 +1,43 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
declare(strict_types=1);
namespace tool_cohortroles;
use core\event\user_deleted;
/**
* Plugin event observer callbacks
*
* @package tool_cohortroles
* @copyright 2023 Paul Holden <paulh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class observers {
/**
* User deleted event, remove cohort role assignments specific to them
*
* @param user_deleted $event
*/
public static function user_deleted(user_deleted $event): void {
$cohortroleassignments = cohort_role_assignment::get_records(['userid' => $event->objectid]);
foreach ($cohortroleassignments as $cohortroleassignment) {
$cohortroleassignment->delete();
}
}
}
@@ -15,25 +15,18 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Legacy Cron Quiz Reports Task
* Plugin event observers
*
* @package quiz_statistics
* @copyright 2017 Michael Hughes, University of Strathclyde
* @author Michael Hughes <michaelhughes@strath.ac.uk>
* @package tool_cohortroles
* @copyright 2023 Paul Holden <paulh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*
*/
defined('MOODLE_INTERNAL') || die();
$tasks = [
$observers = [
[
'classname' => 'quiz_statistics\task\recalculate',
'blocking' => 0,
'minute' => 'R',
'hour' => '*/4',
'day' => '*',
'dayofweek' => '*',
'month' => '*'
]
'eventname' => '\core\event\user_deleted',
'callback' => '\tool_cohortroles\observers::user_deleted',
],
];
+8
View File
@@ -50,5 +50,13 @@ function xmldb_tool_cohortroles_upgrade($oldversion) {
// Automatically generated Moodle v4.1.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2022112801) {
// Delete any tool_cohortroles mappings for users who no longer exist.
$DB->delete_records_select('tool_cohortroles', 'userid NOT IN (SELECT id FROM {user} WHERE deleted = 0)');
// Cohortroles savepoint reached.
upgrade_plugin_savepoint(true, 2022112801, 'tool', 'cohortroles');
}
return true;
}
+1 -2
View File
@@ -24,8 +24,7 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2022112800; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2022112801; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2022111800; // Requires this Moodle version.
$plugin->component = 'tool_cohortroles'; // Full name of the plugin (used for diagnostics).
@@ -9,7 +9,7 @@ menu: "main"
## Moodle templates
[Moodle templates](https://docs.moodle.org/dev/Templates) are use to write HTML and Javascript using mustache files.
[Moodle templates](https://moodledev.io/docs/guides/templates) are use to write HTML and Javascript using mustache files.
If you are creating your own pages in the UI Component library you can load core templates using this (shortcode) syntax:
@@ -51,4 +51,3 @@ This is the result of adding the core/notification template on this page:
"extraclasses": "foo bar"
}
{{< /mustache >}}
@@ -11,7 +11,7 @@ tags:
## How to use moodle forms
Forms are constructed using lib/formslib.php. Using the addElement methods in php a set of different form element types can be added to a form. For more info visit the [Moodledocs](https://docs.moodle.org/dev/lib/formslib.php_Form_Definition) page for forms
Forms are constructed using lib/formslib.php. Using the addElement methods in php a set of different form element types can be added to a form. For more info visit the [Moodledocs](https://moodledev.io/docs/apis/subsystems/form) page for forms
{{< php >}}
$mform->addElement('button', 'intro', get_string("buttonlabel"));
@@ -61,7 +61,7 @@ Disabled toggle with extra classes.
## Use toggle as a template block
It is also possible to include *core/toggle* in any other template using [blocks](https://docs.moodle.org/dev/Templates#Blocks), instead of rendering it with a context.
It is also possible to include *core/toggle* in any other template using [blocks](https://moodledev.io/docs/guides/templates#blocks), instead of rendering it with a context.
The parameters that you can define are:
* id: Unique id for the toggle input.
* extraclasses: Any extra classes added to the toggle input outer container.
@@ -285,7 +285,7 @@ class data_requests_table extends table_sql {
$actionsmenu = new action_menu($actions);
$actionsmenu->set_menu_trigger(get_string('actions'));
$actionsmenu->set_owner_selector('request-actions-' . $requestid);
$actionsmenu->set_constraint('[data-region=data-requests-table] > .no-overflow');
$actionsmenu->set_boundary('window');
return $OUTPUT->render($actionsmenu);
}
@@ -71,7 +71,7 @@
{{/filter}}
</div>
<div class="mt-1 mb-1" data-region="data-requests-table">
<div class="position-relative mt-1 mb-1" data-region="data-requests-table">
{{{datarequests}}}
</div>
</div>
@@ -58,7 +58,7 @@ class behat_tool_dataprivacy extends behat_base {
);
/**
* Creates the specified element. More info about available elements in http://docs.moodle.org/dev/Acceptance_testing#Fixtures.
* Creates the specified element. More info about available elements in https://moodledev.io/general/development/tools/behat.
*
* @Given /^the following data privacy "(?P<element_string>(?:[^"]|\\")*)" exist:$/
*
@@ -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
@@ -46,7 +46,7 @@ $PAGE->set_url(new \moodle_url('/admin/tool/filetypes/delete.php', array('extens
$PAGE->navbar->add($title);
$PAGE->set_context($context);
$PAGE->set_pagelayout('admin');
$PAGE->set_title($SITE->fullname. ': ' . $title);
$PAGE->set_title($title);
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->set_secondary_active_tab('server');
+1 -1
View File
@@ -107,7 +107,7 @@ $PAGE->set_secondary_active_tab('server');
$PAGE->navbar->add($oldextension ? s($oldextension) : $title);
$PAGE->set_context($context);
$PAGE->set_pagelayout('admin');
$PAGE->set_title($SITE->fullname. ': ' . $title);
$PAGE->set_title($title);
// Display the page.
echo $OUTPUT->header();
+1 -1
View File
@@ -34,7 +34,7 @@ $context = context_system::instance();
$PAGE->set_url(new \moodle_url('/admin/tool/filetypes/index.php'));
$PAGE->set_context($context);
$PAGE->set_pagelayout('admin');
$PAGE->set_title($SITE->fullname. ': ' . $title);
$PAGE->set_title($title);
$renderer = $PAGE->get_renderer('tool_filetypes');
+1 -1
View File
@@ -46,7 +46,7 @@ $PAGE->set_url(new \moodle_url('/admin/tool/filetypes/revert.php', array('extens
$PAGE->navbar->add($title);
$PAGE->set_context($context);
$PAGE->set_pagelayout('admin');
$PAGE->set_title($SITE->fullname. ': ' . $title);
$PAGE->set_title($title);
// Display the page.
echo $OUTPUT->header();
@@ -24,6 +24,8 @@
namespace tool_langimport;
use moodle_url;
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir.'/filelib.php');
require_once($CFG->libdir.'/componentlib.class.php');
@@ -59,6 +61,25 @@ class controller {
$this->availablelangs = $this->installer->get_remote_list_of_languages();
}
/**
* Redirect to the specified url, outputting any required messages.
*
* @param moodle_url $url
*/
public function redirect(moodle_url $url): void {
if ($this->info) {
$info = implode('<br />', $this->info);
\core\notification::success($info);
}
if ($this->errors) {
$info = implode('<br />', $this->errors);
\core\notification::error($info);
}
redirect($url);
}
/**
* Install language packs provided
*
@@ -112,6 +133,18 @@ class controller {
public function uninstall_language($lang) {
global $CFG;
$lang = clean_param($lang, PARAM_LANG);
if ($lang === '') {
// Do not allow uninstallation of invalid languages.
// Note: PARAM_LANG returns an empty string for invalid validation.
return false;
}
if ($lang === 'en') {
// Never allow removal of the default langauge.
return false;
}
$dest1 = $CFG->dataroot.'/lang/'.$lang;
$dest2 = $CFG->dirroot.'/lang/'.$lang;
$rm1 = false;
+10 -2
View File
@@ -43,6 +43,13 @@ $uninstalllang = optional_param_array('uninstalllang', array(), PARAM_LANG)
$confirmtounistall = optional_param('confirmtouninstall', '', PARAM_SAFEPATH); // uninstallation confirmation
$purgecaches = optional_param('purgecaches', false, PARAM_BOOL); // explicit caches reset
// Filter the uninstall language list.
// If the list contains a language which is not installed, it is replaced with an empty string.
// When we try to uninstall an empty string, we uninstall every language.
$uninstalllang = array_filter($uninstalllang, function($lang) {
return !empty($lang);
});
if ($purgecaches) {
require_sesskey();
get_string_manager()->reset_caches();
@@ -69,11 +76,12 @@ if (($mode == INSTALLATION_OF_SELECTED_LANG) and confirm_sesskey() and !empty($p
if (is_array($pack) && count($pack) > 1) {
// Installing multiple languages can take a while - perform it asynchronously in the background.
$controller->schedule_languagepacks_installation($pack);
$controller->redirect($PAGE->url);
} else {
// Single language pack to be installed synchronously. It should be reasonably quick and can be used for debugging, too.
core_php_time_limit::raise();
$controller->install_languagepacks($pack);
$controller->redirect($PAGE->url);
}
}
@@ -102,7 +110,7 @@ if ($mode == DELETION_OF_SELECTED_LANG and (!empty($uninstalllang) or !empty($co
foreach ($uninstalllang as $ulang) {
$controller->uninstall_language($ulang);
}
$controller->redirect($PAGE->url);
}
}
@@ -0,0 +1,59 @@
<?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/>.
namespace tool_langimport;
/**
* Tests for \tool_langimport\locale class.
*
* @package tool_langimport
* @category test
* @coversDefaultClass \tool_langimport\controller
* @copyright 2023 Andrew Lyons <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class controller_test extends \advanced_testcase {
/**
* Test uninstall of language with invalid values.
*
* @covers ::uninstall_lang
* @dataProvider uninstall_lang_invalid_provider
* @params string $lang
*/
public function test_uninstall_lang_invalid(string $lang): void {
global $CFG;
$controller = new controller();
$this->assertFalse($controller->uninstall_language($lang));
$this->assertFileExists("{$CFG->dataroot}/lang");
$this->assertFileExists("{$CFG->dirroot}/lang/en");
}
/**
* Data provider for uninstall_lang tests with invalid values.
*
* @return array
*/
public function uninstall_lang_invalid_provider(): array {
return [
'Empty string' => [''],
'Meaningless empty string' => [' '],
'Default language' => ['en'],
'Invalid language string' => ['swedish'],
];
}
}
+5 -20
View File
@@ -14,19 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* License manager helper class.
*
* @package tool_licensemanager
* @copyright 2019 Tom Dickman <tomdickman@catalyst-au.net>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_licensemanager;
use moodle_url;
defined('MOODLE_INTERNAL') || die();
/**
* License manager helper class.
@@ -48,12 +40,7 @@ class helper {
* @return \moodle_url
*/
public static function get_licensemanager_url() : moodle_url {
global $CFG;
$url = new moodle_url($CFG->wwwroot . self::MANAGER_PATH,
['sesskey' => sesskey()]);
return $url;
return new moodle_url(self::MANAGER_PATH);
}
/**
@@ -90,9 +77,8 @@ class helper {
* @return \moodle_url
*/
public static function get_create_license_url() : moodle_url {
$url = new moodle_url(self::MANAGER_PATH,
['action' => manager::ACTION_CREATE, 'sesskey' => sesskey()]);
$url = self::get_licensemanager_url();
$url->params(['action' => manager::ACTION_CREATE]);
return $url;
}
@@ -104,9 +90,8 @@ class helper {
* @return \moodle_url
*/
public static function get_update_license_url(string $licenseshortname) : moodle_url {
$url = new moodle_url(self::MANAGER_PATH,
['action' => manager::ACTION_UPDATE, 'license' => $licenseshortname, 'sesskey' => sesskey()]);
$url = self::get_licensemanager_url();
$url->params(['action' => manager::ACTION_UPDATE, 'license' => $licenseshortname]);
return $url;
}
+9 -10
View File
@@ -14,22 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* License manager.
*
* @package tool_licensemanager
* @copyright 2019 Tom Dickman <tomdickman@catalyst-au.net>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_licensemanager;
use tool_licensemanager\form\edit_license;
use license_manager;
use stdClass;
defined('MOODLE_INTERNAL') || die();
/**
* License manager, main controller for tool_licensemanager.
*
@@ -95,18 +85,25 @@ class manager {
}
$viewmanager = true;
$redirect = helper::get_licensemanager_url();
switch ($action) {
case self::ACTION_DISABLE:
require_sesskey();
license_manager::disable($license);
redirect($redirect);
break;
case self::ACTION_ENABLE:
require_sesskey();
license_manager::enable($license);
redirect($redirect);
break;
case self::ACTION_DELETE:
require_sesskey();
license_manager::delete($license);
redirect($redirect);
break;
case self::ACTION_CREATE:
@@ -116,7 +113,9 @@ class manager {
case self::ACTION_MOVE_UP:
case self::ACTION_MOVE_DOWN:
require_sesskey();
$this->change_license_order($action, $license);
redirect($redirect);
break;
case self::ACTION_VIEW_LICENSE_MANAGER:
-6
View File
@@ -28,15 +28,9 @@ require_once($CFG->libdir . '/licenselib.php');
require_admin();
$returnurl = \tool_licensemanager\helper::get_licensemanager_url();
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
$license = optional_param('license', '', PARAM_SAFEDIR);
if (!confirm_sesskey()) {
redirect($returnurl);
}
// Route via the manager.
$licensemanager = new \tool_licensemanager\manager();
$PAGE->set_context(context_system::instance());
@@ -10,12 +10,12 @@ Feature: Licence manager
Then I should see "Licence not specified" in the "unknown" "table_row"
And I should see "All rights reserved" in the "allrightsreserved" "table_row"
And I should see "Public domain" in the "public" "table_row"
And I should see "Creative Commons" in the "cc" "table_row"
And I should see "Creative Commons - NoDerivs" in the "cc-nd" "table_row"
And I should see "Creative Commons - No Commercial NoDerivs" in the "cc-nc-nd" "table_row"
And I should see "Creative Commons - No Commercial" in the "cc-nc" "table_row"
And I should see "Creative Commons - No Commercial ShareAlike" in the "cc-nc-sa" "table_row"
And I should see "Creative Commons - ShareAlike" in the "cc-sa" "table_row"
And I should see "Creative Commons - 4.0 International" in the "cc-4.0" "table_row"
And I should see "Creative Commons - NoDerivatives 4.0 International" in the "cc-nd-4.0" "table_row"
And I should see "Creative Commons - NonCommercial-NoDerivatives 4.0 International" in the "cc-nc-nd-4.0" "table_row"
And I should see "Creative Commons - NonCommercial-ShareAlike 4.0 International" in the "cc-nc-sa-4.0" "table_row"
And I should see "Creative Commons - ShareAlike 4.0 International" in the "cc-sa-4.0" "table_row"
And I should see "Creative Commons - NonCommercial 4.0 International" in the "cc-nc-4.0" "table_row"
Scenario: I should be able to enable and disable licences
Given I log in as "admin"
@@ -25,25 +25,25 @@ Feature: Licence manager
And I navigate to "Licence > Licence manager" in site administration
Then "This is the site default licence" "icon" should exist in the "public" "table_row"
And "Enable licence" "icon" should not exist in the "public" "table_row"
And "This is the site default licence" "icon" should not exist in the "cc" "table_row"
And "This is the site default licence" "icon" should not exist in the "cc-4.0" "table_row"
And I navigate to "Licence > Licence settings" in site administration
And I set the field "Default site licence" to "Creative Commons"
And I press "Save changes"
And I navigate to "Licence > Licence manager" in site administration
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 exist in the "cc-4.0" "table_row"
And "Enable licence" "icon" should not exist in the "cc-4.0" "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 |
| sitedefaultlicense | cc-4.0 |
| rememberuserlicensepref | <rememberuserlicensepref> |
And I log in as "admin"
And I follow "Private files" in the user menu
And I follow "Add..."
And I follow "Upload a file"
And the field with xpath "//select[@name='license']" matches value "Creative Commons"
And the field with xpath "//select[@name='license']" matches value "Creative Commons - 4.0 International"
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 |
@@ -53,6 +53,6 @@ Feature: Licence manager
Then the field with xpath "//select[@name='license']" matches value "<expectedlicence>"
Examples:
| rememberuserlicensepref | expectedlicence |
| 0 | Creative Commons |
| 1 | Public domain |
| rememberuserlicensepref | expectedlicence |
| 0 | Creative Commons - 4.0 International |
| 1 | Public domain |
@@ -174,24 +174,24 @@ class manager_test extends advanced_testcase {
$this->resetAfterTest();
$licenseorder = array_keys(license_manager::get_licenses());
$initialposition = array_search('cc-nc', $licenseorder);
$initialposition = array_search('cc-nc-4.0', $licenseorder);
$manager = new tool_licensemanager\manager();
// We're testing a private method, so we need to setup reflector magic.
$method = new ReflectionMethod('\tool_licensemanager\manager', 'change_license_order');
$method->setAccessible(true); // Allow accessing of private method.
$method->invoke($manager, \tool_licensemanager\manager::ACTION_MOVE_UP, 'cc-nc');
$method->invoke($manager, \tool_licensemanager\manager::ACTION_MOVE_UP, 'cc-nc-4.0');
$licenseorder = array_keys(license_manager::get_licenses());
$newposition = array_search('cc-nc', $licenseorder);
$newposition = array_search('cc-nc-4.0', $licenseorder);
$this->assertLessThan($initialposition, $newposition);
$initialposition = array_search('allrightsreserved', $licenseorder);
$method->invoke($manager, \tool_licensemanager\manager::ACTION_MOVE_DOWN, 'allrightsreserved');
$licenseorder = array_keys(license_manager::get_licenses());
$newposition = array_search('cc-nc', $licenseorder);
$newposition = array_search('cc-nc-4.0', $licenseorder);
$this->assertGreaterThan($initialposition, $newposition);
}
@@ -94,7 +94,7 @@ class behat_tool_lp_data_generators extends behat_base {
);
/**
* Creates the specified element. More info about available elements in http://docs.moodle.org/dev/Acceptance_testing#Fixtures.
* Creates the specified element. More info about available elements in https://moodledev.io/general/development/tools/behat.
*
* @Given /^the following lp "(?P<element_string>(?:[^"]|\\")*)" exist:$/
*
@@ -128,3 +128,18 @@ Feature: Manage competency frameworks
Then I should see "Competency framework updated"
And I should see "Science Year-6 Edited"
And I should see "sc-y-6"
Scenario: Duplicate a competency framework
Given the following lp "frameworks" exist:
| shortname | idnumber |
| CF1 | CF1 |
And the following lp "competencies" exist:
| shortname | framework |
| C1 | CF1 |
And I navigate to "Competencies > Competency frameworks" in site administration
# Duplicate the selected competency framework
When I click on "Duplicate" of edit menu in the "CF1" row
# Confirm that the selected framework was duplicated by clicking on the link
And I click on "CF1 (copy) (CF1_1)" "link"
# Confirm that the corresponding competency also exists in the duplicated framework
Then I should see "C1"
+11 -17
View File
@@ -15,6 +15,17 @@ Feature: Manage plan workflow
| usermanageowndraftplan | User manage own draft plan role | user |
| usermanageownplan | User manage own plan role | user |
| manageplan | Manager all plans role | manager |
And the following "role capabilities" exist:
| role | moodle/competency:planmanageowndraft | moodle/competency:planmanageown |
| usermanageowndraftplan | allow | |
| usermanageownplan | allow | allow |
| manageplan | allow | allow |
And the following "role capability" exists:
| role | manageplan |
| moodle/competency:planmanage | allow |
| moodle/competency:planview | allow |
| moodle/competency:planreview | allow |
| moodle/competency:planrequestreview | allow |
And the following "role assigns" exist:
| user | role | contextlevel | reference |
| user1 | usermanageowndraftplan | System | |
@@ -40,23 +51,6 @@ Feature: Manage plan workflow
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| lp | System | 1 | my-index | content |
And I log in as "admin"
And I set the following system permissions of "User manage own draft plan role" role:
| capability | permission |
| moodle/competency:planmanageowndraft | Allow |
And I set the following system permissions of "User manage own plan role" role:
| capability | permission |
| moodle/competency:planmanageowndraft | Allow |
| moodle/competency:planmanageown | Allow |
And I set the following system permissions of "Manager all plans role" role:
| capability | permission |
| moodle/competency:planmanage | Allow |
| moodle/competency:planmanagedraft | Allow |
| moodle/competency:planmanageowndraft | Allow |
| moodle/competency:planview | Allow |
| moodle/competency:planreview | Allow |
| moodle/competency:planrequestreview | Allow |
And I log out
Scenario: User can manages his own plan draft
Given I log in as "user1"
+2
View File
@@ -25,6 +25,8 @@
require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('toollpexportcsv');
$pagetitle = get_string('exportnavlink', 'tool_lpimportcsv');
$context = context_system::instance();
+2
View File
@@ -25,6 +25,8 @@ define('NO_OUTPUT_BUFFERING', true);
require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('toollpimportcsv');
$pagetitle = get_string('pluginname', 'tool_lpimportcsv');
$context = context_system::instance();
@@ -829,7 +829,7 @@ class manager {
// An auto-reply may itself include the Bulk Precedence.
$precedence = $messagedata->getHeaderText(0, \Horde_Imap_Client_Data_Fetch::HEADER_PARSE)->getValue('Precedence');
$isbulk = $isbulk || strtolower($precedence) == 'bulk';
$isbulk = $isbulk || strtolower($precedence ?? '') == 'bulk';
// If the X-Autoreply header is set, and not 'no', then this is an automatic reply.
$autoreply = $messagedata->getHeaderText(0, \Horde_Imap_Client_Data_Fetch::HEADER_PARSE)->getValue('X-Autoreply');
+6 -2
View File
@@ -118,8 +118,12 @@ class api {
$langs = $stringmanager->get_list_of_translations(true);
foreach ($langs as $langid => $langname) {
foreach ($addoninfo['lang'] as $stringinfo) {
$lang[$langid][$stringinfo[0]] =
$stringmanager->get_string($stringinfo[0], $stringinfo[1], null, $langid);
$lang[$langid][$stringinfo[0]] = $stringmanager->get_string(
$stringinfo[0],
$stringinfo[1] ?? '',
null,
$langid
);
}
}
}
+1 -1
View File
@@ -319,7 +319,7 @@ class external extends external_api {
$timenow = time();
if ($timenow - $last < $mintimereq) {
$minutes = $mintimereq / MINSECS;
throw new moodle_exception('autologinkeygenerationlockout', 'tool_mobile', $minutes);
throw new moodle_exception('autologinkeygenerationlockout', 'tool_mobile', '', $minutes);
}
set_user_preference('tool_mobile_autologin_request_last', $timenow, $USER);
+1 -1
View File
@@ -222,7 +222,7 @@ function tool_mobile_standard_footer_html() {
global $CFG;
$output = '';
if (!empty($CFG->enablemobilewebservice) && $url = tool_mobile_create_app_download_url()) {
$output .= html_writer::link($url, get_string('getmoodleonyourmobile', 'tool_mobile'));
$output .= html_writer::link($url, get_string('getmoodleonyourmobile', 'tool_mobile'), ['class' => 'mobilelink']);
}
return $output;
}
+1 -1
View File
@@ -56,7 +56,7 @@ $context = context_system::instance();
$PAGE->set_url(new \moodle_url('/'.$CFG->admin.'/tool/mobile/logout.php'));
$PAGE->navbar->add($title);
$PAGE->set_context($context);
$PAGE->set_title($SITE->fullname. ': ' . $title);
$PAGE->set_title($title);
// Display the page.
echo $OUTPUT->header();
+3 -2
View File
@@ -31,7 +31,6 @@ define('NO_DEBUG_DISPLAY', true);
define('NO_MOODLE_COOKIES', true);
require_once(__DIR__ . '/../../../config.php');
use tool_mobile\api;
header('Content-Type: application/json; charset: utf-8');
@@ -41,7 +40,9 @@ if (!empty($CFG->enablemobilewebservice) && !empty($mobilesettings->enablesmarta
!empty($mobilesettings->androidappid)) {
$manifest = new StdClass;
$manifest->short_name = format_string($SITE->shortname);
$manifest->short_name = format_string($SITE->shortname, true, [
'context' => context_system::instance(),
]);
$manifest->prefer_related_applications = true;
$manifest->icons = [(object)
[
+6 -6
View File
@@ -387,18 +387,18 @@ class externallib_test extends externallib_advanced_testcase {
$result = external::get_autologin_key($token->privatetoken);
$result = \external_api::clean_returnvalue(external::get_autologin_key_returns(), $result);
// Change min time between requests to 30 seconds.
set_config('autologinmintimebetweenreq', 30, 'tool_mobile');
// Change min time between requests to 3 minutes.
set_config('autologinmintimebetweenreq', 3 * MINSECS, 'tool_mobile');
// Mock a previous request, 60 seconds ago.
$mocktime = time() - MINSECS;
// Mock a previous request, 4 minutes ago.
$mocktime = time() - (4 * MINSECS);
set_user_preference('tool_mobile_autologin_request_last', $mocktime, $USER);
$result = external::get_autologin_key($token->privatetoken); // All good, we were expecint 30 seconds or more.
$result = external::get_autologin_key($token->privatetoken);
$result = \external_api::clean_returnvalue(external::get_autologin_key_returns(), $result);
// We just requested one token, we must wait.
$this->expectException('moodle_exception');
$this->expectExceptionMessage(get_string('autologinkeygenerationlockout', 'tool_mobile'));
$this->expectExceptionMessage(get_string('autologinkeygenerationlockout', 'tool_mobile', 3));
$result = external::get_autologin_key($token->privatetoken);
}
+53 -134
View File
@@ -14,17 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Event documentation
*
* @package tool_monitor
* @copyright 2014 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_monitor;
defined('MOODLE_INTERNAL') || die();
use core_component;
use ReflectionClass;
/**
* Class for returning event information.
@@ -35,126 +29,6 @@ defined('MOODLE_INTERNAL') || die();
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class eventlist {
/**
* Return all of the core event files.
*
* @return array Core events.
*/
protected static function get_core_eventlist() {
global $CFG;
// Disable developer debugging as deprecated events will fire warnings.
// Setup backup variables to restore the following settings back to what they were when we are finished.
$debuglevel = $CFG->debug;
$debugdisplay = $CFG->debugdisplay;
$debugdeveloper = $CFG->debugdeveloper;
$CFG->debug = 0;
$CFG->debugdisplay = false;
$CFG->debugdeveloper = false;
$eventinformation = array();
$directory = $CFG->libdir . '/classes/event';
$files = self::get_file_list($directory);
// Remove exceptional events that will cause problems being displayed.
if (isset($files['unknown_logged'])) {
unset($files['unknown_logged']);
}
foreach ($files as $file => $location) {
$classname = '\\core\\event\\' . $file;
// Check to see if this is actually a valid event.
if (method_exists($classname, 'get_static_info')) {
$ref = new \ReflectionClass($classname);
// Ignore abstracts.
if (!$ref->isAbstract() && $file != 'manager') {
$eventinformation[$classname] = $classname::get_name_with_info();
}
}
}
// Now enable developer debugging as event information has been retrieved.
$CFG->debug = $debuglevel;
$CFG->debugdisplay = $debugdisplay;
$CFG->debugdeveloper = $debugdeveloper;
return $eventinformation;
}
/**
* This function returns an array of all events for the plugins of the system.
*
* @param bool $withoutcomponent Return an eventlist without associated components.
*
* @return array A list of events from all plug-ins.
*/
protected static function get_non_core_eventlist($withoutcomponent = false) {
global $CFG;
// Disable developer debugging as deprecated events will fire warnings.
// Setup backup variables to restore the following settings back to what they were when we are finished.
$debuglevel = $CFG->debug;
$debugdisplay = $CFG->debugdisplay;
$debugdeveloper = $CFG->debugdeveloper;
$CFG->debug = 0;
$CFG->debugdisplay = false;
$CFG->debugdeveloper = false;
$noncorepluginlist = array();
$plugintypes = \core_component::get_plugin_types();
foreach ($plugintypes as $plugintype => $notused) {
$pluginlist = \core_component::get_plugin_list($plugintype);
foreach ($pluginlist as $plugin => $directory) {
$plugindirectory = $directory . '/classes/event';
foreach (self::get_file_list($plugindirectory) as $eventname => $notused) {
$fullpluginname = $plugintype . '_' . $plugin;
$plugineventname = '\\' . $fullpluginname . '\\event\\' . $eventname;
// Check that this is actually an event.
if (method_exists($plugineventname, 'get_static_info') && $fullpluginname !== 'tool_monitor') { // No selfie here.
$ref = new \ReflectionClass($plugineventname);
if (!$ref->isAbstract() && $fullpluginname !== 'logstore_legacy') {
if ($withoutcomponent) {
$noncorepluginlist[$plugineventname] = $plugineventname::get_name_with_info();
} else {
$noncorepluginlist[$fullpluginname][$plugineventname] = $plugineventname::get_name_with_info();
}
}
}
}
}
}
// Now enable developer debugging as event information has been retrieved.
$CFG->debug = $debuglevel;
$CFG->debugdisplay = $debugdisplay;
$CFG->debugdeveloper = $debugdeveloper;
return $noncorepluginlist;
}
/**
* Returns a list of files with a full directory path in a specified directory.
*
* @param string $directory location of files.
* @return array full location of files from the specified directory.
*/
protected static function get_file_list($directory) {
global $CFG;
$directoryroot = $CFG->dirroot;
$finalfiles = array();
if (is_dir($directory)) {
if ($handle = opendir($directory)) {
$files = scandir($directory);
foreach ($files as $file) {
if ($file != '.' && $file != '..') {
// Ignore the file if it is external to the system.
if (strrpos($directory, $directoryroot) !== false) {
$location = substr($directory, strlen($directoryroot));
$name = substr($file, 0, -4);
$finalfiles[$name] = $location . '/' . $file;
}
}
}
}
}
return $finalfiles;
}
/**
* Get a list of events present in the system.
@@ -164,13 +38,58 @@ class eventlist {
* @return array list of events present in the system.
*/
public static function get_all_eventlist($withoutcomponent = false) {
if ($withoutcomponent) {
$return = array_merge(self::get_core_eventlist(), self::get_non_core_eventlist($withoutcomponent));
array_multisort($return, SORT_NATURAL);
} else {
$return = array_merge(array('core' => self::get_core_eventlist()),
self::get_non_core_eventlist($withoutcomponent = false));
global $CFG;
// Disable developer debugging as deprecated events will fire warnings.
// Setup backup variables to restore the following settings back to what they were when we are finished.
$debuglevel = $CFG->debug;
$debugdisplay = $CFG->debugdisplay;
$debugdeveloper = $CFG->debugdeveloper;
$CFG->debug = 0;
$CFG->debugdisplay = false;
$CFG->debugdeveloper = false;
// List of exceptional events that will cause problems if displayed.
$eventsignore = [
\core\event\unknown_logged::class,
\logstore_legacy\event\legacy_logged::class,
];
$return = [];
$events = core_component::get_component_classes_in_namespace(null, 'event');
foreach (array_keys($events) as $event) {
// We need to filter all classes that extend event base, or the base class itself.
if (is_a($event, \core\event\base::class, true) && !in_array($event, $eventsignore)) {
$reflectionclass = new ReflectionClass($event);
if ($reflectionclass->isAbstract()) {
continue;
}
// We can't choose this component's own events.
[$component] = explode('\\', $event);
if ($component === 'tool_monitor') {
continue;
}
if ($withoutcomponent) {
$return["\\{$event}"] = $event::get_name_with_info();
} else {
$return[$component]["\\{$event}"] = $event::get_name_with_info();
}
}
}
// Now enable developer debugging as event information has been retrieved.
$CFG->debug = $debuglevel;
$CFG->debugdisplay = $debugdisplay;
$CFG->debugdeveloper = $debugdeveloper;
if ($withoutcomponent) {
array_multisort($return, SORT_NATURAL);
}
return $return;
}
@@ -194,10 +194,9 @@ class subscription_manager {
if (!is_null($coursecontext)) {
$context = $coursecontext;
$courseid = $subscription->courseid;
} else if (!empty($subscription->courseid) && ($coursecontext =
} else if (!empty($subscription->courseid) && ($context =
\context_course::instance($subscription->courseid, IGNORE_MISSING))) {
$courseid = $subscription->courseid;
$context = $coursecontext;
} else {
$courseid = 0;
$context = \context_system::instance();
@@ -169,10 +169,9 @@ Feature: tool_monitor_subscriptions
And I should not see "You can manage rules the from the Event monitoring rules page."
Scenario: No manage rules link when user does not have permission
Given I log in as "admin"
And I set the following system permissions of "Non-editing teacher" role:
| tool/monitor:managerules | Prohibit |
And I log out
Given the following "role capability" exists:
| role | teacher |
| tool/monitor:managerules | prohibit |
And I log in as "teacher1"
And I follow "Preferences" in the user menu
And I follow "Event monitoring"
@@ -98,7 +98,15 @@ class remote_resource_test extends \advanced_testcase {
]
);
$this->assertGreaterThan(0, $remoteres->get_download_size());
// We need to handle size of -1 (missing "Content-Length" header), or where it is set and greater than zero.
$this->assertThat(
$remoteres->get_download_size(),
$this->logicalOr(
$this->equalTo(-1),
$this->greaterThan(0),
),
);
[$path, $name] = $remoteres->download_to_requestdir();
$this->assertIsString($path);
$this->assertEquals('test.html', $name);
@@ -151,25 +151,25 @@ Feature: Basic OAuth2 functionality
| Service base URL | https://dc.imsglobal.org/ |
When I press "Save changes"
Then I should see "Changes saved"
And I should see "Open Badges"
And "Allow services" "icon" should exist in the "Open Badges" "table_row"
And "Do not allow login" "icon" should exist in the "Open Badges" "table_row"
And "Service discovery successful" "icon" should exist in the "Open Badges" "table_row"
And the "src" attribute of "table.admintable th img" "css_element" should contain "IMS-Global-Logo.png"
And I click on "Configure endpoints" "link" in the "Open Badges" "table_row"
And I should see "https://dc.imsglobal.org/.well-known/badgeconnect.json" in the "discovery_endpoint" "table_row"
And I should see "authorization_endpoint"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Configure user field mappings" "link" in the "Open Badges" "table_row"
And I should not see "given_name"
And I should not see "middle_name"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Edit" "link" in the "Open Badges" "table_row"
And I should see "IMS Global Reference Implementation"
And I click on "Edit" "link" in the "IMS Global Reference Implementation" "table_row"
And I set the following fields to these values:
| Name | IMS Global |
And I press "Save changes"
And I should see "Changes saved"
And I should see "IMS Global"
And "Allow services" "icon" should exist in the "IMS Global" "table_row"
And "Do not allow login" "icon" should exist in the "IMS Global" "table_row"
And "Service discovery successful" "icon" should exist in the "IMS Global" "table_row"
And the "src" attribute of "table.admintable th img" "css_element" should contain "IMS-Global-Logo.png"
And I click on "Configure endpoints" "link" in the "IMS Global" "table_row"
And I should see "https://dc.imsglobal.org/.well-known/badgeconnect.json" in the "discovery_endpoint" "table_row"
And I should see "authorization_endpoint"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Configure user field mappings" "link" in the "IMS Global" "table_row"
And I should not see "given_name"
And I should not see "middle_name"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Delete" "link" in the "IMS Global" "table_row"
And I should see "Are you sure you want to delete the identity issuer \"IMS Global\"?"
And I press "Continue"
@@ -573,7 +573,7 @@ class acceptances_table extends \table_sql {
if ($row->timemodified) {
if ($this->is_downloading()) {
// Use timestamp format readable for both machines and humans.
return date_format_string($row->timemodified, '%Y-%m-%d %H:%M:%S %Z');
return date_format_string((int) $row->timemodified, '%Y-%m-%d %H:%M:%S %Z');
} else {
// Use localised calendar format.
return userdate($row->timemodified, get_string('strftimedatetime'));
@@ -48,15 +48,18 @@ use tool_policy\policy_version;
*/
class page_viewalldoc implements renderable, templatable {
/** @var string Return url */
private $returnurl;
/** @var ?moodle_url Return url */
private $returnurl = null;
/**
* Prepare the page for rendering.
*
*/
public function __construct($returnurl) {
$this->returnurl = $returnurl;
if (!empty($returnurl)) {
$this->returnurl = new moodle_url($returnurl);
}
$this->prepare_global_page_access();
$this->prepare_policies();
}
@@ -48,11 +48,9 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
And "Pending" "text" should exist in the "User Two" "table_row"
Scenario: Agree on behalf of another user as a manager, single policy, javascript off
Given I log in as "admin"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
When I log in as "manager"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
@@ -73,11 +71,9 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
@javascript
Scenario: Agree on behalf of another user as a manager, single policy, javascript on
Given I log in as "admin"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
When I log in as "manager"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
@@ -135,13 +131,13 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
And "Pending" "text" should exist in the "This privacy policy" "table_row"
Scenario: Agree on behalf of another user as a manager, multiple policies, javascript off
Given I log in as "admin"
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
And I log in as "admin"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"
And I press "Continue"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
When I log in as "manager"
And I press "Next"
@@ -167,14 +163,14 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
@javascript
Scenario: Agree on behalf of another user as a manager, multiple policies, javascript on
Given I log in as "admin"
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
And I log in as "admin"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
And I click on "Actions" "link_or_button" in the "This privacy policy" "table_row"
And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"
And I press "Activate"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
When I log in as "manager"
And I press "Next"
@@ -215,11 +211,9 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
And I should not see "Policies and agreements"
Scenario: Policies and agreements profile link visible also for users who can access on behalf of others
Given I log in as "admin"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
And I log in as "manager"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
@@ -231,11 +225,9 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
Then I should see "Policies and agreements"
Scenario: Agree on behalf of another user as an admin who is logged in as a manager
Given I log in as "admin"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
When I log in as "manager"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
@@ -261,14 +253,14 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
@javascript
Scenario: Bulk agree on behalf of another users as a manager, multiple policies, javascript on
Given I log in as "admin"
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
And I log in as "admin"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
And I click on "Actions" "link_or_button" in the "This privacy policy" "table_row"
And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"
And I press "Activate"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
When I log in as "manager"
And I press "Next"
@@ -54,10 +54,7 @@ Feature: Backup user data
And I navigate to "Recycle bin" in current page administration
And I should see "Quiz 1"
And I click on "Restore" "link" in the "region-main" "region"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
When I navigate to "User report" in the course gradebook
When I am on the "Course 1" "grades > User report > View" page logged in as "student1"
Then "Quiz 1" row "Grade" column of "user-grade" table should contain "50"
And "Quiz 1" row "Percentage" column of "user-grade" table should contain "50"
+1 -1
View File
@@ -101,7 +101,7 @@ class tool_uploadcourse_course {
/** @var array fields allowed as course data. */
static protected $validfields = array('fullname', 'shortname', 'idnumber', 'category', 'visible', 'startdate', 'enddate',
'summary', 'format', 'theme', 'lang', 'newsitems', 'showgrades', 'showreports', 'legacyfiles', 'maxbytes',
'groupmode', 'groupmodeforce', 'enablecompletion', 'downloadcontent');
'groupmode', 'groupmodeforce', 'enablecompletion', 'downloadcontent', 'showactivitydates');
/** @var array fields required on course creation. */
static protected $mandatoryfields = array('fullname', 'category');
@@ -192,6 +192,10 @@ class tool_uploadcourse_step2_form extends tool_uploadcourse_base_form {
$mform->addHelpButton('defaults[enablecompletion]', 'enablecompletion', 'completion');
}
$mform->addElement('selectyesno', 'defaults[showactivitydates]', get_string('showactivitydates'));
$mform->addHelpButton('defaults[showactivitydates]', 'showactivitydates');
$mform->setDefault('defaults[showactivitydates]', $courseconfig->showactivitydates);
// Add custom fields to the form.
$handler = \core_course\customfield\course_handler::create();
$handler->instance_form_definition($mform, 0, 'defaultvaluescustomfieldcategory', 'tool_uploadcourse');
+6 -3
View File
@@ -173,13 +173,16 @@ class tool_uploadcourse_tracker {
} else {
$outcome = $OUTPUT->pix_icon('i/invalid', '');
}
echo html_writer::start_tag('tr', array('class' => 'r' . $this->rownb % 2));
echo html_writer::tag('td', $line, array('class' => 'c' . $ci++));
echo html_writer::tag('td', $outcome, array('class' => 'c' . $ci++));
echo html_writer::tag('td', isset($data['id']) ? $data['id'] : '', array('class' => 'c' . $ci++));
echo html_writer::tag('td', isset($data['shortname']) ? $data['shortname'] : '', array('class' => 'c' . $ci++));
echo html_writer::tag('td', isset($data['fullname']) ? $data['fullname'] : '', array('class' => 'c' . $ci++));
echo html_writer::tag('td', isset($data['idnumber']) ? $data['idnumber'] : '', array('class' => 'c' . $ci++));
// Ensure our data is suitable for HTML output.
echo html_writer::tag('td', isset($data['shortname']) ? s($data['shortname']) : '', array('class' => 'c' . $ci++));
echo html_writer::tag('td', isset($data['fullname']) ? s($data['fullname']) : '', array('class' => 'c' . $ci++));
echo html_writer::tag('td', isset($data['idnumber']) ? s($data['idnumber']) : '', array('class' => 'c' . $ci++));
echo html_writer::tag('td', $status, array('class' => 'c' . $ci++));
echo html_writer::end_tag('tr');
}
@@ -166,6 +166,7 @@ $defaults['groupmodeforce'] = $courseconfig->groupmodeforce;
$defaults['visible'] = $courseconfig->visible;
$defaults['lang'] = $courseconfig->lang;
$defaults['enablecompletion'] = $courseconfig->enablecompletion;
$defaults['showactivitydates'] = $courseconfig->showactivitydates;
// Course template.
if (isset($options['templatecourse'])) {
@@ -425,6 +425,7 @@ class course_test extends \advanced_testcase {
'groupmode' => '2',
'groupmodeforce' => '1',
'enablecompletion' => '1',
'showactivitydates' => '1',
'tags' => 'Cat, Dog',
'role_teacher' => 'Knight',
@@ -478,6 +479,7 @@ class course_test extends \advanced_testcase {
$this->assertEquals($data['groupmode'], $course->groupmode);
$this->assertEquals($data['groupmodeforce'], $course->groupmodeforce);
$this->assertEquals($data['enablecompletion'], $course->enablecompletion);
$this->assertEquals($data['showactivitydates'], $course->showactivitydates);
$this->assertEquals($data['tags'], join(', ', \core_tag_tag::get_item_tags_array('core', 'course', $course->id)));
// Roles.
@@ -530,6 +532,7 @@ class course_test extends \advanced_testcase {
'groupmode' => '1',
'groupmodeforce' => '0',
'enablecompletion' => '0',
'showactivitydates' => '0',
'role_teacher' => 'Teacher',
'role_manager' => 'Manager',
@@ -583,6 +586,7 @@ class course_test extends \advanced_testcase {
$this->assertEquals($data['groupmode'], $course->groupmode);
$this->assertEquals($data['groupmodeforce'], $course->groupmodeforce);
$this->assertEquals($data['enablecompletion'], $course->enablecompletion);
$this->assertEquals($data['showactivitydates'], $course->showactivitydates);
// Roles.
$roleids = array();
@@ -644,6 +648,7 @@ class course_test extends \advanced_testcase {
'groupmode' => '2',
'groupmodeforce' => '1',
'enablecompletion' => '1',
'showactivitydates' => '1',
);
$this->assertFalse($DB->record_exists('course', array('shortname' => 'c1')));
@@ -673,6 +678,7 @@ class course_test extends \advanced_testcase {
$this->assertEquals($defaultdata['groupmode'], $course->groupmode);
$this->assertEquals($defaultdata['groupmodeforce'], $course->groupmodeforce);
$this->assertEquals($defaultdata['enablecompletion'], $course->enablecompletion);
$this->assertEquals($defaultdata['showactivitydates'], $course->showactivitydates);
// Update.
$cat = $this->getDataGenerator()->create_category();
@@ -701,6 +707,7 @@ class course_test extends \advanced_testcase {
'groupmode' => '1',
'groupmodeforce' => '0',
'enablecompletion' => '0',
'showactivitydates' => '0',
);
$this->assertTrue($DB->record_exists('course', array('shortname' => 'c1')));
@@ -730,6 +737,7 @@ class course_test extends \advanced_testcase {
$this->assertEquals($defaultdata['groupmode'], $course->groupmode);
$this->assertEquals($defaultdata['groupmodeforce'], $course->groupmodeforce);
$this->assertEquals($defaultdata['enablecompletion'], $course->enablecompletion);
$this->assertEquals($defaultdata['showactivitydates'], $course->showactivitydates);
}
public function test_rename() {
@@ -153,14 +153,10 @@ Feature: Apply tour filters to a tour
| Course 1 | C1 | topics | 1 |
| Course 2 | C2 | topics | 1 |
And the following "activities" exist:
| activity | course | name | firstpagetitle | wikimode |
| wiki | C1 | Test wiki name | First page | collaborative |
| activity | course | name | firstpagetitle | wikimode | idnumber | intro | type |
| wiki | C1 | Test wiki name | First page | collaborative | | | |
| forum | C2 | Test forum name | | | 001 | Test forum description | general |
And I log in as "admin"
And I am on "Course 2" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Forum type | Standard forum for general use |
| Description | Test forum description |
And I add a new user tour with:
| Name | Wiki tour |
| Description | A tour with both matches |
+13 -7
View File
@@ -29,13 +29,6 @@ require_once($CFG->dirroot . '/webservice/lib.php');
admin_externalpage_setup('webservicedocumentation');
// get all the function descriptions
$functions = $DB->get_records('external_functions', array(), 'name');
$functiondescs = array();
foreach ($functions as $function) {
$functiondescs[$function->name] = external_api::external_function_info($function);
}
// TODO: MDL-76078 - Incorrect inter-communication, core cannot have plugin dependencies like this.
//display the documentation for all documented protocols,
@@ -50,6 +43,19 @@ $printableformat = optional_param('print', false, PARAM_BOOL);
/// OUTPUT
echo $OUTPUT->header();
// Get all the function descriptions.
$functions = $DB->get_records('external_functions', [], 'name');
$functiondescs = [];
foreach ($functions as $function) {
// Skip invalid or otherwise incorrectly defined functions, otherwise the entire page is rendered inaccessible.
try {
$functiondescs[$function->name] = external_api::external_function_info($function);
} catch (Throwable $exception) {
echo $OUTPUT->notification($exception->getMessage(), \core\output\notification::NOTIFY_ERROR);
}
}
$renderer = $PAGE->get_renderer('core', 'webservice');
echo $renderer->documentation_html($functiondescs,
$printableformat, $protocols, array(), $PAGE->url);
+2 -1
View File
@@ -37,8 +37,9 @@ interface analysable {
/**
* Max timestamp.
* We are limited by both PHP's max int value and DB (cross-db) max int allowed. Use the smallest one.
*/
const MAX_TIME = 9999999999;
const MAX_TIME = PHP_INT_MAX < 9999999999 ? PHP_MAX_INT : 9999999999;
/**
* The analysable unique identifier in the site.
+55 -16
View File
@@ -29,6 +29,7 @@ require_once(__DIR__ . '/fixtures/test_target_course_level_shortname.php');
* @package core_analytics
* @copyright 2017 David Monllaó {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @covers \core_analytics\manager
*/
class manager_test extends \advanced_testcase {
@@ -491,25 +492,63 @@ class manager_test extends \advanced_testcase {
// No potential context restrictions.
$this->assertFalse(\core_analytics\manager::get_potential_context_restrictions([]));
$defaultcategory = \core_course_category::get_default();
$defaultcategorycontext = $defaultcategory->get_context();
// Include the all context levels so the misc. category get included.
$this->assertCount(1, \core_analytics\manager::get_potential_context_restrictions());
$this->assertEquals([
$defaultcategorycontext->id => "Category: {$defaultcategory->name}",
], manager::get_potential_context_restrictions());
$this->getDataGenerator()->create_course();
$this->getDataGenerator()->create_category();
$this->assertCount(3, \core_analytics\manager::get_potential_context_restrictions());
$this->assertCount(3, \core_analytics\manager::get_potential_context_restrictions([CONTEXT_COURSE, CONTEXT_COURSECAT]));
$category = $this->getDataGenerator()->create_category(['name' => 'My category']);
$categorycontext = $category->get_context();
$this->assertCount(1, \core_analytics\manager::get_potential_context_restrictions([CONTEXT_COURSE]));
$this->assertCount(2, \core_analytics\manager::get_potential_context_restrictions([CONTEXT_COURSECAT]));
$courseone = $this->getDataGenerator()->create_course(['fullname' => 'Course one', 'shortname' => 'CS1']);
$courseonecontext = \context_course::instance($courseone->id);
$this->assertCount(1, \core_analytics\manager::get_potential_context_restrictions([CONTEXT_COURSECAT], 'Course category'));
$this->assertCount(1, \core_analytics\manager::get_potential_context_restrictions([CONTEXT_COURSECAT], 'Course category 1'));
$this->assertCount(
2,
\core_analytics\manager::get_potential_context_restrictions([CONTEXT_COURSECAT],
get_string('defaultcategoryname')
));
$this->assertCount(1, \core_analytics\manager::get_potential_context_restrictions([CONTEXT_COURSE], 'Test course 1'));
$this->assertCount(1, \core_analytics\manager::get_potential_context_restrictions([CONTEXT_COURSE], 'Test course'));
$coursetwo = $this->getDataGenerator()->create_course(['fullname' => 'Course two', 'shortname' => 'CS2']);
$coursetwocontext = \context_course::instance($coursetwo->id);
// All context levels.
$this->assertEqualsCanonicalizing([
$defaultcategorycontext->id => "Category: {$defaultcategory->name}",
$categorycontext->id => "Category: {$category->name}",
$courseonecontext->id => "Course: {$courseone->shortname}",
$coursetwocontext->id => "Course: {$coursetwo->shortname}",
], manager::get_potential_context_restrictions());
// All category/course context levels.
$this->assertEqualsCanonicalizing([
$defaultcategorycontext->id => "Category: {$defaultcategory->name}",
$categorycontext->id => "Category: {$category->name}",
$courseonecontext->id => "Course: {$courseone->shortname}",
$coursetwocontext->id => "Course: {$coursetwo->shortname}",
], manager::get_potential_context_restrictions([CONTEXT_COURSECAT, CONTEXT_COURSE]));
// All category context levels.
$this->assertEqualsCanonicalizing([
$defaultcategorycontext->id => "Category: {$defaultcategory->name}",
$categorycontext->id => "Category: {$category->name}",
], manager::get_potential_context_restrictions([CONTEXT_COURSECAT]));
// Filtered category context levels.
$this->assertEquals([
$categorycontext->id => "Category: {$category->name}",
], manager::get_potential_context_restrictions([CONTEXT_COURSECAT], 'My cat'));
$this->assertEmpty(manager::get_potential_context_restrictions([CONTEXT_COURSECAT], 'nothing'));
// All course context levels.
$this->assertEqualsCanonicalizing([
$courseonecontext->id => "Course: {$courseone->shortname}",
$coursetwocontext->id => "Course: {$coursetwo->shortname}",
], manager::get_potential_context_restrictions([CONTEXT_COURSE]));
// Filtered course context levels.
$this->assertEquals([
$courseonecontext->id => "Course: {$courseone->shortname}",
], manager::get_potential_context_restrictions([CONTEXT_COURSE], 'one'));
$this->assertEmpty(manager::get_potential_context_restrictions([CONTEXT_COURSE], 'nothing'));
}
}
+1 -1
View File
@@ -26,7 +26,7 @@ $sesskey = sesskey();
// when we've already left the page that set the timer.
$loginsite = get_string("loginsite");
$PAGE->navbar->add($loginsite);
$PAGE->set_title("$site->fullname: $loginsite");
$PAGE->set_title($loginsite);
$PAGE->set_heading($site->fullname);
echo $OUTPUT->header();
+1 -1
View File
@@ -26,7 +26,7 @@ if (!$authplugin->ntlmsso_finish()) {
// here (and not add 3 more secs).
$loginsite = get_string("loginsite");
$PAGE->navbar->add($loginsite);
$PAGE->set_title("$site->fullname: $loginsite");
$PAGE->set_title($loginsite);
$PAGE->set_heading($site->fullname);
echo $OUTPUT->header();
redirect($CFG->wwwroot . '/login/index.php?authldap_skipntlmsso=1',
+5 -2
View File
@@ -199,7 +199,6 @@ class auth_plugin_lti extends \auth_plugin_base {
}
}
$user = $this->create_new_account($member, $iss);
$this->update_user_account($user, $member, $iss);
return \core_user::get_user($user->id);
}
}
@@ -381,7 +380,11 @@ class auth_plugin_lti extends \auth_plugin_base {
'lastname' => $userdata['family_name'] ?? $iss,
'email' => $email
];
user_update_user($update);
$userfieldstocompare = array_intersect_key((array) $user, $update);
if (!empty(array_diff($update, $userfieldstocompare))) {
user_update_user($update); // Only update if there's a change.
}
if (!empty($userdata['picture'])) {
try {
+39 -11
View File
@@ -249,12 +249,15 @@ class auth_test extends \advanced_testcase {
$mockjwtdata = $this->get_mock_launchdata_for_user($launchdata['user'], $launchdata['migration_claim'] ?? []);
// Authenticate the platform user.
$sink = $this->redirectEvents();
$countusersbefore = $DB->count_records('user');
$user = $auth->find_or_create_user_from_launch($mockjwtdata, true, $legacysecrets);
if (!empty($expected['migration_debugging'])) {
$this->assertDebuggingCalled();
}
$countusersafter = $DB->count_records('user');
$events = $sink->get_events();
$sink->close();
// Verify user count is correct. i.e. no user is created when migration claim is correctly processed or when
// the user has authenticated with the tool before.
@@ -295,15 +298,18 @@ class auth_test extends \advanced_testcase {
$this->verify_user_profile_image_updated($user->id);
}
// If migrated, verify the user account is reusing the legacy user account.
if (!empty($expected['migrated']) && $expected['migrated']) {
// If migrated, verify the user account is reusing the legacy user account.
$legacyuserids = array_column($legacyusers, 'id');
$this->assertContains($user->id, $legacyuserids);
}
// If the user is authenticating a second time, confirm the same account is being returned.
if (isset($firstauthuser)) {
$this->assertInstanceOf(\core\event\user_updated::class, $events[0]);
} else if (isset($firstauthuser)) {
// If the user is authenticating a second time, confirm the same account is being returned.
$this->assertEquals($firstauthuser->id, $user->id);
$this->assertEmpty($events); // The user authenticated with the same data once before, so we don't expect an update.
} else {
// The user wasn't migrated and hasn't launched before, so we expect a user_created event.
$this->assertInstanceOf(\core\event\user_created::class, $events[0]);
}
}
@@ -819,9 +825,12 @@ class auth_test extends \advanced_testcase {
$mockmemberdata = $this->get_mock_member_data_for_user($memberdata['user'], $memberdata['legacy_user_id'] ?? '');
// Authenticate the platform user.
$sink = $this->redirectEvents();
$countusersbefore = $DB->count_records('user');
$user = $auth->find_or_create_user_from_membership($mockmemberdata, $iss, $legacyconsumerkey ?? '');
$countusersafter = $DB->count_records('user');
$events = $sink->get_events();
$sink->close();
// Verify user count is correct. i.e. no user is created when migration claim is correctly processed or when
// the user has authenticated with the tool before.
@@ -857,15 +866,18 @@ class auth_test extends \advanced_testcase {
break;
}
// If migrated, verify the user account is reusing the legacy user account.
if (!empty($expected['migrated']) && $expected['migrated']) {
// If migrated, verify the user account is reusing the legacy user account.
$legacyuserids = array_column($legacyusers, 'id');
$this->assertContains($user->id, $legacyuserids);
}
// If the user is authenticating a second time, confirm the same account is being returned.
if (isset($firstauthuser)) {
$this->assertInstanceOf(\core\event\user_updated::class, $events[0]);
} else if (isset($firstauthuser)) {
// If the user is authenticating a second time, confirm the same account is being returned.
$this->assertEquals($firstauthuser->id, $user->id);
$this->assertEmpty($events); // The user authenticated with the same data once before, so we don't expect an update.
} else {
// The user wasn't migrated and hasn't launched before, so we expect a user_created event.
$this->assertInstanceOf(\core\event\user_created::class, $events[0]);
}
}
@@ -1090,7 +1102,23 @@ class auth_test extends \advanced_testcase {
'PII' => self::PII_NONE,
'migrated' => false
]
]
],
'Existing (linked) platform learner including PII, no legacy data, no consumer key bound, no legacy id' => [
'legacy_data' => null,
'launch_data' => [
'has_authenticated_before' => true,
'user' => $this->get_mock_users_with_ids(
['1'],
'http://purl.imsglobal.org/vocab/lis/v2/membership#Learner'
)[0],
],
'iss' => $this->issuer,
'legacy_consumer_key' => null,
'expected' => [
'PII' => self::PII_ALL,
'migrated' => false
]
],
];
}
+11 -9
View File
@@ -40,7 +40,7 @@ if (!\auth_oauth2\api::is_enabled()) {
$confirmed = $auth->user_confirm($username, $usersecret);
if ($confirmed == AUTH_CONFIRM_ALREADY) {
if ($confirmed == AUTH_CONFIRM_ALREADY && !isloggedin()) {
$user = get_complete_user_data('username', $username);
$PAGE->navbar->add(get_string("alreadyconfirmed"));
$PAGE->set_title(get_string("alreadyconfirmed"));
@@ -61,11 +61,7 @@ if ($confirmed == AUTH_CONFIRM_ALREADY) {
throw new \moodle_exception('cannotfinduser', '', '', s($username));
}
if (!$user->suspended) {
complete_user_login($user);
\core\session\manager::apply_concurrent_login_limit($user->id, session_id());
if ($user->id == $USER->id) {
// Check where to go, $redirect has a higher preference.
if (empty($redirect) and !empty($SESSION->wantsurl) ) {
$redirect = $SESSION->wantsurl;
@@ -82,14 +78,20 @@ if ($confirmed == AUTH_CONFIRM_ALREADY) {
$PAGE->set_heading($COURSE->fullname);
echo $OUTPUT->header();
echo $OUTPUT->box_start('generalbox centerpara boxwidthnormal boxaligncenter');
echo "<h3>".get_string("thanks").", ". fullname($USER) . "</h3>\n";
echo "<h3>".get_string("thanks").", ". fullname($user) . "</h3>\n";
echo "<p>".get_string("confirmed")."</p>\n";
echo $OUTPUT->single_button("$CFG->wwwroot/course/", get_string('courses'));
if (!isloggedin() || isguestuser()) {
echo $OUTPUT->single_button(get_login_url(), get_string('login'));
} else {
echo $OUTPUT->single_button("$CFG->wwwroot/login/logout.php", get_string('logout'));
}
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
exit;
} else {
\core\notification::error(get_string('confirmationinvalid', 'auth_oauth2'));
if (!isloggedin()) {
\core\notification::error(get_string('confirmationinvalid', 'auth_oauth2'));
}
}
redirect("$CFG->wwwroot/");

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