Compare commits

...

524 Commits

Author SHA1 Message Date
Sara Arjona 9ce2442ea9 Moodle release 3.8.2 2020-03-06 12:34:11 +01:00
AMOS bot 9044d294a2 Automatically generated installer lang files 2020-03-06 00:10:50 +00:00
Sara Arjona cd9828dadf weekly release 3.8.1+ 2020-03-05 17:31:32 +01:00
Sara Arjona 28f2858004 Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2020-03-05 17:31:28 +01:00
Michael Hawkins 941507e78a MDL-67861 core: Fix getremoteaddr unit test to match new proxy setup 2020-03-05 14:39:34 +08:00
Brendan Heywood 1954482cc5 MDL-67861 core: Added $CFG->reverseproxyignore IP subnet list
If your server is behind multiple reverse proxies that append to the
X-Forwarded-For header then you will need to specify a comma separated
list of ip addresses or subnets of the reverse proxies to be ignored
in order to find the users correct IP address.
2020-03-05 01:27:57 +01:00
Brendan Heywood 7d8096eb18 MDL-67861 libraries: Refactor is_ip_in_subnet_list in ip_utils 2020-03-05 01:27:57 +01:00
Brendan Heywood 1cf6629ba2 MDL-67861 admin: Default $CFG->getremoteaddrconf to only use REMOTE_ADDR 2020-03-05 01:27:57 +01:00
Brendan Heywood d403416579 MDL-67861 core: Use last ip in X-Forwarded-For list 2020-03-05 01:27:57 +01:00
Andrew Nicols 9d23ee9003 MDL-65106 theme_classic: Remove unused variable 2020-03-05 08:15:54 +08:00
Andrew Nicols c706dd09a3 Merge branch 'MDL-65106-38' of git://github.com/bmbrands/moodle into MOODLE_38_STABLE 2020-03-05 08:15:48 +08:00
Eloy Lafuente (stronk7) 563931d924 Merge branch 'MDL-62768-38' of https://github.com/paulholden/moodle into MOODLE_38_STABLE 2020-03-04 18:37:17 +01:00
Sara Arjona a552c30018 Merge branch 'MDL-67696-MOODLE_38_STABLE_count_warning' of https://github.com/JayChurchward/moodle into MOODLE_38_STABLE 2020-03-04 17:55:48 +01:00
Sara Arjona 2f7e2ff457 Merge branch 'MDL-67767-38' of git://github.com/dpalou/moodle into MOODLE_38_STABLE 2020-03-04 15:04:58 +01:00
Dani Palou 714a816050 MDL-67767 tool_mobile: Allow using more characters in forcedurlscheme 2020-03-04 14:22:54 +01:00
Sara Arjona e490f86d57 Merge branch 'MDL-67863-38' of git://github.com/bmbrands/moodle into MOODLE_38_STABLE 2020-03-04 14:05:29 +01:00
Sara Arjona eccde3bc19 Merge branch 'MDL-67969-38' of git://github.com/rezaies/moodle into MOODLE_38_STABLE 2020-03-04 12:58:17 +01:00
Marina Glancy 4c16eba0b5 MDL-56287 gradereport_history: Separate groups queries improved 2020-03-04 11:47:19 +01:00
Jun Pataleta ec7ce8f204 MDL-56287 gradereport_history: Show users from groups that can be viewed 2020-03-04 11:47:19 +01:00
Eloy Lafuente (stronk7) 47f96d5e9f Merge branch 'MDL-67641-38' of git://github.com/dpalou/moodle into MOODLE_38_STABLE 2020-03-04 10:47:55 +01:00
Sara Arjona be47691d79 Merge branch 'MDL-68008-38' of git://github.com/ferranrecio/moodle into MOODLE_38_STABLE 2020-03-04 08:41:30 +01:00
Dani Palou 235f139992 MDL-67641 auth: Fix shortname type in get_signup_settings WS 2020-03-04 08:12:04 +01:00
AMOS bot e10cf2368a Automatically generated installer lang files 2020-03-04 00:11:12 +00:00
Eloy Lafuente (stronk7) 7bda43ee60 Merge branch 'MDL-67728-38' of git://github.com/crazyserver/moodle into MOODLE_38_STABLE 2020-03-03 19:50:17 +01:00
Eloy Lafuente (stronk7) 28298a6fe9 Merge branch 'MDL-68038-38' of git://github.com/sarjona/moodle into MOODLE_38_STABLE 2020-03-03 19:45:15 +01:00
Eloy Lafuente (stronk7) ddaee0c87d Merge branch 'MDL-67971-38' of git://github.com/sarjona/moodle into MOODLE_38_STABLE 2020-03-03 19:02:30 +01:00
Sara Arjona 9515f40ced Merge branch 'MDL-67993-38' of git://github.com/lameze/moodle into MOODLE_38_STABLE 2020-03-03 18:06:37 +01:00
Ferran Recio 7949aaceae MDL-68008 tool_capability: shows multiple contexts when overrides exists 2020-03-03 17:51:27 +01:00
Sara Arjona 305807d27b Merge branch 'MDL-68048-38-behatnotfound' of git://github.com/mudrd8mz/moodle into MOODLE_38_STABLE 2020-03-03 17:01:44 +01:00
Sara Arjona 845c943d7f Merge branch 'MDL-68060-38-huburlcompare' of git://github.com/mudrd8mz/moodle into MOODLE_38_STABLE 2020-03-03 13:10:13 +01:00
Sara Arjona 007ab3cf17 Merge branch 'MDL-67891-38' of https://github.com/paulholden/moodle into MOODLE_38_STABLE 2020-03-03 12:48:24 +01:00
Bas Brands 8540968781 MDL-65106 theme_classic: set custom navigationitem icon 2020-03-03 11:53:41 +01:00
Sara Arjona 8bf66cf2d3 Merge branch 'MDL-63316-38' of https://github.com/azito122/moodle into MOODLE_38_STABLE 2020-03-03 11:10:46 +01:00
Sara Arjona e0ba5fb608 Merge branch 'MDL-67945-38' of git://github.com/ferranrecio/moodle into MOODLE_38_STABLE 2020-03-03 10:10:45 +01:00
Sara Arjona 3687eb52a0 Merge branch 'MDL-67749-38' of git://github.com/dpalou/moodle into MOODLE_38_STABLE 2020-03-03 09:30:21 +01:00
Adrian Hutchinson 80f4ad43b8 MDL-67988 mod_lti: remove padding from JWS base64url encoding 2020-03-02 14:01:05 +01:00
Paul Holden 9da23023af MDL-67891 tool_cohortroles: move upgrade step inside plugin.
The step added in MDL-67458 was added to core, which broke the upgrade
process if this plugin had been uninstalled prior.
2020-03-02 08:50:35 +00:00
Sara Arjona caf37336d2 MDL-67971 core_badges: review issuer URL 2020-03-02 08:02:31 +01:00
Sara Arjona b3eb933a40 MDL-68038 core_h5p: rename can_update_library test 2020-03-02 08:00:54 +01:00
Andrew Zito b7fe18eb8b MDL-63316 participants: lastname sort for participants table 2020-02-28 14:34:01 -05:00
Eloy Lafuente (stronk7) b4a13e9a65 weekly release 3.8.1+ 2020-02-28 12:22:42 +01:00
Bas Brands 324d931ed0 MDL-67863 theme_boost: change keyboard tab order
Move navdrawer up in the dom for a more logical tab order
Hide navdrawer links for tab / screenreader when navdrawer is closed
2020-02-27 17:11:45 +01:00
Eloy Lafuente (stronk7) c2a1fb945e Merge branch 'MDL-67865-38' of git://github.com/rezaies/moodle into MOODLE_38_STABLE 2020-02-26 23:37:00 +01:00
Eloy Lafuente (stronk7) 9adfd8ccd5 Merge branch 'MDL-64686-38' of git://github.com/lucaboesch/moodle into MOODLE_38_STABLE 2020-02-26 23:27:29 +01:00
Eloy Lafuente (stronk7) 779f58b227 Merge branch 'MDL-67758-38' of git://github.com/dpalou/moodle into MOODLE_38_STABLE 2020-02-26 17:35:55 +01:00
Eloy Lafuente (stronk7) a4a667ab06 Merge branch 'MDL-67132-MOODLE_38' of https://github.com/cengage/moodle into MOODLE_38_STABLE
(amended to move the upgrade.txt info to correct 3.8.2)
2020-02-26 17:18:15 +01:00
Eloy Lafuente (stronk7) fc7e263912 Merge branch 'MDL-67979-38-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_38_STABLE 2020-02-26 17:13:37 +01:00
Anthony Forth c47d17b93b MDL-67945 enrol: missing $DB in edit_instance_form 2020-02-26 16:34:38 +01:00
David Mudrák 5aea4d98cb MDL-68060 registration: Improve the sites directory location check
This allows to define the custom HUB_MOODLEORGHUBURL with HTTP Basic
Auth credentials so that the registration features can be tested against
our staging site.
2020-02-26 10:56:05 +01:00
Jun Pataleta b6970abb18 Merge branch 'MDL-67921-38' of git://github.com/sarjona/moodle into MOODLE_38_STABLE 2020-02-26 16:51:12 +08:00
Jun Pataleta d2b37ff747 Merge branch 'MOODLE_38_MDL-67980' of https://github.com/golenkovm/moodle into MOODLE_38_STABLE 2020-02-26 14:30:40 +08:00
David Balch 75d4b0f949 MDL-67993 roles: Fix pix_icon() calls. 2020-02-26 12:15:31 +08:00
Claude Vervoort d2c96c5be9 MDL-67132 mod_lti: document new param 2020-02-25 21:24:36 -05:00
Eloy Lafuente (stronk7) 80509c0cdd Merge branch 'MDL-67644-38' of git://github.com/dpalou/moodle into MOODLE_38_STABLE 2020-02-26 00:10:13 +01:00
Eloy Lafuente (stronk7) 2de3eefda5 Merge branch 'MDL-67806-38' of git://github.com/dpalou/moodle into MOODLE_38_STABLE 2020-02-25 23:57:55 +01:00
Eloy Lafuente (stronk7) 5d83769d27 Merge branch 'MDL-67237-38' of git://github.com/dpalou/moodle into MOODLE_38_STABLE 2020-02-25 23:53:28 +01:00
Eloy Lafuente (stronk7) 341a509763 Merge branch 'MDL-67920-38' of git://github.com/aanabit/moodle into MOODLE_38_STABLE 2020-02-25 23:33:39 +01:00
Paul Holden 0111c671e4 MDL-62768 tool_policy: add page title & breadcrumb navigation. 2020-02-25 22:05:56 +00:00
Paul Holden a8df356e33 MDL-62768 tool_dataprivacy: add page breadcrumbs to navigation. 2020-02-25 21:37:56 +00:00
Helen Foster 69935b2021 MDL-67979 lang: Import fixed English strings (en_fix)
* configcustommenuitems,core_admin - corrected example
* custommenuitems_desc,tool_mobile - fallback behaviour of custom menu
  items in the app
2020-02-25 12:23:36 +01:00
Eloy Lafuente (stronk7) b424d7956e Merge branch 'MDL-67862-38' of git://github.com/junpataleta/moodle into MOODLE_38_STABLE 2020-02-25 12:09:48 +01:00
Eloy Lafuente (stronk7) 34a98290d2 Merge branch 'MDL-67364-38' of git://github.com/mickhawkins/moodle into MOODLE_38_STABLE 2020-02-25 12:05:48 +01:00
David Mudrák 706e99c6d4 MDL-68048 behat: Fix the ElementNotFoundException message wording
The exception class itself adds the "not found" to the error message.
2020-02-25 11:55:57 +01:00
Mikhail Golenkov 3d20910e88 MDL-67980 tasks: Sort ad-hoc tasks by nextruntime. 2020-02-24 09:32:37 +11:00
Pau Ferrer Ocaña 7d623c4a45 MDL-67728 behat: Increase app start timeout 2020-02-21 12:46:04 +01:00
Pau Ferrer Ocaña 1c447dcc44 MDL-67728 behat: Improve behat app selectors 2020-02-21 12:46:04 +01:00
Sara Arjona ae778f4193 MDL-67921 core_h5p: re-implement framework->getOption
The implementation done for getOption was not correct because it
was only taking into account the displayoptions for download and
embed.
Besides, setOption implementation has been added.
2020-02-21 09:29:29 +01:00
Amaia Anabitarte c1fbab8a81 MDL-67920 core_h5p: Move upload button into form and fix title
Minor bugs in Site administration > H5P > Manage H5P content types admin page'
2020-02-21 09:00:16 +01:00
Luca Bösch 26143b5d62 MDL-64686 theme: align course search form for small screens sizes. 2020-02-21 06:36:40 +01:00
Jun Pataleta 7b37466710 weekly release 3.8.1+ 2020-02-21 11:04:05 +08:00
Jun Pataleta 09f6b75f70 Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2020-02-21 11:03:25 +08:00
Eloy Lafuente (stronk7) cd0e753519 Merge branch 'MDL-67727-38' of git://github.com/crazyserver/moodle into MOODLE_38_STABLE 2020-02-20 16:12:48 +01:00
Eloy Lafuente (stronk7) 4d951d4bac Merge branch 'MDL-67899-38' of git://github.com/rezaies/moodle into MOODLE_38_STABLE 2020-02-20 00:41:29 +01:00
Luke Tucker 421537407d MDL-50455: tool_capability: Use static cache when loading context data 2020-02-20 00:29:32 +01:00
Eloy Lafuente (stronk7) 61f6f15177 Merge branch 'MDL-67942-38' of https://github.com/HuongNV13/moodle into MOODLE_38_STABLE 2020-02-19 19:18:44 +01:00
Eloy Lafuente (stronk7) 11a4df56f8 Merge branch 'MDL-67947_38' of https://github.com/timhunt/moodle into MOODLE_38_STABLE 2020-02-19 17:48:26 +01:00
Tim Hunt 7bde84a705 MDL-67947 questions: questions_in_use should ask all components
Previously it was only checking mods.
2020-02-19 11:58:12 +00:00
Dani Palou 4d4b22da05 MDL-67749 ws: Set private token when reset or manual create token 2020-02-19 12:04:57 +01:00
Shamim Rezaie 85a43994ca MDL-67969 lib: Fix duplicate blockinstanceid for fake blocks 2020-02-19 21:25:47 +11:00
Huong Nguyen fcf3d8b748 MDL-67942 Quiz: Quiz attempt report delete_selected_attempts issue 2020-02-19 15:35:55 +07:00
Eloy Lafuente (stronk7) 663cdc54fe Merge branch 'MDL-67471_38' of https://github.com/t-schroeder/moodle into MOODLE_38_STABLE 2020-02-18 23:54:44 +01:00
Eloy Lafuente (stronk7) 4eeb89d0a7 Merge branch 'MDL-61390-38' of git://github.com/junpataleta/moodle into MOODLE_38_STABLE 2020-02-18 19:06:51 +01:00
Eloy Lafuente (stronk7) b6aae0fc5b Merge branch 'MDL-67953-38' of git://github.com/andrewnicols/moodle into MOODLE_38_STABLE 2020-02-18 17:18:58 +01:00
Shamim Rezaie 68a3863961 MDL-67865 output: Fix id of the dropdown trigger 2020-02-18 16:19:17 +11:00
Eloy Lafuente (stronk7) 7e17a2a4fc Merge branch 'MDL-61389-38' of git://github.com/junpataleta/moodle into MOODLE_38_STABLE 2020-02-17 23:30:08 +01:00
Eloy Lafuente (stronk7) bb6281a5c9 Merge branch 'MDL-67817-m38-master' of https://github.com/dthies/moodle into MOODLE_38_STABLE 2020-02-17 22:09:05 +01:00
Tim Schroeder 4745203bc0 MDL-67471 message: fixed mark_notification_read with messaging disabled 2020-02-17 09:16:13 +01:00
Jun Pataleta f1dd21a3c7 MDL-61390 mod_forum: Create template for forum search results 2020-02-17 15:58:04 +08:00
Jun Pataleta 4d90df63d2 MDL-61389 mod_forum: Descriptive aria-label for "Discuss this topic" 2020-02-17 15:52:06 +08:00
AMOS bot 37397ed119 Automatically generated installer lang files 2020-02-16 00:11:11 +00:00
Daniel Thies b9792633c9 MDL-67817 core_date: Add test for timezone localization strings 2020-02-14 11:56:33 -06:00
Daniel Thies f5677dadeb MDL-67817 core_lang: Update timezone strings 2020-02-14 11:56:33 -06:00
Sara Arjona 199ff6cc6b weekly release 3.8.1+ 2020-02-14 12:12:12 +01:00
Sara Arjona 462002f1ec Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2020-02-14 12:12:10 +01:00
Jun Pataleta 7fdcd5cb4d Merge branch 'MDL-67965-38' of git://github.com/andrewnicols/moodle into MOODLE_38_STABLE 2020-02-14 13:25:10 +08:00
Andrew Nicols ca63a87509 MDL-67965 behat: Get theme-specific context classes correctly 2020-02-14 10:15:49 +08:00
Claude Vervoort 1fde9dea67 MDL-67132 mod_lti: call grade api to trigger course total computation 2020-02-13 18:45:05 -05:00
Michael Hawkins 2359ec14f7 MDL-67364 output: Add unit testing for editor_scss_to_css 2020-02-13 22:53:19 +08:00
Michael Hawkins 999bb6578b MDL-67364 output: Allow child themes to use parent editor_scss config
This still allows child themes to override editor_scss, but will fall
back to what the parent is using if they do not specify it. This
negates the need for every child them to have the config duplicated
in order to utilise it.
2020-02-13 22:53:19 +08:00
Pau Ferrer Ocaña 71f62ad8ce MDL-67727 behat: Reset ionic app properly 2020-02-13 08:37:28 +01:00
Andrew Nicols 8ccb773f9b MDL-67953 grunt: Work around spawn length limits 2020-02-13 13:34:03 +08:00
Eloy Lafuente (stronk7) 84a6421857 Merge branch 'MDL-67876_38' of https://github.com/timhunt/moodle into MOODLE_38_STABLE 2020-02-12 15:51:17 +01:00
Dani Palou c3fc5fca65 MDL-67644 tool_mobile: Add OAuth 2 providers in disabled features 2020-02-12 14:13:17 +01:00
Tim Hunt bb9176eee4 MDL-67876 forms: not all field types need validation JS 2020-02-12 10:02:27 +00:00
Tim Hunt 5048dbbf06 MDL-67876 forms: scroll to any invalid element if form cannot submit 2020-02-12 10:01:24 +00:00
Shamim Rezaie a2d619941f MDL-67899 message: Add aria-label to the emoji picker button 2020-02-12 15:40:45 +11:00
Eloy Lafuente (stronk7) 5df69d28ad Merge branch 'MDL-67532-38' of https://github.com/paulholden/moodle into MOODLE_38_STABLE 2020-02-11 23:08:07 +01:00
Eloy Lafuente (stronk7) 95ecaf2d1e Merge branch 'MDL-67675-38' of git://github.com/rezaies/moodle into MOODLE_38_STABLE 2020-02-11 22:56:17 +01:00
Eloy Lafuente (stronk7) 13caf292eb Merge branch 'MDL-67690-38' of git://github.com/merrill-oakland/moodle into MOODLE_38_STABLE 2020-02-11 22:45:27 +01:00
Sara Arjona 1fae040842 Merge branch 'MDL-59303-38' of https://github.com/paulholden/moodle into MOODLE_38_STABLE 2020-02-11 13:52:29 +01:00
Sara Arjona 659795e8e8 Merge branch 'MDL-66847-38' of git://github.com/lucaboesch/moodle into MOODLE_38_STABLE 2020-02-11 12:28:46 +01:00
Sara Arjona 5e3aad0090 Merge branch 'MDL-66834-MOODLE_38_STABLE' of https://github.com/kepeter/moodle into MOODLE_38_STABLE 2020-02-11 11:54:22 +01:00
Sara Arjona 934e913a97 Merge branch 'mdl67142-moodle38' of https://github.com/AngadSethi/moodle into MOODLE_38_STABLE 2020-02-11 10:18:59 +01:00
Sara Arjona a10e70cf56 Merge branch 'MDL-67894-38' of https://github.com/grabs/moodle into MOODLE_38_STABLE 2020-02-11 08:20:38 +01:00
Dani Palou c618f24c70 MDL-67758 airnotifier: Send wwwroot to airnotifier 2020-02-10 11:55:51 +01:00
Jun Pataleta 90a3ce934e MDL-67862 message: Render dialogue header only when necessary 2020-02-10 13:12:35 +08:00
Angad Sethi 9dd517653c MDL-67142 quiz: fixed error when deleting saved questions long-name-quiz
An error was showing up while deleting questions
(in the question_save_from_deletion method) which had been saved
and which belonged to a quiz with a super long name, not exceeding 255
characters, as the 'name' field in 'question_categories' table had a
max size of 255 characters. The shorten_text function was used to
shorten the string to 255 characters and a unit test was added with
the name test_question_save_from_deletion_quiz_with_long_name to test
the patch.
2020-02-08 19:46:59 +05:30
AMOS bot 68b1fa37d5 Automatically generated installer lang files 2020-02-08 00:11:54 +00:00
Andreas Grabs df55da0a4b MDL-67894 mod_feedback: database error on show responses 2020-02-07 18:47:37 +01:00
Paul Holden f179253ab7 MDL-59303 auth_shibboleth: consistent readme URL. 2020-02-07 14:26:06 +00:00
Luca Bösch 82fa8144a5 MDL-66847 webservice: Correct breadcrumb + title for ws documentation. 2020-02-07 14:40:10 +01:00
Paul Holden 103c623b83 MDL-67532 badges: better default for new badge language. 2020-02-07 09:47:03 +00:00
Sara Arjona 9691980198 weekly release 3.8.1+ 2020-02-07 09:44:56 +01:00
Sara Arjona 3ae5f9ce0c Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2020-02-07 09:44:54 +01:00
Brendan Heywood 8973440f1f MDL-67726 tool_phpunit: add missing input escaping 2020-02-06 19:43:32 +01:00
Dani Palou 71b91e606b MDL-67237 tool_mobile: Add H5P offline option in disabled features 2020-02-06 11:34:10 +01:00
Andrew Nicols b079a267b4 Merge branch 'MDL-67175-38' of git://github.com/ferranrecio/moodle into MOODLE_38_STABLE 2020-02-06 10:20:54 +08:00
Eloy Lafuente (stronk7) 5016b08fcc Merge branch 'MDL-67832_38' of https://github.com/timhunt/moodle into MOODLE_38_STABLE
(fixed a couple of typos in the merge commit)
2020-02-06 00:02:25 +01:00
Eloy Lafuente (stronk7) c58d4d4591 Merge branch 'MDL-67732-38' of https://github.com/paulholden/moodle into MOODLE_38_STABLE 2020-02-05 20:05:41 +01:00
Eloy Lafuente (stronk7) ff3b9e1afa Merge branch 'MDL-67830_38' of https://github.com/timhunt/moodle into MOODLE_38_STABLE 2020-02-05 19:08:05 +01:00
Andrew Nicols 0d3c0e4377 Merge branch 'MDL-49103-38' of git://github.com/sarjona/moodle into MOODLE_38_STABLE 2020-02-05 13:51:15 +08:00
Eloy Lafuente (stronk7) 7005e1c999 Merge branch 'MDL-67842_38' of https://github.com/timhunt/moodle into MOODLE_38_STABLE 2020-02-04 22:46:24 +01:00
Eloy Lafuente (stronk7) bed550541b Merge branch 'MDL-63424-38' of git://github.com/lucaboesch/moodle into MOODLE_38_STABLE 2020-02-04 19:28:44 +01:00
Eloy Lafuente (stronk7) ca9ff05eba Merge branch 'MDL-66875-38' of git://github.com/lucaboesch/moodle into MOODLE_38_STABLE 2020-02-04 19:02:33 +01:00
Sara Arjona 2ff1e5d1fa MDL-49103 badges: bake badges with iTXt chunk instead of tEXt
The final OB 1.0 specification changed the baking badges method
from tEXt to iTXt. Besides, the iTXt chunk should be a signed
assertion or the raw JSON (instead of the assertion URL).
This has been changed in order to make Moodle OB compliant.

Yuliya Bozhko, thanks for the patch! :-)
2020-02-04 18:50:01 +01:00
Ferran Recio 5bd9eaaef0 MDL-67175 mod_scorm: fixing js eslint errors 2020-02-04 12:37:31 +01:00
Sam Hemelryk ede71aea73 MDL-67175 mod_scorm: sync XHR requests use sendBeacon when available
Totara reference TL-22621 (original code by Sam Hemelryk)
https://github.com/moodle/moodle/commit/2add402f8183c50bc1238ef2da5ea9cd06cb1dd9
2020-02-04 12:37:31 +01:00
Brendan Cox ab1939e5e6 MDL-67175 session: set SameSite=None for Chrome 78 and above
Totara reference TL-22311 (original code by Brendan Cox and Sam Hemelryk)
https://github.com/moodle/moodle/commit/a3f4de2b7efe66de6617a67ce7c87f2862e76ac6
2020-02-04 12:37:15 +01:00
Andrew Nicols 045d69a61d Merge branch 'MDL-60126-38-3' of git://github.com/mihailges/moodle into MOODLE_38_STABLE 2020-02-04 14:40:20 +08:00
Peter c6e2821be1 MDL-60126 competency: Unit tests 2020-02-04 08:51:50 +08:00
Simey Lameze 75c21efdea MDL-60126 core: upgrade step to clean user comp 2020-02-04 08:51:45 +08:00
Simey Lameze c852a0d308 MDL-60126 competency: delete content upon user delete 2020-02-04 08:40:25 +08:00
AMOS bot f722f3ef15 Automatically generated installer lang files 2020-02-04 00:11:15 +00:00
Sara Arjona e47f0220a6 Merge branch 'MDL-67721-38' of git://github.com/rezaies/moodle into MOODLE_38_STABLE 2020-02-03 14:52:30 +01:00
Sara Arjona 94e2bc3cac Merge branch 'MDL-67511-38' of git://github.com/andrewnicols/moodle into MOODLE_38_STABLE 2020-02-03 14:10:30 +01:00
Peter Eliyahu Kornfeld 90ae31ecb1 MDL-66834 Questions: add transaction, move trigger 2020-02-03 12:28:19 +02:00
Andrew Nicols feb32ff597 MDL-67511 core: Adjust spacing at top of toast-wrapper 2020-02-03 07:38:06 +08:00
Tim Hunt e5c2879063 MDL-67832 quiz: fix lots of PHPdoc in attemptlib.php 2020-01-31 19:09:28 +00:00
Paul Holden c3496f8599 MDL-67732 group: observe viewfullnames capability.
Backport from MDL-67245.
2020-01-31 16:48:08 +00:00
JayChurchward 7476acd514 MDL-67696 mod_forum: Changed invalid count() to loop counter. 2020-01-30 15:01:24 -05:00
Tim Hunt 8ad3593d0c MDL-67842 questions: Cannot remove the idnumber from a question 2020-01-30 17:29:23 +00:00
Eloy Lafuente (stronk7) 7f697f7a44 weekly release 3.8.1+ 2020-01-30 16:11:27 +01:00
Eloy Lafuente (stronk7) efcc2a7ac5 Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2020-01-30 16:11:24 +01:00
Jun Pataleta d2ba630385 Merge branch 'MDL-67353-38' of https://github.com/junpataleta/moodle into MOODLE_38_STABLE 2020-01-30 12:41:22 +08:00
Eloy Lafuente (stronk7) b2dfaa5d3a MDL-67353 course: move form tearDown() to reset_all_data()
We are already cleaning all sort of caches, statics, singletons
there and it's better to ensure they are always reset to avoid
myterious failures @ distance.
2020-01-30 12:41:04 +08:00
Eloy Lafuente (stronk7) ccb5136b94 MDL-67353 filters: fix filterlib tests
- move resetAfterTest() to test units.
- remove setUp(), moving code to remove_all_filters_from_config().
- remove class properties, moving to return values of own setup_xxx() methods.
2020-01-30 12:41:04 +08:00
Eloy Lafuente (stronk7) 89a4d27f34 MDL-67353 favourites: Random DB id matching solved
Depending on the tests executed it was possible to arrive
to favourites tests with 2 "concepts" (say userid and contextid,
or userid and itemid) having the same ID.

Then, the array_diff() operations used by some mock stuff in the
tests wrongly was returning matches by value, ultimately causing
the test to fail.

Now, the matching is performed using array_diff_assoc() that takes
keys into considation when performing the match.
2020-01-30 12:41:04 +08:00
Andrew Nicols b2e08b7caa MDL-67353 course: Fix more broken unit tests 2020-01-30 12:41:04 +08:00
Andrew Nicols a946a9aac6 MDL-67353 course: Fix broken unit test 2020-01-30 12:41:04 +08:00
Michelle Melton ad5a2c9b07 MDL-64169 course: fix padding when display on one section per page
(amended to keep the $o.= consistent with surrounding code)
2020-01-29 22:35:49 +01:00
Tim Hunt 54908ae907 MDL-67830 quiz: notice in grade details redirect script 2020-01-29 18:35:28 +00:00
Jun Pataleta 36d2a83aa6 Merge branch 'MDL-67626_38' of git://github.com/adpe/moodle into MOODLE_38_STABLE 2020-01-29 21:37:08 +08:00
Adrian Greeve e02fbba097 Merge branch 'MDL-67768-38-componentdirs' of git://github.com/mudrd8mz/moodle into MOODLE_38_STABLE 2020-01-29 10:02:58 +08:00
Eloy Lafuente (stronk7) d18b6693ad Merge branch 'MDL-67472-38' of git://github.com/bmbrands/moodle into MOODLE_38_STABLE 2020-01-28 22:57:37 +01:00
Eloy Lafuente (stronk7) 9b1e5ee508 Merge branch 'MDL-52189_38' of https://github.com/jonof/moodle into MOODLE_38_STABLE 2020-01-28 22:45:14 +01:00
Eloy Lafuente (stronk7) c11ad45a99 Merge branch 'MDL-67447-38-autocomplete' of git://github.com/mudrd8mz/moodle into MOODLE_38_STABLE 2020-01-28 22:24:31 +01:00
Eloy Lafuente (stronk7) c1ad1072da Merge branch 'MDL-67722-38' of git://github.com/mickhawkins/moodle into MOODLE_38_STABLE 2020-01-28 20:13:37 +01:00
David Mudrák 572c8c74cc MDL-67447 form: Fix the duplicate autocomplete selection node
When the autocomplete selection is updated, the content of the selection
wrapper is replaced with the new list of selected items. We must replace
only the content of the selection wrapper and not to nest it into
itself.
2020-01-28 19:52:29 +01:00
Shamim Rezaie 4a87ffb336 MDL-67675 atto_h5p: No need to manually clear the H5P placeholder 2020-01-28 22:30:37 +11:00
Eloy Lafuente (stronk7) 0419687a7f Merge branch 'MDL-57755_38' of https://github.com/t-schroeder/moodle into MOODLE_38_STABLE 2020-01-28 10:34:56 +01:00
David Mudrák d8cc1761f1 MDL-67768 core: Add some common dirs to core_component::$ignoreddirs
The core_component::$ignoreddirs lists all directories that are reserved
and cannot be used as valid plugin names. This is particularly important
for some plugin types such as 'webservice' that share the same root
location as the core subsystem of the same name.
2020-01-28 10:33:37 +01:00
Adrian Greeve 1ff0018969 Merge branch 'MDL-67740-38-behatstepsfilter' of git://github.com/mudrd8mz/moodle into MOODLE_38_STABLE 2020-01-28 15:07:56 +08:00
Adrian Greeve 557a351daf Merge branch 'MOODLE_38_MDL-67746' of https://github.com/golenkovm/moodle into MOODLE_38_STABLE 2020-01-28 13:13:45 +08:00
AMOS bot 916130a390 Automatically generated installer lang files 2020-01-28 00:11:42 +00:00
Adrian Greeve c3c3d12462 Merge branch 'MDL-67691_38' of https://github.com/stronk7/moodle into MOODLE_38_STABLE 2020-01-28 07:53:31 +08:00
Shamim Rezaie c385803441 MDL-67721 mod_forum: See 'view grade' button on single discussion forums 2020-01-28 05:03:12 +11:00
Eloy Lafuente (stronk7) 912ba0f5d0 Merge branch 'MDL-64531-38-questiondeletejson' of git://github.com/mudrd8mz/moodle into MOODLE_38_STABLE 2020-01-27 17:08:07 +01:00
Eloy Lafuente (stronk7) b25bd34adf Merge branch 'MDL-67577-38' of git://github.com/bmbrands/moodle into MOODLE_38_STABLE 2020-01-27 16:19:49 +01:00
Eloy Lafuente (stronk7) 7163df9a93 Merge branch 'm38_MDL-67414_Add_PostgreSQL_12x_Support' of https://github.com/scara/moodle into MOODLE_38_STABLE 2020-01-27 12:16:17 +01:00
Bas Brands 1719110c23 MDL-67577 core_message: navbar_output order
* moved the logic from core_message_popup_render_navbar_output to
message_popup_render_navbar_output in message/output/popup/lib.php

* using float: left instead of float: right in theme
2020-01-27 12:15:18 +01:00
Dani Palou bb0a08a7b4 MDL-67806 tool_mobile: Add Dark mode option in disabled features
We must allow site admins to remotely disable that feature in the app
2020-01-27 11:33:04 +01:00
Tim Schroeder c2f2919cf8 MDL-57755 message: fix notificaiton read status when messaging disabled 2020-01-27 09:18:28 +01:00
Matteo Scaramuccia ec2ea6c725 MDL-67414 adodb: Backport upstream fix for PostgreSQL 12.x
Upstream: https://github.com/ADOdb/ADOdb/commit/a4876f100602c2ce4760bb72d3050f73387adcca
          pgsql: stop using obsolete pg_attrdef.adsrc column
2020-01-26 09:40:22 +01:00
Matteo Scaramuccia 05a89b9b45 MDL-67414 database: Fixed PostgreSQL 12.x support 2020-01-26 09:40:21 +01:00
AMOS bot 5b90fa9f73 Automatically generated installer lang files 2020-01-25 00:11:41 +00:00
Luca Bösch a2841e3af6 MDL-66875 calendar: allow the use of day, mon and year again. 2020-01-25 01:01:54 +01:00
Luca Bösch de9c260296 MDL-63424 form: allow checkboxes to have req icon. 2020-01-24 17:38:20 +01:00
David Mudrák 2648ab76be MDL-67740 behat: Show info as collapsed at the acceptance testing page
The static information with the links to Behat documentation is quite
long an irrelevant for experienced developers returning to this page. No
need to waste the prominent screen place with it - better to offer it
only when needed via collapsible form section.
2020-01-24 10:44:37 +01:00
David Mudrák aa9f7001da MDL-67740 behat: Improve the layout of the acceptance testing page
- The CSS contains more specific selectors.
- Make use of the whole screen width for the list of found steps.
- Visually distinguish found steps from each other.
- Make it look less like a unicorn rainbow.
2020-01-24 10:44:37 +01:00
David Mudrák 5013ed92a2 MDL-67740 behat: Fix the name of the class in the inline documentation
The said class is provided by the moodlehq/behat-extension composer
package and was renamed as a part of upgrade to Behat 3.0.x (MDL-46891).
2020-01-24 10:44:37 +01:00
David Mudrák c538c5a1a3 MDL-67740 behat: Allow multiple words filter at acceptance testing page
Because of the too strict input param type, the form did not allow to
search for Behat steps containing the given phrase. The patch sets the
param type to match the one in the form definition, and makes sure that
the submitted value can be safely used as a CLI script argument.
2020-01-24 10:44:37 +01:00
Mikhail Golenkov 2cb5e23006 MDL-67746 Tasks: Cleanup task logs in chunks. 2020-01-24 14:03:48 +11:00
Adrian Greeve 85a035b1c5 weekly release 3.8.1+ 2020-01-24 10:17:40 +08:00
Adrian Greeve 1f3bc3164e Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2020-01-24 10:17:30 +08:00
Eric Merrill 7bfcb01b81 MDL-67690 block_myoverview: Clean usage of starred vs favourites
The block accidentally mixes usage of starred vs favourites, but core
requires favourites. This fixes the issue of user settings remembering
the correct value without a more major work.
2020-01-23 15:22:02 -05:00
Eloy Lafuente (stronk7) 2abbcb4761 Merge branch 'MDL-51225-38' of git://github.com/junpataleta/moodle into MOODLE_38_STABLE 2020-01-23 11:14:12 +01:00
Jun Pataleta 9afa3fc326 MDL-51225 mod_forum: Revert @javascript tag removal
Put back the removed  @javascript tag to prevent random goutte
fails.
2020-01-23 15:30:36 +08:00
Jun Pataleta b4466151b0 Merge branch 'MDL-67118_38' of https://github.com/stronk7/moodle into MOODLE_38_STABLE 2020-01-23 12:55:28 +08:00
Jun Pataleta e4ae433b3b Merge branch 'MDL-67115_38' of https://github.com/stronk7/moodle into MOODLE_38_STABLE 2020-01-23 11:40:57 +08:00
Jun Pataleta 7c7932aaa5 Merge branch 'MDL-65952_m38' of https://github.com/fabiendallet/moodle into MOODLE_38_STABLE 2020-01-23 10:43:41 +08:00
Eloy Lafuente (stronk7) 5977f2fc3d Merge branch 'MDL-67296-38' of git://github.com/vmdef/moodle into MOODLE_38_STABLE 2020-01-22 23:46:18 +01:00
Víctor Déniz Falcón f7355ebc2c MDL-67296 core_h5p: tests modified to use exttests 2020-01-22 20:41:23 +00:00
Víctor Déniz Falcón b80d4a6b26 MDL-67296 core_h5p: minor changes
core.php-Avoid to use the factory for each content type
h5p_get_content_types_task-new method to simplify test execution
framework.php-returns error if you get a 404 response after requesting a file
2020-01-22 18:56:38 +00:00
Jun Pataleta c4e6d74577 Merge branch 'MDL-66897-38-1' of git://github.com/mihailges/moodle into MOODLE_38_STABLE 2020-01-22 23:17:05 +08:00
Mihail Geshoski ac32e20ada MDL-66897 mod_assign: Properly display error messages in quick grading 2020-01-22 14:02:59 +08:00
Adrian Greeve 37821e0918 Merge branch 'MDL-67424-38' of git://github.com/rezaies/moodle into MOODLE_38_STABLE 2020-01-22 13:57:53 +08:00
Adrian Greeve b1e2c36330 Merge branch 'MDL-67653_38' of https://github.com/timhunt/moodle into MOODLE_38_STABLE 2020-01-22 11:04:09 +08:00
Adrian Greeve 4ea5ab220a Merge branch 'MDL-67660-38-v2' of https://github.com/TobiGa/moodle into MOODLE_38_STABLE 2020-01-22 10:42:24 +08:00
Jun Pataleta f2955fae89 Merge branch 'MDL-67684-38' of git://github.com/andrewnicols/moodle into MOODLE_38_STABLE 2020-01-22 10:38:02 +08:00
Adrian Greeve 0206502461 Merge branch 'MDL-67680-38' of git://github.com/marinaglancy/moodle into MOODLE_38_STABLE 2020-01-22 10:30:05 +08:00
Colin Campbell b4779307a2 MDL-52189 file: skip deleting temp files that appear during cleanup 2020-01-22 12:09:50 +10:00
Adrian Greeve 4ff40b48e7 Merge branch 'MDL-67656-38' of git://github.com/andrewnicols/moodle into MOODLE_38_STABLE 2020-01-22 09:45:58 +08:00
Eloy Lafuente (stronk7) 830ef192ad Merge branch 'MDL-66858_38' of https://github.com/stronk7/moodle into MOODLE_38_STABLE 2020-01-22 01:57:28 +01:00
Michael Milette 8b466d2803 MDL-66858 master: Enable <header> tags in Atto editor.
(amended to add the src/editor/js/clean.js
file that was originally missing)
2020-01-22 00:06:14 +01:00
Eloy Lafuente (stronk7) bd290493b1 Merge branch 'MDL-51225-38' of git://github.com/junpataleta/moodle into MOODLE_38_STABLE 2020-01-21 23:40:16 +01:00
Adrian Greeve 6e6b973f0a Merge branch 'MDL-66237-38' of git://github.com/mickhawkins/moodle into MOODLE_38_STABLE 2020-01-21 11:20:32 +08:00
Jun Pataleta 43b39b0ce9 Merge branch 'MDL-66108-38' of https://github.com/paulholden/moodle into MOODLE_38_STABLE 2020-01-21 09:50:56 +08:00
Eloy Lafuente (stronk7) 7523e0c352 Merge branch 'MDL-66024-38' of https://github.com/paulholden/moodle into MOODLE_38_STABLE 2020-01-20 22:48:27 +01:00
Eloy Lafuente (stronk7) 77234ad1ef Merge branch 'MDL-66220-38' of git://github.com/junpataleta/moodle into MOODLE_38_STABLE 2020-01-20 22:34:17 +01:00
Eloy Lafuente (stronk7) 132809e8ff Merge branch 'MDL-66712-38-selfautounenrol' of git://github.com/mudrd8mz/moodle into MOODLE_38_STABLE 2020-01-20 22:29:00 +01:00
Paul Holden e53dadd3a1 MDL-65884 filters: update exclusive separator characters for tags.
The previous characters mangled the output of filtered text, exhibited
in the activity names filter for activities named '-' (single hyphen).
2020-01-20 20:55:34 +01:00
David Mudrák 7b6f691f3d MDL-64531 course: Add Behat test for deleting a quiz with own questions
Teachers can delete Quiz activities that have a question in their own
context via AJAX request with the course recycle bin disabled. This used
to lead to "Unexpected token < in JSON" because of the extra HTML in the
output.
2020-01-20 18:20:27 +01:00
Tim Hunt 596cbeb955 MDL-64531 course: course_delete_module shouldn't output during AJAX
Committer's note: This change was originally part of a bigger patchset
submitted by the author. This is a stripped-down version that does not
use phpunit tests for the new behaviour.
2020-01-20 18:07:17 +01:00
Eloy Lafuente (stronk7) 4a617ad4c6 Merge branch 'MDL-67724-38' of git://github.com/junpataleta/moodle into MOODLE_38_STABLE 2020-01-20 10:53:28 +01:00
Sara Arjona 9ef53aba3a Merge branch 'MDL-67312-38' of git://github.com/lameze/moodle into MOODLE_38_STABLE 2020-01-20 08:03:52 +01:00
Adrian Greeve 288d4fc575 Merge branch 'MDL-66761-38' of git://github.com/mickhawkins/moodle into MOODLE_38_STABLE 2020-01-20 14:47:30 +08:00
Adrian Greeve 68fd5cfaf4 Merge branch 'MDL-67583-38' of https://github.com/KietChan/moodle into MOODLE_38_STABLE 2020-01-20 13:38:14 +08:00
Simey Lameze df6160f8a1 MDL-67312 core_user: clean subs events on user deletion 2020-01-20 08:50:55 +08:00
Simey Lameze 7434f3abf3 MDL-67312 calendar: upgrade step to delete orphaned events 2020-01-20 08:50:51 +08:00
Simey Lameze abaf1375c1 MDL-67312 core: change db upgrade step to use get_fieldset_sql 2020-01-20 08:47:34 +08:00
Eloy Lafuente (stronk7) 646e72349d MDL-67691 behat: inform about the_following_exist() removal
behat_data_generators::the_following_exist() has been removed, please use
behat_data_generators::the_following_entities_exist() instead.

See MDL-67691 for more info.
2020-01-20 00:11:57 +01:00
Eloy Lafuente (stronk7) 7781e1e2bf MDL-67115 google: php74 params order for implode()
Passing parameters to implode() in reverse order is deprecated, use
implode($glue, $parts) instead of implode($parts, $glue).

This commit corresponds to general search of wrong cases.
2020-01-19 18:49:24 +01:00
Eloy Lafuente (stronk7) 41f06cfc92 MDL-67115 htmlpurifier: php74 params order for implode()
Passing parameters to implode() in reverse order is deprecated, use
implode($glue, $parts) instead of implode($parts, $glue).

This commit corresponds to general search of wrong cases.
2020-01-19 18:49:24 +01:00
Eloy Lafuente (stronk7) 903428a532 MDL-67115 minify: php74 params order for implode()/join()
Passing parameters to implode() in reverse order is deprecated, use
implode($glue, $parts) instead of implode($parts, $glue).

This commit corresponds to phpunit detections, minify library.
2020-01-19 18:49:23 +01:00
Eloy Lafuente (stronk7) 20c78476a3 MDL-67115 core: php74 params order for implode()/join()
Passing parameters to implode() in reverse order is deprecated, use
implode($glue, $parts) instead of implode($parts, $glue).

This commit corresponds to phpunit and manual detections, core files.
2020-01-19 18:49:23 +01:00
Adrian Perez 63b7cd9927 MDL-67626 assign: fix view full/view summary control in IE 2020-01-18 14:16:07 +01:00
AMOS bot dc89ea0e88 Automatically generated installer lang files 2020-01-18 00:10:49 +00:00
fdallet 52136af780 MDL-65952 mod_scorm: Fix unwanted changes to require status 2020-01-17 17:29:36 +01:00
Paul Holden 7b0a8e09c0 MDL-66108 course: fix false positives when bulk moving categories. 2020-01-17 16:19:17 +00:00
Jun Pataleta 13a34d0aa7 MDL-67724 mod_glossary: Improve Behat test
Improve the "Glossary entries are not always editable" scenario by:
* No need to use the @javascript tag
* The maxediting time can be set to a lower value to
reduce the overall wait time.
2020-01-17 17:50:11 +08:00
Tobias Garske a6a79e25f4 MDL-67660 core_message: Messages search change input focus 2020-01-17 09:40:18 +01:00
Michael Hawkins 511dc1cd96 MDL-67722 mod_forum: Reduce wait time on time limit expires behat test 2020-01-17 15:46:45 +08:00
Jun Pataleta df7cacee50 MDL-51225 mod_forum: Use can_view_post to determine whether to show post
Use \mod_forum\local\managers\capability::can_view_post() to
consistently determine whether a forum post will be rendered in the
recent activity block.
This helps the recent activity block to provide a more consistent
behaviour with the forum's discussion view itself.
2020-01-17 14:45:50 +08:00
Jun Pataleta 994ec1690d MDL-51225 mod_forum: Create behat tests for forum recent activity 2020-01-17 14:45:50 +08:00
Jun Pataleta b92880fd4a MDL-51225 mod_forum: New behat step for creating question discussion 2020-01-17 14:45:50 +08:00
Michael Hawkins 27557f1a55 MDL-66761 forumreport_summary: Added groups filter behat testing 2020-01-17 10:35:37 +08:00
Michael Hawkins 58c1af595e MDL-66761 mod_forum: Behat support group ID in bulk discussion adding 2020-01-17 10:35:37 +08:00
AMOS bot 4c495c2aa3 Automatically generated installer lang files 2020-01-17 00:12:19 +00:00
Eloy Lafuente (stronk7) 86362a7fb2 MDL-67118 enrol_ldap: add pagesize/subcontexts provider
With that provider we'll be explicitly checking that any
pagesize and subcontexts search is returning results consistently
so the internal paging/servercontrols work as expected.
2020-01-16 19:16:21 +01:00
Eloy Lafuente (stronk7) f8b9cc01c3 MDL-67118 enrol_ldap: paged results functions deprecated php74 and up
Starting with php74 the following functions are deprecated:
- ldap_control_paged_result()
- ldap_control_paged_result_response()

Starting with php73, ldap servercontrols were included. One of those
servercontrols, LDAP_CONTROL_PAGEDRESULTS, is the one in charge of
controlling paged results.

So, we are going to add some conditional code here:

1) if php < 7.3, use old paged result functions.
2) if php >= 7.3, switch to LDAP_CONTROL_PAGEDRESULTS servercontrol.

With a TODO about removing 1) in Moodle 4.1, once php73 becomes required.
2020-01-16 19:16:21 +01:00
Eloy Lafuente (stronk7) 19e3cdbad9 MDL-67118 auth_ldap: add pagesize/subcontexts test provider
With that provider we'll be explicitly covering that any
pagesize and subcontexts search is returning results consistently
so the internal paging/servercontrols work as expected.
2020-01-16 19:16:21 +01:00
Eloy Lafuente (stronk7) bcf7349371 MDL-67118 auth_ldap: paged results functions deprecated php74 and up
Starting with php74 the following functions are deprecated:
- ldap_control_paged_result()
- ldap_control_paged_result_response()

Starting with php73, ldap servercontrols were included. One of those
servercontrols, LDAP_CONTROL_PAGEDRESULTS, is the one in charge of
controlling paged results.

So, we are going to add some conditional code here:

1) if php < 7.3, use old paged result functions.
2) if php >= 7.3, switch to LDAP_CONTROL_PAGEDRESULTS servercontrol.

With a TODO about removing 1) in Moodle 4.1, once php73 becomes required.
2020-01-16 19:16:21 +01:00
Sara Arjona 36984d4d1d weekly release 3.8.1+ 2020-01-16 17:19:21 +01:00
Sara Arjona bcb56b9071 Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2020-01-16 17:19:19 +01:00
David Mudrák 82505a878b MDL-66712 enrol: Fix the reported days of inactivity on unenrolment
There were two problems here. Firstly, the $days was not correctly
calculated due to missing parentheses. Secondly, the sentence had
grammar issues.
2020-01-16 13:44:22 +01:00
Jun Pataleta 8e45839933 MDL-66220 mod_forum: Prevent from replying to a post the user can't see 2020-01-16 15:06:11 +08:00
Jun Pataleta e1eea0cf36 MDL-66220 mod_forum: Cache result of forum_user_can_see_post()
* Cache the result of this function to avoid doing multiple DB calls
for the same post when loading posts in a discussion.
2020-01-16 15:06:11 +08:00
Jun Pataleta cf32c9116b MDL-66220 mod_forum: Additional unit test for can_reply_to_post 2020-01-16 15:06:11 +08:00
Andrew Nicols cdf31c3d57 Merge branch 'wip-MDL-66918-38stable' of https://github.com/Beedell/moodle into MOODLE_38_STABLE 2020-01-16 11:43:18 +08:00
Eloy Lafuente (stronk7) 0c01f98410 Merge branch 'MDL-67625-38' of git://github.com/lucaboesch/moodle into MOODLE_38_STABLE 2020-01-16 00:26:57 +01:00
Sara Arjona e7721e50c6 Merge branch 'MDL-67379-38' of git://github.com/rezaies/moodle into MOODLE_38_STABLE 2020-01-15 22:12:41 +01:00
Eloy Lafuente (stronk7) 8f112b1064 Merge branch 'MDL-67622_38' of git://github.com/dmonllao/moodle into MOODLE_38_STABLE 2020-01-15 18:55:55 +01:00
Shamim Rezaie 65fcabe132 MDL-67424 mod_forum: error on complete report when no rating or grade 2020-01-16 03:17:52 +11:00
Shamim Rezaie 2c76c1893f MDL-67424 report_outline: behat user report with a no-grade forum 2020-01-16 03:17:52 +11:00
Shamim Rezaie e27ac65f3d MDL-67379 libraries: Upgrade scssphp to 1.0.6 2020-01-16 00:26:47 +11:00
Sara Arjona 3d8f92e4be Merge branch 'MDL-67617-38' of git://github.com/lucaboesch/moodle into MOODLE_38_STABLE 2020-01-15 12:43:10 +01:00
Sara Arjona 35fd550dc9 Merge branch 'MDL-67638-38' of https://github.com/nguyenphuctien/moodle into MOODLE_38_STABLE 2020-01-15 12:19:44 +01:00
Andrew Nicols 712b21c6e7 Merge branch 'MDL-67486-swap-cron-lock-MOODLE_38_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_38_STABLE 2020-01-15 13:53:56 +08:00
Mark Johnson b5410980aa MDL-67674 Cache: Lock rebuilding of the course category tree cache 2020-01-15 00:02:06 +01:00
Sara Arjona b2c6ab2d0a Merge branch 'MDL-65573-38-2' of git://github.com/peterRd/moodle into MOODLE_38_STABLE 2020-01-14 12:20:09 +01:00
Andrew Nicols 4fb25b5b6c Merge branch 'MDL-66721-38' of git://github.com/bmbrands/moodle into MOODLE_38_STABLE 2020-01-14 14:09:42 +08:00
Andrew Nicols 3467ce09c8 MDL-67684 core: Add missing li tag 2020-01-14 08:47:08 +08:00
Andrew Nicols 83d4daee8d Merge branch 'MDL-35971-38' of git://github.com/junpataleta/moodle into MOODLE_38_STABLE 2020-01-14 08:32:14 +08:00
AMOS bot e653281d4a Automatically generated installer lang files 2020-01-14 00:10:24 +00:00
Peter 03b372b804 MDL-65573 mod_forum: Set userid properly after split
* Set the discussion's userid properly when splitting a discussion.
* Update step to correct existing incorrect records.
2020-01-14 07:37:41 +08:00
Eloy Lafuente (stronk7) c1724722c8 Merge branch 'MDL-65649-38' of https://github.com/paulholden/moodle into MOODLE_38_STABLE 2020-01-13 18:56:52 +01:00
Eloy Lafuente (stronk7) d1b3b4af95 Merge branch 'MDL-65987-38' of git://github.com/andrewnicols/moodle into MOODLE_38_STABLE 2020-01-13 18:37:30 +01:00
Marina Glancy f9a80888bc MDL-67680 core: Catch PHP exceptions in the after_config callback 2020-01-13 17:01:27 +01:00
Sara Arjona 0ebf9b16ea Merge branch 'MDL-59817-38' of git://github.com/andrewnicols/moodle into MOODLE_38_STABLE 2020-01-13 14:26:49 +01:00
Kiet.Chan 01fd8ac565 MDL-67583 themes: Popover placement should react to scroll event 2020-01-13 17:29:46 +07:00
Bas Brands 80a5640ed2 MDL-67472 theme_boost: configurable sass variable for drawer bgcolour 2020-01-13 09:16:36 +01:00
Tien Nguyen Phuc decf6b62ae MDL-67638 Course: update course timemodified on bulk category move 2020-01-13 10:42:06 +07:00
Andrew Nicols 5b31655420 Merge branch 'MDL-67204-38' of https://github.com/mwehr/moodle into MOODLE_38_STABLE 2020-01-13 08:53:56 +08:00
Brendan Heywood 8e725dd819 MDL-67486 cron: Improve throughput by holding cron lock for less time 2020-01-12 00:45:02 +11:00
Tim Hunt d0c48cd693 MDL-67653 questions: prevent the flag flickering as the page loads 2020-01-10 14:28:16 +00:00
Andrew Nicols b2f13181ec MDL-59817 atto_accessibilitychecker: Handle transparency properly
Some browsers, notably Firefox, do not return the computed style for
background colour in a computed RGB format. Instead they return the RGBA
where the alpha channel is set to fully transparent.

To solve this we need to work up the hierarchy and compute the
background colour for each parent node until we reach full alpha (1).

We can use a standard calculation to approximate the value for the
resultant element background by multiplying the alpha of the current
transparent (or semi-transparent) node with the R, G, or B channel in
question, and that of the parent node's background colour.

There are cases where this will not be 100% accurate - notably where
there is some additional content in addition to the parent background,
but this gives us a reasoable approximation for the majority of cases.
Additionally the code has never considered the full set of node content
when calculating this information.
2020-01-10 15:26:51 +08:00
Andrew Nicols fcdc318982 MDL-67656 behat: Removed nested spin 2020-01-10 13:37:43 +08:00
Andrew Nicols c89d25a046 MDL-67656 behat: Fix usleep call in spin 2020-01-10 13:37:36 +08:00
Andrew Nicols 77be1e3fe3 Moodle release 3.8.1 2020-01-10 13:03:44 +08:00
Andrew Nicols de7b3e37b3 Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2020-01-10 13:03:42 +08:00
AMOS bot ffd8dfcf27 Automatically generated installer lang files 2020-01-10 00:12:13 +00:00
Luca Bösch b116f84589 MDL-67625 quiz: only section titles should be large when editing. 2020-01-09 17:23:11 +01:00
Luca Bösch 36e70e664b MDL-67617 gradereport_singleview: Style the form element with bs classes 2020-01-09 17:22:18 +01:00
Mario Wehr 0debc8f826 MDL-67204 assign task: Use lastruntime from task_scheduled 2020-01-09 17:11:20 +01:00
John Beedell 81801a0685 MDL-66918 behat: Behat app step failing 2020-01-09 15:57:27 +00:00
Sara Arjona 8a82f51043 weekly release 3.8+ 2020-01-09 15:42:53 +01:00
Jun Pataleta 68cab31dba Merge branch 'MDL-67544-38' of git://github.com/andrewnicols/moodle into MOODLE_38_STABLE 2020-01-09 15:22:35 +08:00
Andrew Nicols 3f50c24fc3 MDL-67544f= mod_forum: Correct "for" attribute on private checkbox 2020-01-09 14:55:52 +08:00
Andrew Nicols 9973646ca7 MDL-67544 mod_forum: Ensure post actions menu id is unique 2020-01-09 14:09:21 +08:00
Andrew Nicols f14420c739 Merge branch 'MOODLE_38_MDL-67485' of https://github.com/golenkovm/moodle into MOODLE_38_STABLE 2020-01-09 12:40:19 +08:00
Mikhail Golenkov 70868d8648 MDL-67485 task: Release the task runner lock before throwing exception. 2020-01-09 14:49:38 +11:00
Andrew Nicols 8f45c9b6a5 Merge branch 'MDL-67596-cron-ramp-up-MOODLE_38_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_38_STABLE 2020-01-09 09:32:49 +08:00
Brendan Heywood 1f5c6c6b7a MDL-67596 cron: Allow runners to ramp up instantly 2020-01-09 11:07:19 +11:00
Eloy Lafuente (stronk7) 26999dda23 Merge branch 'MDL-67544-38' of git://github.com/andrewnicols/moodle into MOODLE_38_STABLE 2020-01-08 16:35:32 +01:00
Eloy Lafuente (stronk7) 022206f2fe Merge branch 'MDL-67533-38' of git://github.com/junpataleta/moodle into MOODLE_38_STABLE 2020-01-08 16:31:18 +01:00
Jake Dallimore f9e0f61467 MDL-67637 core_message: only preview lastmessage text if safe to do so
If any html/script tags are found in the text() value, don't display it.
2020-01-08 12:31:17 +01:00
Jun Pataleta c07bc83480 MDL-67533 mod_forum: Remove duplicate Re in experimental view subject 2020-01-08 16:29:43 +08:00
Jun Pataleta de2238985d MDL-35971 mod_forum: Add proper discussion list table description 2020-01-08 16:04:20 +08:00
Sara Arjona 7d7d3520a7 Merge branch 'MDL-67417-38' of https://github.com/KietChan/moodle into MOODLE_38_STABLE 2020-01-08 08:26:44 +01:00
Andrew Nicols f34f8131ba MDL-67544 mod_forum: Ensure that private reply checkbox has unique id 2020-01-08 15:26:03 +08:00
Sara Arjona 85ba5d1d88 Merge branch 'MDL-67510-38' of git://github.com/junpataleta/moodle into MOODLE_38_STABLE 2020-01-08 08:11:01 +01:00
Andrew Nicols e0b8a3b17a Merge branch 'MDL-64764-38' of git://github.com/paulholden/moodle into MOODLE_38_STABLE 2020-01-08 08:30:33 +08:00
Eloy Lafuente (stronk7) 5577e472e5 Merge branch 'MDL-67469-38' of git://github.com/junpataleta/moodle into MOODLE_38_STABLE 2020-01-07 22:59:51 +01:00
Marina Glancy 571f508d4e MDL-64764 core_admin: allow to submit empty list of allowed roles.
Co-authored-by: Paul Holden <paulh@moodle.com>
2020-01-07 10:01:33 +00:00
Andrew Nicols 764ec8d7fb Merge branch 'MDL-65849-38' of git://github.com/rezaies/moodle into MOODLE_38_STABLE 2020-01-07 13:26:56 +08:00
Andrew Nicols eb04dc8792 Merge branch 'MDL-66938-38' of https://github.com/grabs/moodle into MOODLE_38_STABLE 2020-01-07 12:49:42 +08:00
Paul Holden 2f19ac90c6 MDL-66237 message_popup: Get redirecturl from notification contexturl 2020-01-07 11:18:24 +08:00
Andrew Nicols 6fefb88819 MDL-67114 mod_wiki: Whitespace fix 2020-01-07 11:05:02 +08:00
Andrew Nicols 1b2a8dad89 Merge branch 'MDL-67114_38' of https://github.com/stronk7/moodle into MOODLE_38_STABLE 2020-01-07 11:04:55 +08:00
Andrew Nicols ec63d3eab4 Merge branch 'MDL-66871-38-v2' of git://github.com/lameze/moodle into MOODLE_38_STABLE 2020-01-07 08:54:44 +08:00
Bas Brands 63052bffb0 MDL-66721 core_chooser: height correction for chooser modal 2020-01-06 10:13:12 +01:00
Andrew Nicols 5f4250dc43 MDL-67544 form: Ensure that form errors have a unique id 2020-01-06 15:01:07 +08:00
Andrew Nicols b024306e5c MDL-67544 mod_forum: Add missing label for discussion move 2020-01-06 15:01:07 +08:00
Andrew Nicols 0d285e9334 MDL-67544 mod_forum: Add missing menuitem roles 2020-01-06 15:01:07 +08:00
Andrew Nicols bed212f61b MDL-67544 mod_forum: Correct aria-labelledby node 2020-01-06 15:01:07 +08:00
Andrew Nicols 14d58697a3 MDL-67544 mod_forum: Correct aria-controls to point to valid node 2020-01-06 15:01:07 +08:00
Andrew Nicols e98103354d MDL-67544 mod_forum: Add missing aria label for grade search 2020-01-06 15:01:07 +08:00
Andrew Nicols d8dfb98417 MDL-67544 core: Ensure unique IDs for YUI dialogues 2020-01-06 15:01:07 +08:00
Andrew Nicols 3684d9e03c MDL-67544 theme: Ensure that search box is in valid li 2020-01-06 15:01:06 +08:00
Andrew Nicols 629ef7772f MDL-67544 mod_forum: Add default role for favourite toggle 2020-01-06 15:01:06 +08:00
Andrew Nicols 9e57c09d7b MDL-67544 mod_forum: Add missing aria label for discussion actions 2020-01-06 15:01:06 +08:00
Andrew Nicols 949d3f1c02 MDL-67544 mod_forum: Correct aria-role => aria-live 2020-01-06 15:01:06 +08:00
Andrew Nicols 11524653b0 MDL-67544 mod_forum: Correct aria-role => role 2020-01-06 15:01:06 +08:00
David Monllaó 74299cd64b MDL-67622 mlbackend_python: Fix f1score calculation 2020-01-06 13:16:38 +08:00
Jun Pataleta f9b2f6634d MDL-67510 tool_dataprivacy: Fix the reply-to name of the privacy officer 2020-01-06 11:36:49 +08:00
Simey Lameze dafe4c5a78 MDL-66871 calendar: fix deprecated parameter in the phpDoc 2020-01-06 10:42:22 +08:00
Simey Lameze 550c4e1c42 MDL-66871 calendar: add unit test coverage for ics importing 2020-01-06 10:42:22 +08:00
Simey Lameze 0287928c4b MDL-66871 calendar: fix ics importing logic 2020-01-06 10:42:22 +08:00
Luca Bösch 50bcb24e09 MDL-65987 mod_forum: Add string 'Advanced' for the advanced editor.
AMOS BEGIN
    CPY [advanced,moodle],[showadvancededitor,moodle]
   AMOS END
2020-01-06 09:41:51 +08:00
Jake Dallimore 701d27e5d9 Merge branch 'MDL-67336-38' of https://github.com/roland04/moodle into MOODLE_38_STABLE 2020-01-06 09:36:53 +08:00
Andreas Grabs 13d5d3edb1 MDL-66938 mod_feedback: Export includes unwanted html in field names 2020-01-05 19:33:27 +01:00
Eloy Lafuente (stronk7) abc8f149ce MDL-67114 core: php74 fix. Fix use of scalar as array in core
There are various places where it's not guaranteed that the
variable being used is array, and instead, can be null, bool, int...

We need to check that because php74 warns about it.

Where possible we have used the coalesce operator as
replacement for isset() ternary operations.
2020-01-03 11:33:23 +01:00
Eloy Lafuente (stronk7) c3a6437220 MDL-67114 scssphp: php74 compatibility local fixes
Note they are already available upstream, versions 1.0.4 and up so,
in next upgrade they will be fixed.
2020-01-03 11:33:23 +01:00
Eloy Lafuente (stronk7) c910982c49 MDL-67114 mustache: php74 fix. Fix use of scalar as array
Trying to use values of type null, bool, int, float or resource as an
array (such as $null["key"]) will now generate a notice. This does not
affect array accesses performed by list().

RFC: https://wiki.php.net/rfc/notice-for-non-valid-array-container
2020-01-03 11:33:23 +01:00
Jake Dallimore 4d5849b0e4 weekly release 3.8+ 2020-01-03 11:25:08 +08:00
Jake Dallimore cc0b18ec0e Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2020-01-03 11:25:05 +08:00
AMOS bot 3c7ebda9a5 Automatically generated installer lang files 2020-01-03 00:12:10 +00:00
Adrian Greeve 19401adbdd Merge branch 'MDL-67599-38' of https://github.com/snake/moodle into MOODLE_38_STABLE 2020-01-02 15:16:18 +08:00
Jake Dallimore a7fb29a8ff MDL-67599 behat: fix behat tests assuming Jan 2020 is a future date 2020-01-02 13:52:24 +08:00
Jake Dallimore c53861fd66 Merge branch 'MDL-67598_38' of https://github.com/stronk7/moodle into MOODLE_38_STABLE 2020-01-02 10:19:30 +08:00
AMOS bot 88d4a01089 Automatically generated installer lang files 2020-01-02 00:10:23 +00:00
Eloy Lafuente (stronk7) b71e7b79e8 MDL-67598 unit tests: Pass day of month without leading zero
Note this fixes the unit tests. Still the calendar API itself
should be able to manage this cases, both casting (int) or
being stricter about what's allowed there (param hinting).

But that falls out from this issue and the code that introduced
the failures, so the pure unit-test fix has been applied.
2020-01-02 00:10:16 +01:00
Eloy Lafuente (stronk7) 6c7199a426 Merge branch 'MDL-67593-38' of https://github.com/snake/moodle into MOODLE_38_STABLE 2019-12-31 10:50:41 +01:00
Jake Dallimore 827f3cd471 MDL-67593 core_iplookup: update lang string describing download process
Let users know they need to register on maxmind before granted download
access.
2019-12-31 15:54:33 +08:00
Jake Dallimore 0260074ba1 MDL-67593 core_iplookup: use MaxMind test database in unit tests
Instead of downloading a live database (now not available publicly)
use a local test database.
2019-12-31 15:54:27 +08:00
Jun Pataleta edab811944 Merge branch 'MDL-63996-38' of git://github.com/andrewnicols/moodle into MOODLE_38_STABLE 2019-12-31 15:19:17 +08:00
Jun Pataleta 348ceb4631 Merge branch 'MDL-67487-38' of git://github.com/lucaboesch/moodle into MOODLE_38_STABLE 2019-12-31 11:55:55 +08:00
Jun Pataleta 5544dc1cc7 Merge branch 'MDL-67470-38' of git://github.com/junpataleta/moodle into MOODLE_38_STABLE 2019-12-31 11:29:52 +08:00
Bas Brands c02d168cd7 MDL-67470 theme_boost: settings_menu_proxy correct background
the .region_main_settings_proxy was introduced in MDL-56582 using the
wrong bootstrap variable for the background color
2019-12-31 09:59:51 +08:00
Adrian Greeve 53fde6278a Merge branch 'MDL-67233-38' of git://github.com/peterRd/moodle into MOODLE_38_STABLE 2019-12-30 12:56:59 +08:00
Jun Pataleta 25221f73a6 Merge branch 'MDL-67491-38' of git://github.com/junpataleta/moodle into MOODLE_38_STABLE 2019-12-30 12:41:40 +08:00
Didier 'OdyX' Raboud b901252f6d MDL-67491 core_message: Primary'fy the contact request counts 2019-12-30 11:47:36 +08:00
Eloy Lafuente (stronk7) be73a0ed4e Merge branch 'MDL-67523-38' of git://github.com/marinaglancy/moodle into MOODLE_38_STABLE 2019-12-29 23:32:07 +01:00
Eloy Lafuente (stronk7) e654258446 Merge branch 'MDL-67527-38-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_38_STABLE 2019-12-29 23:27:13 +01:00
Adrian Greeve 8c14984028 Merge branch 'MDL-63107-38' of git://github.com/bmbrands/moodle into MOODLE_38_STABLE 2019-12-27 16:34:10 +08:00
Adrian Greeve dd6bbf3962 Merge branch 'MDL-65809-38-onlyenv' of git://github.com/sarjona/moodle into MOODLE_38_STABLE 2019-12-24 14:54:57 +08:00
Adrian Greeve 01e84ac720 Merge branch 'MOODLE_38_STABLE-MDL-67524' of https://github.com/yao9394/moodle into MOODLE_38_STABLE 2019-12-23 10:30:23 +08:00
John Yao b423c5ad38 MDL-67524 book: fixing view hidden chapter issue
* Users who has permission should be able to view after turning editing off
2019-12-23 09:48:31 +11:00
AMOS bot f70cc95a13 Automatically generated installer lang files 2019-12-21 00:10:57 +00:00
Luca Bösch d9887f7350 MDL-67487 forms: align "Custom" checkbox for course section name. 2019-12-20 13:48:48 +01:00
Eloy Lafuente (stronk7) f2db42f921 weekly release 3.8+ 2019-12-20 11:02:10 +01:00
Eloy Lafuente (stronk7) b85896f7bc NOBUG: Fixed SVG browser compatibility 2019-12-20 11:02:08 +01:00
Eloy Lafuente (stronk7) 6350a758d7 Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2019-12-20 11:02:07 +01:00
Eloy Lafuente (stronk7) a3ea0db227 Merge branch 'MDL-67151-38' of git://github.com/rezaies/moodle into MOODLE_38_STABLE 2019-12-19 23:01:23 +01:00
Shamim Rezaie cd62c520e2 MDL-67151 qtype_numerical: convert the tolerance to string before saving
Fix the sqlserver issue when saving a number into a text field
2019-12-20 01:20:12 +11:00
Marina Glancy 86d4aca10d MDL-67523 core_admin: do not require admin to view category
Revert changes from MDL-58439 (in this file only)
2019-12-19 10:15:10 +01:00
Jun Pataleta 40ba9d9cfa Merge branch 'MOODLE_38_STABLE_MDL-63795_core_setting_defaults' of https://github.com/mattporritt/moodle into MOODLE_38_STABLE 2019-12-19 11:17:41 +08:00
Matt Porritt 5c510b92e2 MDL-63795 Administration: CLI upgrade apply all settings
This patch fixes a regression caused by MDL-62777.  MDL-62777 added output to inform
administrators of new default settings.  However, the recursion in the code did not
handle new settings made available as the result of the defaults of other settings
being set.
This patch fixes the issue, now all defaults are correctly set, even those exposed
after other defaults are set.
2019-12-19 12:22:01 +11:00
Eloy Lafuente (stronk7) 754ecb5768 Merge branch 'MDL-67151-38' of git://github.com/rezaies/moodle into MOODLE_38_STABLE 2019-12-18 23:05:56 +01:00
David Mudrák e7a122bba9 MDL-67527 lang: Propagate the string fixes to Behat and other places 2019-12-18 21:22:15 +01:00
Helen Foster 13edb4f9f9 MDL-67527 lang: Import fixed English strings (en_fix) 2019-12-18 21:22:15 +01:00
Eloy Lafuente (stronk7) db394d5b08 Merge branch 'MDL-64695-38' of https://github.com/paulholden/moodle into MOODLE_38_STABLE 2019-12-18 19:56:10 +01:00
Eloy Lafuente (stronk7) d18802eb2f Merge branch 'MDL-67464-38' of git://github.com/sarjona/moodle into MOODLE_38_STABLE 2019-12-17 19:37:00 +01:00
Mikel Martín ead3a41240 MDL-67336 mod_forum: Fixing forum inline reply filtering before saving 2019-12-17 11:59:02 +01:00
Jake Dallimore ae7b1be0b6 Merge branch 'MDL-67304_38' of git://github.com/dmonllao/moodle into MOODLE_38_STABLE 2019-12-17 13:47:11 +08:00
Jake Dallimore cca393d2f6 Merge branch 'MDL-65735-38' of https://github.com/paulholden/moodle into MOODLE_38_STABLE 2019-12-17 13:25:24 +08:00
Eloy Lafuente (stronk7) 69430157a3 Merge branch 'MDL-67522-38' of git://github.com/marinaglancy/moodle into MOODLE_38_STABLE 2019-12-17 00:22:33 +01:00
Eloy Lafuente (stronk7) f077d9fbea Merge branch 'MDL-67410-38' of https://github.com/felicemcc/moodle into MOODLE_38_STABLE 2019-12-16 19:18:31 +01:00
Bas Brands 8c20e76d43 MDL-63107 mod_book: rewrite styles for book chapter block
* using flexbox to position titles
* fix for title overlap on edit mode
* show correct bullets, number or indent
2019-12-16 13:30:28 +01:00
Jake Dallimore a0ac535549 Merge branch 'MDL-67327-38' of git://github.com/andrewnicols/moodle into MOODLE_38_STABLE 2019-12-16 15:12:35 +08:00
Andrew Nicols 11260d5f3f MDL-63996 core/tags: Pending JS for all tag code 2019-12-16 14:03:46 +08:00
Andrew Nicols 67fc9943b9 MDL-63996 behat: Fix multi-tag autocomplete usage 2019-12-16 14:00:04 +08:00
Jake Dallimore 29a5f6eaa2 Merge branch 'MDL-66503-38' of git://github.com/abgreeve/moodle into MOODLE_38_STABLE 2019-12-16 09:11:33 +08:00
Marina Glancy a6fd7ada34 MDL-67522 core_lock: fix mistype in config-dist 2019-12-14 19:29:40 +01:00
AMOS bot c86c872db3 Automatically generated installer lang files 2019-12-14 00:10:53 +00:00
Jun Pataleta 7b4848ca80 MDL-67469 tool_dataprivacy: Put back missing test code
This patch simply brings back the missing test code for
\tool_dataprivacy_api_testcase::test_approve_data_request_non_dpo_user()
2019-12-13 10:05:24 +08:00
AMOS bot d9e3c11834 Automatically generated installer lang files 2019-12-13 00:11:09 +00:00
Felice Candilio 1437e35d2d MDL-67410 Enrolments: Cast the perpage parameter to integer in JS
The parameter called "perpage" on the call is treated as a string,
therefore, It could have a value 15001 resulting from a "+" operation
of the "1500" string and the number 1. That big number makes
the AJAX call extremely slow.

The proposed solution is to parse the number as an integer
when performing the addition.
2019-12-12 22:25:55 +01:00
Paul Holden 914d5ab82d MDL-65735 report_progress: reset URL start parameter in initials bars. 2019-12-12 18:24:12 +00:00
Paul Holden fbf0c8810b MDL-64695 tool_dataprivacy: filter site fullname in outgoing messages. 2019-12-12 18:20:22 +00:00
Paul Holden 25da0b49ea MDL-64695 privacy: filter site fullname in data export. 2019-12-12 18:20:22 +00:00
Sara Arjona 70e47fdc2a MDL-67464 core_h5p: use h5p.com URLs in behat tests
The H5P content used in behat for validating external URLs
behaviour shouldn't point h5p.org because it may stop working
(it's not for real content). These content have been moved to
moodle.h5p.com (payment account).
Besides, the scenarios loading content from external URLs
have been labelel with @external.
2019-12-12 16:07:17 +01:00
Eloy Lafuente (stronk7) 3bfdc05d3a weekly release 3.8+ 2019-12-12 13:26:31 +01:00
Eloy Lafuente (stronk7) d64a94713e NOBUG: Fixed SVG browser compatibility 2019-12-12 13:26:29 +01:00
Eloy Lafuente (stronk7) 8d7f1fd428 Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2019-12-12 13:26:28 +01:00
Andrew Nicols a7268b4f8a MDL-67327 js: Make requirejs.php more fault tolerant 2019-12-12 16:37:08 +08:00
Jake Dallimore 4792cc508e Merge branch 'MDL-67154-38' of git://github.com/ferranrecio/moodle into MOODLE_38_STABLE 2019-12-12 09:05:11 +08:00
Ferran Recio 7bc625d846 MDL-67154 theme_classic: fixing firefox printing 2019-12-11 16:57:36 +01:00
AMOS bot 6dc25cc165 Automatically generated installer lang files 2019-12-11 13:50:07 +00:00
AMOS bot 747000a2fe Automatically generated installer lang files 2019-12-11 13:50:07 +00:00
Kiet.Chan bec0808b18 MDL-67417 theme_boost: Tooltip icon stop working after closing using ESC 2019-12-11 15:00:14 +07:00
Andrew Nicols 7f40272535 Merge branch 'MDL-67458-38' of https://github.com/snake/moodle into MOODLE_38_STABLE 2019-12-11 10:27:19 +08:00
Jake Dallimore f9735bbde7 MDL-67458 core: removing stale cohortroles and role assignments 2019-12-11 09:36:54 +08:00
Jake Dallimore 4dc1413cc7 MDL-67458 tool_cohortroles: remove role mapping for deleted roles
Before syncing anything, clean up records pointing to deleted roles.
2019-12-11 09:36:15 +08:00
Adrian Greeve 79b6a4acac MDL-66503 themes: Set the embed page to display block. 2019-12-11 09:32:54 +08:00
Andrew Nicols cf50c5f1cb Merge branch 'MDL-67434-38' of git://github.com/junpataleta/moodle into MOODLE_38_STABLE 2019-12-10 17:29:02 +08:00
Marina Glancy fc74a6e6d2 MDL-66936 mod_url: revert MDL-65024 adding fullurl to modinfo
This reverts commit cc56e409c3, reversing
changes made to 01cdf16c0e.
2019-12-10 15:27:59 +08:00
Jonathon Fowler a48bd1c4e3 MDL-66936 url: fix error when modinfo cache is rebuilt non-interactively 2019-12-10 15:27:52 +08:00
Jake Dallimore ee215ddd43 Merge branch 'MDL-67179-38' of git://github.com/Chocolate-lightning/moodle into MOODLE_38_STABLE 2019-12-10 15:03:24 +08:00
Mathew May f3e7533b9d MDL-67179 core: Add missing grading pix 2019-12-10 14:38:55 +08:00
Andrew Nicols 921469db8f Merge branch 'MDL-67277-38-strongtopics' of git://github.com/mudrd8mz/moodle into MOODLE_38_STABLE 2019-12-10 12:49:18 +08:00
Jake Dallimore b99f2bce77 Merge branch 'MDL-67154-38' of git://github.com/ferranrecio/moodle into MOODLE_38_STABLE 2019-12-10 11:53:56 +08:00
Jake Dallimore 7df9eb36cd Merge branch 'MDL-67451-38' of git://github.com/sarjona/moodle into MOODLE_38_STABLE 2019-12-10 10:37:15 +08:00
Jake Dallimore aee09a6357 Merge branch 'MDL-66708-MOODLE_38_KeyGenCache' of https://github.com/Cengage/moodle into MOODLE_38_STABLE 2019-12-10 09:12:13 +08:00
David Monllaó 8ae7a4ad68 MDL-67304 analytics: Add missing png svg incorrect icon
Credit to jaked for the icons and the testing instructions
2019-12-10 09:01:43 +08:00
Andrew Nicols d911548cf4 Merge branch 'MDL-67152-38' of git://github.com/rezaies/moodle into MOODLE_38_STABLE 2019-12-10 08:21:20 +08:00
Paul Holden 7a4b6df0fe MDL-65649 backup: ensure valid course URL for async mode. 2019-12-09 23:34:30 +00:00
Shamim Rezaie c8435454a7 MDL-67152 calendar: The day view should start from the current day 2019-12-10 06:58:18 +11:00
Jake Dallimore df2bda2f00 Merge branch 'MDL-67392-38' of git://github.com/rezaies/moodle into MOODLE_38_STABLE 2019-12-09 14:46:56 +08:00
Andrew Nicols bf52b2a3bc Merge branch 'MDL-60975-38' of https://github.com/Kathrin84/moodle into MOODLE_38_STABLE 2019-12-09 13:12:59 +08:00
Frédéric Massart f130c810f9 MDL-67434 javascript: Use static get_string after recycling promise 2019-12-09 10:12:43 +08:00
Paul Holden f0a2800a3a MDL-66024 tool_uploadcourse: validate shortname/fullname field length. 2019-12-05 23:11:19 +00:00
Kathrin Osswald d294483e9c MDL-60975 behat tests: Added search for admin setting filepickers 2019-12-05 14:59:18 +01:00
Sara Arjona ca89aca702 MDL-65809 environment: mbstring extension required 2019-12-05 14:00:16 +01:00
Sara Arjona 7e561cc4a8 MDL-65809 environment: PHP 7.2 required 2019-12-05 14:00:16 +01:00
Sara Arjona 57d601bc23 MDL-65809 environment: postgres requirement up to 9.5 2019-12-05 14:00:16 +01:00
Sara Arjona 7cdc332930 MDL-65809 environment: mariadb requirement up to 10.2 2019-12-05 14:00:16 +01:00
Sara Arjona 484eab15e3 MDL-65809 environment: 3.5 (LTS) required 2019-12-05 14:00:16 +01:00
Sara Arjona 0a0d55a3e1 MDL-65809 environment: 3.9 base information
This is a direct copy of the 3.8 branch to have changes
under control easier in next commits.
2019-12-05 14:00:16 +01:00
Eloy Lafuente (stronk7) 773b1f738f weekly release 3.8+ 2019-12-05 13:24:15 +01:00
Eloy Lafuente (stronk7) 96475f49de NOBUG: Fixed SVG browser compatibility 2019-12-05 13:24:13 +01:00
Adrian Greeve 9a64cc2b0b Merge branch 'MDL-65620-38' of git://github.com/aanabit/moodle into MOODLE_38_STABLE 2019-12-05 09:26:43 +08:00
Sara Arjona 56c570f68a MDL-67451 badges: use the site OB version as default 2019-12-04 21:27:16 +01:00
Sara Arjona ab2bb07f2e Merge branch 'MDL-67404_38' of https://github.com/stronk7/moodle into MOODLE_38_STABLE 2019-12-04 11:24:56 +01:00
Amaia Anabitarte d0aa6bf098 MDL-65620 core_message: Notification preferences behat tests 2019-12-04 11:03:49 +01:00
Ferran Recio 132e638209 MDL-67154 theme_boost: fixing firefox printing 2019-12-04 10:53:53 +01:00
Amaia Anabitarte 6713912510 MDL-65620 core_message: User preference generator 2019-12-04 10:03:34 +01:00
Amaia Anabitarte 96c48a5058 MDL-65620 core_message: Default notification preferences 2019-12-04 10:03:34 +01:00
Adrian Greeve d3de95f446 Merge branch 'MDL-40360-38' of git://github.com/lucaboesch/moodle into MOODLE_38_STABLE 2019-12-04 11:50:48 +08:00
Andrew Nicols 6d98038c8f Merge branch 'MDL-67359-38' of git://github.com/Chocolate-lightning/moodle_forum-project into MOODLE_38_STABLE 2019-12-04 10:38:12 +08:00
David Mudrák 83e5983a88 MDL-67277 forum: Replace the HTML comments with Mustache comments
It does not seem necessary to have the actual HTML sent to browsers full
of these developer-focused comments.
2019-12-03 20:16:53 +01:00
David Mudrák 0ddd9c54bc MDL-67277 forum: Remove the pinned class from the first cell
There should be no need to have it, and the name is confusing here.
2019-12-03 20:16:53 +01:00
David Mudrák 39bd01c11a MDL-67277 forum: Do not display discussion topics in bold
The topics are now inside a table header cell, which shows them in bold
by default.
2019-12-03 20:15:50 +01:00
David Mudrák 1e58e180d4 MDL-67277 forum: Apply CSS class describing the discussion status
This is to allow the themes to style pinned, favourited, subscribed and
discussions with unread replies.
2019-12-03 20:15:08 +01:00
Shamim Rezaie 163bff4a18 MDL-67151 qtype_calculatedsimple: Support for the scientific format 2019-12-03 16:57:41 +11:00
Shamim Rezaie 910c2ab7b4 MDL-67151 qtype_calculated: Support for the scientific format 2019-12-03 16:57:41 +11:00
Shamim Rezaie fcf199b0ec MDL-67151 qtype_numerical: Support for the scientific format 2019-12-03 16:57:41 +11:00
Shamim Rezaie bb511f30d6 MDL-67151 core_question: Support scientific format at question preview 2019-12-03 16:57:41 +11:00
Shamim Rezaie 481ad40e0e MDL-67151 forms: Support for the scientific format in the float element 2019-12-03 16:57:41 +11:00
Shamim Rezaie 031f3a1d4b MDL-67151 core: format_float can auto detect number of decimal points 2019-12-03 16:57:36 +11:00
Mathew May 5548689ead MDL-67359 mod_forum: Relocate notification templates to reallign it 2019-12-03 12:57:41 +08:00
Sara Arjona f751a8edbe Merge branch 'wip-MDL-67339-38stable' of https://github.com/Beedell/moodle into MOODLE_38_STABLE 2019-12-02 18:06:31 +01:00
John Beedell 0de719024c MDL-67339 behat: Enhance Behat exception message 2019-12-02 09:53:35 +00:00
Shamim Rezaie ac084982cf MDL-67392 mod_forum: Fix unescaped quotes issue in template 2019-12-02 20:50:40 +11:00
Jake Dallimore d3158895a8 Merge branch 'MDL-66581-38' of git://github.com/junpataleta/moodle into MOODLE_38_STABLE 2019-12-02 16:12:47 +08:00
Jun Pataleta 0e58303ea3 MDL-66581 auth: Properly assign the link attribute 2019-12-02 15:30:39 +08:00
Iñigo Zendegi f0d380703a MDL-66581 auth: Do string concatenation for the password change URL
This reverts the change introduced by MDL-59298 where the password
change URL data is being assigned with a moodle_url object instead
of concatenating it.
2019-12-02 15:30:39 +08:00
Jake Dallimore baf264ebc8 Merge branch 'MDL-66877-38' of git://github.com/jleyva/moodle into MOODLE_38_STABLE 2019-12-02 10:02:34 +08:00
Luca Bösch e61f7ba324 MDL-40360 gradingform_rubric: remove unused class 'label' for a label. 2019-11-30 10:28:22 +01:00
Shamim Rezaie afda296526 MDL-65849 mod_forum: Add course param to the author's profile url 2019-11-29 20:58:37 +11:00
Eloy Lafuente (stronk7) 6d6b14e8a4 weekly release 3.8+ 2019-11-29 00:45:52 +01:00
Juan Leyva 27d6bd5de1 MDL-66877 mod: Fix unfiltered activity names in page headings 2019-11-28 17:24:31 +01:00
Juan Leyva 907db7f06b MDL-66877 mod: Fix WebServices returning unfiltered activity names 2019-11-28 17:24:31 +01:00
Eloy Lafuente (stronk7) 33bfd161cd MDL-67404 composer: update to newer versions
(using php71 for this branch)

Without changing any requirement, just an update
to get latest versions onboard, some fixing known
php 7.4 issues.
2019-11-28 13:12:23 +01:00
Andrew Nicols f88b4e9f81 MDL-67348 theme: Return CSS from localcache if available 2019-11-27 10:38:52 +08:00
Eloy Lafuente (stronk7) 114f0b612f Merge branch 'MDL-67300-m38' of https://github.com/sammarshallou/moodle into MOODLE_38_STABLE
(fix trailing whitespace case)
2019-11-26 22:29:37 +01:00
Jun Pataleta a5f1dd6cb1 Merge branch 'MOODLE_38_MDL-56886' of https://github.com/golenkovm/moodle into MOODLE_38_STABLE 2019-11-26 22:32:41 +08:00
Luca Bösch 283cd6db67 MDL-67210 tool_uploadcourse: Allow only 0 and 1 for visible value. 2019-11-26 08:30:34 +01:00
Eloy Lafuente (stronk7) 3eac4851e3 MDL-67307 core: Fix onject creation from empty value cases
The "creating default object from empty value" warning is now consistently
thrown if a falsy value is promoted into an stdClass object. Previously some
cases like `$null->prop[0] = $val` missed this warning.
2019-11-26 14:15:06 +08:00
Sara Arjona 006ec3c96f MDL-67042 customfield: Add behat tests to check hidden fields
Fields with the visibility different to Everyone should
be never displayed in the available filters custom field.
2019-11-26 11:59:41 +08:00
Sara Arjona cabc1dafa9 MDL-67042 customfield: Display only fields visible to everybody
When defining the available filters for the Dashboard, only the
fields visible to everyone should be displayed in the Custom field
filter.
2019-11-26 11:59:36 +08:00
Eloy Lafuente (stronk7) 1b4c878f48 MDL-66966 tcpdf: Update readme to point to manual commits to review
Apart from the main import of the library, there are a couple of
commits (with corresponding PRs upstream) that have been added to
provide php74 compatibility.

This commit addes them to the instructions, to ensure that they
will be reviewed on next import.
2019-11-26 11:43:34 +08:00
Eloy Lafuente (stronk7) 91286bb138 MDL-66966 tcpdf: Silence non-existing K_PATH_CACHE
I was fixing this adding a extra dir_exists() check that
is better than the silence operator but that was that already
there was a PR using @. So went to it.

This is https://git.io/JeKft
2019-11-26 11:43:25 +08:00
Eloy Lafuente (stronk7) 71af7accff MDL-66966 tcpdf: Some more curly braces to fix
This is https://git.io/JeKfT
2019-11-26 11:43:18 +08:00
Eloy Lafuente (stronk7) ce97501b2b MDL-66966 tcpdf: PHP 7.4 - cannot use array offset on integers
This is https://git.io/JeKfU
2019-11-26 11:43:10 +08:00
Eloy Lafuente (stronk7) dadb3cb372 MDL-66966 tcpdf: Bump to tcpdf 6.3.2
Bug fixes and php74 support.
2019-11-26 11:43:00 +08:00
Peter 5cb05d8b77 MDL-67233 mod_timeline: Allow events with only open dates in the future 2019-11-26 11:27:01 +08:00
Bas Brands e29b355121 MDL-67222 tool_lp: update css classes for Bootstrap 4.3 2019-11-26 10:12:46 +08:00
Mikhail Golenkov 95ca6f656e MDL-56886 navigation: Allow local plugins to modify navigation via AJAX. 2019-11-26 13:01:14 +11:00
Claude Vervoort fbd1829594 MDL-66708 lti adv: fix check for key in config 2019-11-25 14:17:08 -05:00
Marina Glancy 0c91305856 MDL-67342 theme_boost: Do not hardcode tooltip container 2019-11-25 15:59:25 +01:00
Sara Arjona c42b488aaf Merge branch 'MDL-66627-38' of git://github.com/mickhawkins/moodle into MOODLE_38_STABLE 2019-11-25 15:42:02 +01:00
David Monllaó 5bde4eb35e MDL-67217 unittest: usleep and windows don't get along well 2019-11-25 16:13:39 +08:00
Andrew Nicols 1943c03bbb MDL-67168 forum: Correct behaviour of viewfullnames 2019-11-25 08:56:37 +01:00
Jun Pataleta 0da427c800 Merge branch 'MDL-65956-38-1' of git://github.com/mihailges/moodle into MOODLE_38_STABLE 2019-11-25 14:23:11 +08:00
Mihail Geshoski 7045a22f3a MDL-65956 mod_assign: Add behat tests 2019-11-25 10:50:22 +08:00
Mihail Geshoski c7f9c7ae0f MDL-65956 mod_assign: Add proper capability checks and error handling 2019-11-25 10:50:22 +08:00
Andrew Nicols 751e4964b1 MDL-67285 core: YUI dialogues must use focuslock
YUI Dialogues were using an older method for locking focus to modals,
but this way conflicts with the way in which we lock focus for AMD
modules.

As a result, when an AMD dialogue launches a YUI dialogue the focus is
not correctly locked and it is not possible to focus on anything in the
YUI dialogue.

This includes a minor changes to the focuslock AMD module to ensure that
it is possible to loop the focus in both directions. Many of our older
YUI dialogues are themselves focusable. As a result we need to include
the lock region in the calculation when calculating the possible
descendants.
If we do not do so then the reverse looping does not work.
2019-11-25 10:35:08 +08:00
Eloy Lafuente (stronk7) 5a108a3064 MDL-67049 grading: options are array, ensure json_decode() knows it
By default json_decode() returns object for associative arrays. That
was not a problem till now becuause array_key_exists() worked with
objects too. But in php74 that emits a warning.

So we need to ensure that the information arriving to it is
an array, allowing everything to continue working ok.
2019-11-25 09:34:22 +08:00
Eloy Lafuente (stronk7) 417ff4f035 weekly release 3.8+ 2019-11-22 00:17:15 +01:00
sam marshall d3a5df14f7 MDL-67300 Calendar: Inconsistent behaviour of managegroupentries
When calling the calendar_get_allowed_event_types function with
no course id, it is supposed to return true if you have the
relevant permissions in any course.

For users who have the managegroupentries permission, this was not
the case - even though it works correctly if you call the function
with a supplied course id.

This change makes behaviour with and without a supplied course id
consistent.
2019-11-21 10:54:08 +00:00
Eloy Lafuente (stronk7) 82853489ca MDL-67035 tags: fix nested ternary operators to be php74 compliant
Nesting ternary operators without explicit parentheses is deprecated:

    // Code like
    $a ? $b : $c ? $d : $e
    // should be replaced by (current interpretation)
    ($a ? $b : $c) ? $d : $e
    // or (likely intended interpretation)
    $a ? $b : ($c ? $d : $e)
2019-11-21 11:55:27 +08:00
Eloy Lafuente (stronk7) 9eaea6a7bf MDL-66964 markdown: add details to readme
The commit to apply, from upstream repo, is:

https://github.com/michelf/php-markdown/commit/a35858f0409e5f01474f5cd562d17289fe8e5435

But it doesn't apply clean to our current 1.8.0 version.

So we have ended a slightly different version in core reproducing the same changes.
2019-11-21 11:37:50 +08:00
Eloy Lafuente (stronk7) f11b82df7c MDL-66964 markdown: php74 fixup for markdown lib 1.8.0
Note this is different from the upstream commit:

https://github.com/michelf/php-markdown/commit/a35858f0409e5f01474f5cd562d17289fe8e5435

because it was conflicting so only the cases corresponding
to our current 1.8.0 version have been modified.

This commit is trivial, just a pure curly to square replacement.
2019-11-21 11:37:50 +08:00
Tim Hunt 5d2f8bd98d MDL-48024 behat: allow plugins to have data generators
This extends the step
Given the following "users" exist:
to also support things like
Given the following "mod_quiz > user overrides" exist:

Instructions are on the behat_data_generators and
behat_generator_base classes.
2019-11-21 09:33:48 +08:00
Eloy Lafuente (stronk7) 023109f1b1 MDL-67030 htmlpurifier: add details to readme 2019-11-21 08:19:17 +08:00
Eloy Lafuente (stronk7) 51bedcee13 MDL-67030 htmlpurifier: php74 fixup for htmlpurifier v4.10.0
This simply applies this pull request:

https://github.com/ezyang/htmlpurifier/pull/224

straight to our library. Once there is some new htmlpurifier
release available (>v4.11.0) we'll be back upstream because
the fix will be included.
2019-11-21 08:19:11 +08:00
Eloy Lafuente (stronk7) 7cec76396f MDL-67031 s3: php74 fixup for class S3 v0.5.1 2019-11-20 16:22:07 +08:00
Eloy Lafuente (stronk7) daed88e656 MDL-67077 h5p: php74 fix (curly braces) for the H5P lib
This has been sent also upstream @ https://github.com/h5p/h5p-php-library/pull/69
2019-11-20 16:11:55 +08:00
Michael Hawkins 212595bbd0 MDL-66627 forumreport_summary: Added content access behat tests 2019-11-20 14:58:22 +08:00
Eloy Lafuente (stronk7) 6cff678c08 MDL-67034 lti_provider: php74 fix (curly braces) for LTI Provider lib 2019-11-20 13:17:09 +08:00
Eloy Lafuente (stronk7) 980193f55b MDL-67034 google: php74 fix (curly braces) for the Google-Client lib 2019-11-20 13:17:02 +08:00
Eloy Lafuente (stronk7) b4f9c2e906 MDL-67034 adodb: php74 fix (curly braces) for the AdoDB lib 2019-11-20 13:16:55 +08:00
Eloy Lafuente (stronk7) 93ed2a597c MDL-67034 horde: php74 fix (curly braces) for the Horde lib 2019-11-20 13:16:49 +08:00
Eloy Lafuente (stronk7) a2c6a69070 MDL-67029 bennu: add details to readme 2019-11-20 11:46:18 +08:00
Eloy Lafuente (stronk7) 7a68a37fda MDL-67029 bennu: php74 fixup for bennu lib 0.1-custom 2019-11-20 11:46:13 +08:00
Eloy Lafuente (stronk7) 3c1b6ed7bd MDL-67017 typo3: add details to readme 2019-11-20 10:01:13 +08:00
Eloy Lafuente (stronk7) 8ff55e3b1b MDL-67017 typo3: php74 fixup for typo3 lib 4.7.19
We are using a really outdated Typo3 library (2014) already patched
for php73 support. Plus, probably, we'll be soon removing it from core.

So we have decided to, instead of upgrade, apply the needed php74 fixes.
2019-11-20 10:01:02 +08:00
sam marshall 7d05f78363 MDL-67274 Tasks: Log display fails with memory errors 2019-11-19 10:51:22 +08:00
Jun Pataleta d0a9211f51 MDL-67148 tool_mobile: Set auth_cas|auth_name config value in unit test
Thanks to Renaat Debleu for the fix suggestion!
2019-11-18 18:50:11 +01:00
Marina Glancy e2a0a42003 MDL-67073 core_course: fix capability context 2019-11-18 16:02:46 +08:00
Jake Dallimore 7e24491f2c Merge branch 'MDL-67284_38' of https://github.com/stronk7/moodle into MOODLE_38_STABLE 2019-11-18 11:29:29 +08:00
Eloy Lafuente (stronk7) 4619c8a7e3 MDL-67284 mod_feedback: Add missing file phpdoc block 2019-11-17 12:47:05 +01:00
Eloy Lafuente (stronk7) 2aff0046c1 MDL-67284 upgrade: add 3.8.0 separation line to all upgrade scripts 2019-11-17 11:43:41 +01:00
654 changed files with 10426 additions and 4126 deletions
+24 -12
View File
@@ -356,19 +356,31 @@ module.exports = function(grunt) {
};
tasks.gherkinlint = function() {
var done = this.async(),
options = grunt.config('gherkinlint.options');
const done = this.async();
const options = grunt.config('gherkinlint.options');
var args = grunt.file.expand(options.files);
args.unshift(path.normalize(__dirname + '/node_modules/.bin/gherkin-lint'));
grunt.util.spawn({
cmd: 'node',
args: args,
opts: {stdio: 'inherit', env: process.env}
}, function(error, result, code) {
// Propagate the exit code.
done(code === 0);
});
// Grab the gherkin-lint linter and required scaffolding.
const linter = require('gherkin-lint/src/linter.js');
const featureFinder = require('gherkin-lint/src/feature-finder.js');
const configParser = require('gherkin-lint/src/config-parser.js');
const formatter = require('gherkin-lint/src/formatters/stylish.js');
// Run the linter.
const results = linter.lint(
featureFinder.getFeatureFiles(grunt.file.expand(options.files)),
configParser.getConfiguration(configParser.defaultConfigFileName)
);
// Print the results out uncondtionally.
formatter.printResults(results);
// Report on the results.
// We exit 1 if there is at least one error, otherwise we exit cleanly.
if (results.some(result => result.errors.length > 0)) {
done(1);
} else {
done(0);
}
};
tasks.startup = function() {
+1 -1
View File
@@ -30,7 +30,7 @@ $category = required_param('category', PARAM_SAFEDIR);
$return = optional_param('return','', PARAM_ALPHA);
$adminediting = optional_param('adminedit', -1, PARAM_BOOL);
require_admin();
require_login(0, false);
$PAGE->set_context(context_system::instance());
$PAGE->set_url('/admin/category.php', array('category' => $category));
$PAGE->set_pagetype('admin-setting-' . $category);
+2 -1
View File
@@ -131,7 +131,8 @@ class task_log_table extends \table_sql {
}
$sql = "SELECT
tl.*,
tl.id, tl.type, tl.component, tl.classname, tl.userid, tl.timestart, tl.timeend,
tl.dbreads, tl.dbwrites, tl.result,
tl.dbreads + tl.dbwrites AS db,
tl.timeend - tl.timestart AS duration,
{$userfields}
+181
View File
@@ -2982,4 +2982,185 @@
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.9" requires="3.5">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.2.29" />
<VENDOR name="mysql" version="5.6" />
<VENDOR name="postgres" version="9.5" />
<VENDOR name="mssql" version="11.0" />
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.2.0" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="required">
<FEEDBACK>
<ON_ERROR message="mbstringrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="required">
<FEEDBACK>
<ON_ERROR message="opensslrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlreader" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="required">
<FEEDBACK>
<ON_ERROR message="intlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbstorageengine" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
<FEEDBACK>
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
<FEEDBACK>
<ON_CHECK message="slashargumentswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
<FEEDBACK>
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
<FEEDBACK>
<ON_CHECK message="unoconvwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfileformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfilepertable" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddblargeprefix" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
<FEEDBACK>
<ON_CHECK message="ishttpswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
<FEEDBACK>
<ON_CHECK message="incompleteunicodesupport" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_sixtyfour_bits" level="optional">
<FEEDBACK>
<ON_CHECK message="sixtyfourbitswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+31 -11
View File
@@ -33,13 +33,17 @@ $allprocessors = get_message_processors();
$processors = array_filter($allprocessors, function($processor) {
return $processor->enabled;
});
$disabledprocessors = array_filter($allprocessors, function($processor) {
return !$processor->enabled;
});
// Fetch message providers.
$providers = get_message_providers();
// Fetch the manage message outputs interface.
$preferences = get_message_output_default_preferences();
if (($form = data_submitted()) && confirm_sesskey()) {
$preferences = array();
$newpreferences = array();
// Prepare default message outputs settings.
foreach ($providers as $provider) {
$componentproviderbase = $provider->component.'_'.$provider->name;
@@ -47,9 +51,9 @@ if (($form = data_submitted()) && confirm_sesskey()) {
$providerdisabled = false;
if (!isset($form->$disableprovidersetting)) {
$providerdisabled = true;
$preferences[$disableprovidersetting] = 1;
$newpreferences[$disableprovidersetting] = 1;
} else {
$preferences[$disableprovidersetting] = 0;
$newpreferences[$disableprovidersetting] = 0;
}
foreach (array('permitted', 'loggedin', 'loggedoff') as $setting) {
@@ -75,20 +79,36 @@ if (($form = data_submitted()) && confirm_sesskey()) {
$form->{$componentproviderbase.'_loggedoff'}[$processor->name] = 1;
}
// Record the site preference.
$preferences[$processor->name.'_provider_'.$componentprovidersetting] = $value;
$newpreferences[$processor->name.'_provider_'.$componentprovidersetting] = $value;
}
} else if (property_exists($form, $componentprovidersetting)) {
// We must be processing loggedin or loggedoff checkboxes. Store
// defained comma-separated processors as setting value.
// Using array_filter eliminates elements set to 0 above.
$value = join(',', array_keys(array_filter($form->{$componentprovidersetting})));
} else {
$newsettings = array();
if (array_key_exists($componentprovidersetting, $form)) {
// We must be processing loggedin or loggedoff checkboxes.
// Store defained comma-separated processors as setting value.
// Using array_filter eliminates elements set to 0 above.
$newsettings = array_keys(array_filter($form->{$componentprovidersetting}));
}
// Let's join existing setting values for disabled processors.
$property = 'message_provider_'.$componentprovidersetting;
if (property_exists($preferences, $property)) {
$existingsetting = $preferences->$property;
foreach ($disabledprocessors as $disable) {
if (strpos($existingsetting, $disable->name) > -1) {
$newsettings[] = $disable->name;
}
}
}
$value = join(',', $newsettings);
if (empty($value)) {
$value = null;
}
}
if ($setting != 'permitted') {
// We have already recoded site preferences for 'permitted' type.
$preferences['message_provider_'.$componentprovidersetting] = $value;
$newpreferences['message_provider_'.$componentprovidersetting] = $value;
}
}
}
@@ -102,7 +122,7 @@ if (($form = data_submitted()) && confirm_sesskey()) {
\core_message\api::update_processor_status($processor, $enabled);
}
foreach ($preferences as $name => $value) {
foreach ($newpreferences as $name => $value) {
set_config($name, $value, 'message');
}
$transaction->allow_commit();
+1 -1
View File
@@ -45,7 +45,7 @@ $error = optional_param('error', '', PARAM_ALPHANUM);
admin_externalpage_setup('registrationmoodleorg');
if ($url !== HUB_MOODLEORGHUBURL) {
if (parse_url($url, PHP_URL_HOST) !== parse_url(HUB_MOODLEORGHUBURL, PHP_URL_HOST)) {
// Allow other plugins to confirm registration on custom hubs. Plugins implementing this
// callback need to redirect or exit. See https://docs.moodle.org/en/Hub_registration .
$callbacks = get_plugins_with_function('hub_registration');
+1 -1
View File
@@ -39,7 +39,7 @@ $token = optional_param('token', '', PARAM_TEXT);
admin_externalpage_setup('registrationmoodleorg');
if ($url !== HUB_MOODLEORGHUBURL) {
if (parse_url($url, PHP_URL_HOST) !== parse_url(HUB_MOODLEORGHUBURL, PHP_URL_HOST)) {
// Allow other plugins to renew registration on custom hubs. Plugins implementing this
// callback need to redirect or exit. See https://docs.moodle.org/en/Hub_registration .
$callbacks = get_plugins_with_function('hub_registration');
+4 -4
View File
@@ -1285,7 +1285,7 @@ class core_admin_renderer extends plugin_renderer_base {
if ($unavailable or $unknown) {
$out .= $this->output->heading(get_string('misdepsunavail', 'core_plugin'));
if ($unknown) {
$out .= $this->output->notification(get_string('misdepsunknownlist', 'core_plugin', implode($unknown, ', ')));
$out .= $this->output->notification(get_string('misdepsunknownlist', 'core_plugin', implode(', ', $unknown)));
}
if ($unavailable) {
$unavailablelist = array();
@@ -1300,7 +1300,7 @@ class core_admin_renderer extends plugin_renderer_base {
$unavailablelist[] = $unavailablelistitem;
}
$out .= $this->output->notification(get_string('misdepsunavaillist', 'core_plugin',
implode($unavailablelist, ', ')));
implode(', ', $unavailablelist)));
}
$out .= $this->output->container_start('plugins-check-dependencies-actions');
$out .= ' '.html_writer::link(new moodle_url('/admin/tool/installaddon/'),
@@ -1420,7 +1420,7 @@ class core_admin_renderer extends plugin_renderer_base {
html_writer::div($plugin->name, 'name').' '.html_writer::div($plugin->component, 'component'),
$plugin->version->release,
$plugin->version->version,
implode($supportedmoodles, ' '),
implode(' ', $supportedmoodles),
$info
);
}
@@ -2011,7 +2011,7 @@ class core_admin_renderer extends plugin_renderer_base {
if (empty($CFG->docroot) or $environment_result->plugin) {
$report = get_string($stringtouse, 'admin', $rec);
} else {
$report = $this->doc_link(join($linkparts, '/'), get_string($stringtouse, 'admin', $rec), true);
$report = $this->doc_link(join('/', $linkparts), get_string($stringtouse, 'admin', $rec), true);
}
// Enclose report text in div so feedback text will be displayed underneath it.
$report = html_writer::div($report);
@@ -157,19 +157,19 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
// Allowed roles.
$allow = optional_param_array('allowassign', null, PARAM_INT);
if (!is_null($allow)) {
$this->allowassign = $allow;
$this->allowassign = array_filter($allow);
}
$allow = optional_param_array('allowoverride', null, PARAM_INT);
if (!is_null($allow)) {
$this->allowoverride = $allow;
$this->allowoverride = array_filter($allow);
}
$allow = optional_param_array('allowswitch', null, PARAM_INT);
if (!is_null($allow)) {
$this->allowswitch = $allow;
$this->allowswitch = array_filter($allow);
}
$allow = optional_param_array('allowview', null, PARAM_INT);
if (!is_null($allow)) {
$this->allowview = $allow;
$this->allowview = array_filter($allow);
}
// Now read the permissions for each capability.
@@ -618,7 +618,9 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
if ($this->roleid == 0) {
$options[-1] = get_string('thisnewrole', 'core_role');
}
return html_writer::select($options, 'allow'.$type.'[]', $selected, false, array('multiple' => 'multiple',
return
html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'allow'.$type.'[]', 'value' => "")) .
html_writer::select($options, 'allow'.$type.'[]', $selected, false, array('multiple' => 'multiple',
'size' => 10, 'class' => 'form-control'));
}
+4 -1
View File
@@ -97,7 +97,10 @@ $options = array(
GETREMOTEADDR_SKIP_HTTP_CLIENT_IP => 'HTTP_X_FORWARDED_FOR, REMOTE_ADDR',
GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR => 'HTTP_CLIENT, REMOTE_ADDR',
GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR|GETREMOTEADDR_SKIP_HTTP_CLIENT_IP => 'REMOTE_ADDR');
$temp->add(new admin_setting_configselect('getremoteaddrconf', new lang_string('getremoteaddrconf', 'admin'), new lang_string('configgetremoteaddrconf', 'admin'), 0, $options));
$temp->add(new admin_setting_configselect('getremoteaddrconf', new lang_string('getremoteaddrconf', 'admin'),
new lang_string('configgetremoteaddrconf', 'admin'),
GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR|GETREMOTEADDR_SKIP_HTTP_CLIENT_IP, $options));
$temp->add(new admin_setting_configtext('reverseproxyignore', new lang_string('reverseproxyignore', 'admin'), new lang_string('configreverseproxyignore', 'admin'), ''));
$temp->add(new admin_setting_heading('webproxy', new lang_string('webproxy', 'admin'), new lang_string('webproxyinfo', 'admin')));
$temp->add(new admin_setting_configtext('proxyhost', new lang_string('proxyhost', 'admin'), new lang_string('configproxyhost', 'admin'), '', PARAM_HOST));
+2
View File
@@ -46,6 +46,8 @@ $logid = optional_param('logid', null, PARAM_INT);
$download = optional_param('download', false, PARAM_BOOL);
if (null !== $logid) {
// Raise memory limit in case the log is large.
raise_memory_limit(MEMORY_HUGE);
$log = $DB->get_record('task_log', ['id' => $logid], '*', MUST_EXIST);
if ($download) {
+1 -1
View File
@@ -32,7 +32,7 @@ require_once($CFG->libdir . '/behat/classes/behat_config_manager.php');
// systems, but let's allow room for expansion.
core_php_time_limit::raise(300);
$filter = optional_param('filter', '', PARAM_ALPHANUMEXT);
$filter = optional_param('filter', '', PARAM_NOTAGS);
$type = optional_param('type', false, PARAM_ALPHAEXT);
$component = optional_param('component', '', PARAM_ALPHAEXT);
+2 -2
View File
@@ -55,13 +55,13 @@ class tool_behat {
// The loaded steps depends on the component specified.
behat_config_manager::update_config_file($component, false);
// The Moodle\BehatExtension\HelpPrinter\MoodleDefinitionsPrinter will parse this search format.
// The Moodle\BehatExtension\Definition\Printer\ConsoleDefinitionInformationPrinter will parse this search format.
if ($type) {
$filter .= '&&' . $type;
}
if ($filter) {
$filteroption = ' -d "' . $filter . '"';
$filteroption = ' -d ' . escapeshellarg($filter);
} else {
$filteroption = ' -di';
}
+8 -17
View File
@@ -44,13 +44,9 @@ class tool_behat_renderer extends plugin_renderer_base {
global $CFG;
require_once($CFG->libdir . '/behat/classes/behat_selectors.php');
$html = $this->generic_info();
// Form.
ob_start();
$form->display();
$html .= ob_get_contents();
ob_end_clean();
$html = $this->output->header();
$html .= $this->output->heading(get_string('pluginname', 'tool_behat'));
$html .= $form->render();
if (empty($stepsdefinitions)) {
$stepsdefinitions = get_string('nostepsdefinitions', 'tool_behat');
@@ -128,7 +124,9 @@ class tool_behat_renderer extends plugin_renderer_base {
*/
public function render_error($msg) {
$html = $this->generic_info();
$html = $this->output->header();
$html .= $this->output->heading(get_string('pluginname', 'tool_behat'));
$html .= $this->generic_info();
$a = new stdClass();
$a->errormsg = $msg;
@@ -153,13 +151,7 @@ class tool_behat_renderer extends plugin_renderer_base {
*
* @return string
*/
protected function generic_info() {
$title = get_string('pluginname', 'tool_behat');
// Header.
$html = $this->output->header();
$html .= $this->output->heading($title);
public function generic_info() {
// Info.
$installurl = behat_command::DOCS_URL;
@@ -175,8 +167,7 @@ class tool_behat_renderer extends plugin_renderer_base {
);
// List of steps.
$html .= $this->output->box_start();
$html .= html_writer::tag('h3', get_string('infoheading', 'tool_behat'));
$html = $this->output->box_start();
$html .= html_writer::tag('div', get_string('aim', 'tool_behat'));
$html .= html_writer::start_tag('div');
$html .= html_writer::start_tag('ul');
@@ -40,8 +40,14 @@ class steps_definitions_form extends moodleform {
* @return void
*/
public function definition() {
global $PAGE;
$mform = $this->_form;
$output = $PAGE->get_renderer('tool_behat');
$mform->addElement('header', 'info', get_string('infoheading', 'tool_behat'));
$mform->setExpanded('info', false);
$mform->addElement('html', $output->generic_info());
$mform->addElement('header', 'filters', get_string('stepsdefinitionsfilters', 'tool_behat'));
+20 -14
View File
@@ -1,25 +1,31 @@
.steps-definitions {
border-style: solid;
border-width: 1px;
border-color: #bbb;
padding: 5px;
margin: auto;
width: 50%;
#page-admin-tool-behat-index .steps-definitions {
margin: 1rem auto;
}
.steps-definitions .step {
margin: 10px 0 10px 0;
#page-admin-tool-behat-index .steps-definitions .step {
margin: 1rem 0 0 0;
border: 1px solid #eee;
padding: 1rem;
}
.steps-definitions .stepdescription {
color: #bf8c12;
#page-admin-tool-behat-index .steps-definitions .stepdescription {
font-style: italic;
}
.steps-definitions .steptype {
#page-admin-tool-behat-index .steps-definitions .stepcontent {
margin: 1rem 0;
}
#page-admin-tool-behat-index .steps-definitions .steptype {
color: #1467a6;
margin-right: 5px;
margin-right: 1ex;
}
.steps-definitions .stepregex {
#page-admin-tool-behat-index .steps-definitions .stepapipath {
font-family: monospace;
font-size: smaller;
}
#page-admin-tool-behat-index .steps-definitions .stepregex {
color: #060;
}
@@ -26,3 +26,11 @@ Feature: List the system steps definitions
Given I set the field "Contains" to "homepage"
When I press "Filter"
Then I should see "Opens Moodle homepage."
@javascript
Scenario: Filtering by the multiple words pattern
Given I set the field "Contains" to "should exist"
When I press "Filter"
Then I should not see "There aren't steps definitions matching this filter"
And I should see "Checks the provided element and selector type exists in the current page."
And I should see "Checks that an element and selector type exists in another element and selector type on the current page."
+14 -4
View File
@@ -75,6 +75,7 @@ class tool_capability_renderer extends plugin_renderer_base {
* @return string
*/
public function capability_comparison_table(array $capabilities, $contextid, array $roles) {
static $capabilitycontexts = array();
$strpermissions = $this->get_permission_strings();
$permissionclasses = $this->get_permission_classes();
@@ -92,8 +93,13 @@ class tool_capability_renderer extends plugin_renderer_base {
}
$table->data = array();
$childcontextsids = [];
foreach ($capabilities as $capability) {
$contexts = tool_capability_calculate_role_data($capability, $roles);
if (empty($capabilitycontexts[$capability])) {
$capabilitycontexts[$capability] = tool_capability_calculate_role_data($capability, $roles);
}
$contexts = $capabilitycontexts[$capability];
$captitle = new html_table_cell(get_capability_string($capability) . html_writer::span($capability));
$captitle->header = true;
@@ -111,6 +117,10 @@ class tool_capability_renderer extends plugin_renderer_base {
}
$table->data[] = $row;
if (!empty($contexts[$contextid]->children)) {
$childcontextsids = array_merge($childcontextsids, $contexts[$contextid]->children);
$childcontextsids = array_unique($childcontextsids);
}
}
// Start the list item, and print the context name as a link to the place to make changes.
@@ -127,9 +137,9 @@ class tool_capability_renderer extends plugin_renderer_base {
$html = $this->output->heading(html_writer::link($url, $title), 3);
$html .= html_writer::table($table);
// If there are any child contexts, print them recursively.
if (!empty($contexts[$contextid]->children)) {
foreach ($contexts[$contextid]->children as $childcontextid) {
$html .= $this->capability_comparison_table($capabilities, $childcontextid, $roles, true);
if (!empty($childcontextsids)) {
foreach ($childcontextsids as $childcontextid) {
$html .= $this->capability_comparison_table($capabilities, $childcontextid, $roles);
}
}
return $html;
@@ -0,0 +1,97 @@
@tool @tool_capability
Feature: Show capabilities for multiple contexts
In order to check roles capabilities
As an admin
I need to be able to see capability overrides on several contexts
Background:
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| Course 2 | C2 | 0 |
And the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| enrol/category:config | Allow | student | Course | C1 |
| enrol/cohort:unenrol | Allow | student | Course | C2 |
And I log in as "admin"
And I navigate to "Users > Permissions > Capability overview" in site administration
Scenario: Show capabilities table with one capability with overrides
When I set the following fields to these values:
| Capability: | enrol/category:config |
| Roles: | Student |
And I click on "Get the overview" "button"
Then I should see "Permissions in System"
And I should see "Permissions in Category: Miscellaneous"
And I should see "Permissions in Course: Course 1"
And I should not see "Permissions in Course: Course 2"
Scenario: Show capabilities table with one capability without overrides
When I set the following fields to these values:
| Capability: | enrol/cohort:config |
| Roles: | Student |
And I click on "Get the overview" "button"
Then I should see "Permissions in System"
And I should not see "Permissions in Category: Miscellaneous"
And I should not see "Permissions in Course: Course 1"
And I should not see "Permissions in Course: Course 2"
Scenario: Show capabilities table with two capabilities, 1st without overrides and 2nd with
When I set the following fields to these values:
| Capability: | enrol/category:synchronised, enrol/category:config |
| Roles: | Student |
And I click on "Get the overview" "button"
Then I should see "Permissions in System"
And I should see "Permissions in Category: Miscellaneous"
And I should see "Permissions in Course: Course 1"
And I should not see "Permissions in Course: Course 2"
Scenario: Show capabilities table with two capabilities, 1st with overrides and 2nd without
When I set the following fields to these values:
| Capability: | enrol/category:config, enrol/cohort:config |
| Roles: | Student |
And I click on "Get the overview" "button"
Then I should see "Permissions in System"
And I should see "Permissions in Category: Miscellaneous"
And I should see "Permissions in Course: Course 1"
And I should not see "Permissions in Course: Course 2"
Scenario: Show capabilities table with two capabilities, none with overrides
When I set the following fields to these values:
| Capability: | enrol/category:synchronised, enrol/cohort:config |
| Roles: | Student |
And I click on "Get the overview" "button"
Then I should see "Permissions in System"
And I should not see "Permissions in Category: Miscellaneous"
And I should not see "Permissions in Course: Course 1"
And I should not see "Permissions in Course: Course 2"
Scenario: Show capabilities table with capability with override and no role selected
When I set the following fields to these values:
| Capability: | enrol/category:config |
| Roles: | |
And I click on "Get the overview" "button"
Then I should see "Permissions in System"
And I should see "Permissions in Category: Miscellaneous"
And I should see "Permissions in Course: Course 1"
And I should not see "Permissions in Course: Course 2"
Scenario: Show capabilities table with capability without override and no role selected
When I set the following fields to these values:
| Capability: | enrol/cohort:config |
| Roles: | |
And I click on "Get the overview" "button"
Then I should see "Permissions in System"
And I should not see "Permissions in Category: Miscellaneous"
And I should not see "Permissions in Course: Course 1"
And I should not see "Permissions in Course: Course 2"
Scenario: Show capabilities table with capability with two overrides on different contexts
When I set the following fields to these values:
| Capability: | enrol/category:config, enrol/cohort:unenrol |
| Roles: | |
And I click on "Get the overview" "button"
Then I should see "Permissions in System"
And I should see "Permissions in Category: Miscellaneous"
And I should see "Permissions in Course: Course 1"
And I should see "Permissions in Course: Course 2"
+4
View File
@@ -144,6 +144,10 @@ class api {
$rolesadded = array();
$rolesremoved = array();
// Remove any cohort role mappings for roles which have been deleted.
// The role assignments are not a consideration because these will have been removed when the role was.
$DB->delete_records_select('tool_cohortroles', "roleid NOT IN (SELECT id FROM {role})");
// Get all cohort role assignments and group them by user and role.
$all = cohort_role_assignment::get_records(array(), 'userid, roleid');
// We build an better structure to loop on.
+45
View File
@@ -0,0 +1,45 @@
<?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/>.
/**
* Plugin upgrade code
*
* @package tool_cohortroles
* @copyright 2020 Paul Holden <paulh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Function to upgrade tool_cohortroles.
*
* @param int $oldversion the version we are upgrading from
* @return bool result
*/
function xmldb_tool_cohortroles_upgrade($oldversion) {
global $DB;
if ($oldversion < 2019111801) {
// Delete any tool_cohortroles mappings for roles which no longer exist.
$DB->delete_records_select('tool_cohortroles', 'roleid NOT IN (SELECT id FROM {role})');
// Cohortroles savepoint reached.
upgrade_plugin_savepoint(true, 2019111801, 'tool', 'cohortroles');
}
return true;
}
+1 -1
View File
@@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2019111800; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2019111801; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2019111200; // Requires this Moodle version.
$plugin->component = 'tool_cohortroles'; // Full name of the plugin (used for diagnostics).
+3
View File
@@ -44,5 +44,8 @@ function xmldb_tool_customlang_upgrade($oldversion) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+1 -1
View File
@@ -712,7 +712,7 @@ class api {
'requestedby' => $requestedby->fullname,
'requesttype' => $typetext,
'requestdate' => userdate($requestdata->timecreated),
'requestorigin' => $SITE->fullname,
'requestorigin' => format_string($SITE->fullname, true, ['context' => context_system::instance()]),
'requestoriginurl' => new moodle_url('/'),
'requestcomments' => $requestdata->messagehtml,
'datarequestsurl' => $datarequestsurl
@@ -26,6 +26,7 @@ namespace tool_dataprivacy\task;
use action_link;
use coding_exception;
use context_system;
use core\message\message;
use core\task\adhoc_task;
use core_user;
@@ -152,7 +153,7 @@ class process_data_request_task extends adhoc_task {
$message->name = 'datarequestprocessingresults';
$message->userfrom = $dpo;
$message->replyto = $dpo->email;
$message->replytoname = fullname($dpo->email);
$message->replytoname = fullname($dpo);
$typetext = null;
// Prepare the context data for the email message body.
@@ -180,7 +181,8 @@ class process_data_request_task extends adhoc_task {
$message->contexturl = $datarequestsurl;
$message->contexturlname = get_string('datarequests', 'tool_dataprivacy');
// Message to the recipient.
$messagetextdata['message'] = get_string('resultdownloadready', 'tool_dataprivacy', $SITE->fullname);
$messagetextdata['message'] = get_string('resultdownloadready', 'tool_dataprivacy',
format_string($SITE->fullname, true, ['context' => context_system::instance()]));
// Prepare download link.
$downloadurl = moodle_url::make_pluginfile_url($usercontext->id, 'tool_dataprivacy', 'export', $thing->get_itemid(),
$thing->get_filepath(), $thing->get_filename(), true);
@@ -192,7 +194,8 @@ class process_data_request_task extends adhoc_task {
// No point notifying a deleted user in Moodle.
$message->notification = 0;
// Message to the recipient.
$messagetextdata['message'] = get_string('resultdeleted', 'tool_dataprivacy', $SITE->fullname);
$messagetextdata['message'] = get_string('resultdeleted', 'tool_dataprivacy',
format_string($SITE->fullname, true, ['context' => context_system::instance()]));
// Message will be sent to the deleted user via email only.
$emailonly = true;
break;
+9 -1
View File
@@ -45,13 +45,22 @@ if ($manage) {
$context = context_system::instance();
// Make sure the user has the proper capability.
require_capability('tool/dataprivacy:managedatarequests', $context);
navigation_node::override_active_url($returnurl);
} else {
// For the case where a user makes request for themselves (or for their children if they are the parent).
$returnurl = new moodle_url($CFG->wwwroot . '/admin/tool/dataprivacy/mydatarequests.php');
$context = context_user::instance($USER->id);
}
$PAGE->set_context($context);
if (!$manage && $profilenode = $PAGE->settingsnav->find('myprofile', null)) {
$profilenode->make_active();
}
$title = get_string('createnewdatarequest', 'tool_dataprivacy');
$PAGE->navbar->add($title);
// If contactdataprotectionofficer is disabled, send the user back to the profile page, or the privacy policy page.
// That is, unless you have sufficient capabilities to perform this on behalf of a user.
if (!$manage && !\tool_dataprivacy\api::can_contact_dpo()) {
@@ -100,7 +109,6 @@ if ($data = $mform->get_data()) {
redirect($returnurl, $redirectmessage);
}
$title = get_string('createnewdatarequest', 'tool_dataprivacy');
$PAGE->set_heading($SITE->fullname);
$PAGE->set_title($title);
echo $OUTPUT->header();
+3
View File
@@ -319,5 +319,8 @@ function xmldb_tool_dataprivacy_upgrade($oldversion) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+7 -1
View File
@@ -42,6 +42,13 @@ if (isguestuser()) {
$usercontext = context_user::instance($USER->id);
$PAGE->set_context($usercontext);
if ($profilenode = $PAGE->settingsnav->find('myprofile', null)) {
$profilenode->make_active();
}
$title = get_string('datarequests', 'tool_dataprivacy');
$PAGE->navbar->add($title);
// Return URL.
$params = ['id' => $USER->id];
if ($courseid) {
@@ -49,7 +56,6 @@ if ($courseid) {
}
$returnurl = new moodle_url('/user/profile.php', $params);
$title = get_string('datarequests', 'tool_dataprivacy');
$PAGE->set_heading($title);
$PAGE->set_title($title);
echo $OUTPUT->header();
+3 -9
View File
@@ -27,12 +27,10 @@ require_once('../../../config.php');
$requestid = required_param('requestid', PARAM_INT);
$confirm = optional_param('confirm', null, PARAM_INT);
$PAGE->set_url(new moodle_url('/admin/tool/dataprivacy/resubmitrequest.php', ['requestid' => $requestid]));
$url = new moodle_url('/admin/tool/dataprivacy/resubmitrequest.php', ['requestid' => $requestid]);
$title = get_string('resubmitrequestasnew', 'tool_dataprivacy');
require_login();
$PAGE->set_context(\context_system::instance());
require_capability('tool/dataprivacy:managedatarequests', $PAGE->context);
\tool_dataprivacy\page_helper::setup($url, $title, 'datarequests', 'tool/dataprivacy:managedatarequests');
$manageurl = new moodle_url('/admin/tool/dataprivacy/datarequests.php');
@@ -53,10 +51,6 @@ if (null !== $confirm && confirm_sesskey()) {
redirect($manageurl, get_string('resubmittedrequest', 'tool_dataprivacy', $stringparams));
}
$heading = get_string('resubmitrequest', 'tool_dataprivacy', $stringparams);
$PAGE->set_title($heading);
$PAGE->set_heading($heading);
echo $OUTPUT->header();
$confirmstring = get_string('confirmrequestresubmit', 'tool_dataprivacy', $stringparams);
+7
View File
@@ -34,6 +34,13 @@ $PAGE->set_context($context);
$PAGE->set_title($title);
$PAGE->set_heading($SITE->fullname);
// If user is logged in, then use profile navigation in breadcrumbs.
if ($profilenode = $PAGE->settingsnav->find('myprofile', null)) {
$profilenode->make_active();
}
$PAGE->navbar->add($title);
$output = $PAGE->get_renderer('tool_dataprivacy');
echo $output->header();
$summarypage = new \tool_dataprivacy\output\summary_page();
@@ -301,6 +301,11 @@ class tool_dataprivacy_api_testcase extends advanced_testcase {
$datarequest = api::create_data_request($student->id, api::DATAREQUEST_TYPE_EXPORT);
$requestid = $datarequest->get('id');
// Login as a user without DPO role.
$this->setUser($teacher);
$this->expectException(required_capability_exception::class);
api::approve_data_request($requestid);
}
/**
+3
View File
@@ -48,5 +48,8 @@ function xmldb_tool_log_upgrade($oldversion) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -49,5 +49,8 @@ function xmldb_logstore_database_upgrade($oldversion) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -49,5 +49,8 @@ function xmldb_logstore_standard_upgrade($oldversion) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -32,7 +32,7 @@
// No example context because the JS is connected to webservices
}}
<div class="float-sm-right card card-block">
<div class="float-sm-right border p-2 mb-2">
{{#hascompetencies}}
<span>
<label for="competency-nav-{{uniqid}}" class="accesshide">{{#str}}jumptocompetency, tool_lp{{/str}}</label>
@@ -82,7 +82,7 @@
{{/comppath}}
{{#usercompetencycourse}}
{{#grade}}
<span class="badge {{^proficiency}}badge-danger{{/proficiency}}">{{gradename}}</span>
<span class="badge {{#proficiency}}badge-success{{/proficiency}}{{^proficiency}}badge-danger{{/proficiency}}">{{gradename}}</span>
{{/grade}}
{{/usercompetencycourse}}
{{#canmanagecoursecompetencies}}
@@ -49,7 +49,7 @@
Template statistics template.
}}
{{#competencycount}}
<div data-region="coursecompetencystatistics" class="card">
<div data-region="coursecompetencystatistics" class="border p-2 mb-2">
{{#canbegradedincourse}}
{{< tool_lp/progress_bar}}
{{$progresstext}}
@@ -44,7 +44,7 @@
"id": 1
}
}}
<div class="card well-small evidence" data-region="evidence" data-id="{{id}}">
<div class="border p-2 mb-2 evidence" data-region="evidence" data-id="{{id}}">
{{#candelete}}
<div class="float-sm-right">
<a href="#" data-action="delete-evidence">{{#pix}}t/delete{{/pix}}</a>
@@ -50,10 +50,12 @@
<div class="col-lg-6">
<p>
<form data-region="filtercompetencies" data-frameworkid="{{framework.id}}" class="form-inline">
<div class="form-group">
<div class="input-group mb-3">
<label class="accesshide" for="filter{{uniqid}}">{{#str}}search, tool_lp{{/str}}</label>
<input class="form-control" type="text" id="filter{{uniqid}}" placeholder="{{#str}}search, tool_lp{{/str}}" value="{{search}}">
<button class="btn btn-secondary">{{#pix}}a/search, , {{#str}}search{{/str}}{{/pix}}</button>
<div class="input-group-append">
<button class="btn btn-secondary">{{#pix}}a/search, , {{#str}}search{{/str}}{{/pix}}</button>
</div>
</div>
</form>
</p>
@@ -62,8 +64,8 @@
</ul>
</div>
<div class="card col-lg-6">
<div class="card-block card-body">
<div class="col-lg-6">
<div class="border p-2 mb-2">
<div class="card-title">
<h4 data-region="selected-competency">{{#str}}selectedcompetency, tool_lp{{/str}}</h4>
<span data-region="competencyactionsmenu" class="float-sm-right">
@@ -28,7 +28,7 @@
// No example context because the JS is connected to webservices
}}
<div class="float-right card p-2">
<div class="float-right border mb-2 p-2">
<form class="user-competency-course-navigation">
<input type="hidden" name="courseid" value="{{courseid}}"/>
<input type="hidden" name="mod" value="{{moduleid}}"/>
@@ -26,10 +26,8 @@
</h2>
<div>{{{template.description}}}</div>
{{#canmanagetemplatecompetencies}}
<div data-region="actions" class="clearfix">
<div class="float-left">
<button disabled class="btn btn-secondary">{{#str}}addtemplatecompetencies, tool_lp{{/str}}</button>
</div>
<div data-region="actions" class="my-4">
<button disabled class="btn btn-secondary">{{#str}}addtemplatecompetencies, tool_lp{{/str}}</button>
</div>
{{/canmanagetemplatecompetencies}}
<h3 class="mt-1">{{#str}}templatecompetencies, tool_lp{{/str}}</h3>
@@ -41,7 +39,7 @@
<div class="drag-parentnode">
{{#competencies}}
<div class="drag-samenode" data-id="{{competency.id}}">
<div class="card">
<div class="border p-2 mb-2">
{{#canmanagetemplatecompetencies}}
<span class="drag-handlecontainer float-left"></span>
<div class="float-sm-right">
@@ -45,8 +45,7 @@
Template statistics template.
}}
{{#competencycount}}
<div data-region="templatestatistics" class="card">
<div class="card-block">
<div data-region="templatestatistics" class="border p-2 mb-2">
{{< tool_lp/progress_bar}}
{{$progresstext}}
{{#str}}xcompetencieslinkedoutofy, tool_lp, { "x": "{{linkedcompetencycount}}", "y": "{{competencycount}}" } {{/str}}
@@ -90,6 +89,5 @@
</div>
</div>
{{/leastproficientcount}}
</div>
</div>
{{/competencycount}}
@@ -35,7 +35,7 @@
// No example context because the JS is connected to webservices
}}
<div class="float-sm-right card card-block p-x-1 p-b-1">
<div class="float-sm-right border p-2 mb-2">
<p>{{{groupselector}}}</p>
<form class="user-competency-course-navigation">
<input type="hidden" name="userid" value="{{userid}}"/>
@@ -57,7 +57,7 @@
</dd>
<dt>{{#str}}proficient, tool_lp{{/str}}</dt>
<dd>
<span class="badge{{^proficiency}} badge-danger{{/proficiency}} float-left">
<span class="badge {{#proficiency}}badge-success{{/proficiency}}{{^proficiency}}badge-danger{{/proficiency}} float-left">
{{proficiencyname}}
</span>
</dd>
@@ -81,7 +81,7 @@
{{#usercompetencycourse}}
<dt>{{#str}}proficient, tool_lp{{/str}}</dt>
<dd>
<span class="badge{{^proficiency}} badge-danger{{/proficiency}} float-left">
<span class="badge {{#proficiency}}badge-success{{/proficiency}}{{^proficiency}}badge-danger{{/proficiency}} float-left">
{{proficiencyname}}
</span>
</dd>
@@ -68,7 +68,7 @@
</dd>
<dt>{{#str}}proficient, tool_lp{{/str}}</dt>
<dd>
<span class="badge{{^proficiency}} badge-danger{{/proficiency}} float-left">
<span class="badge {{#proficiency}}badge-success{{/proficiency}}{{^proficiency}}badge-danger{{/proficiency}} float-left">
{{proficiencyname}}
</span>
</dd>
@@ -101,7 +101,7 @@
<dd>{{gradename}} - {{#str}}plancompleted, tool_lp{{/str}}</dd>
<dt>{{#str}}proficient, tool_lp{{/str}}</dt>
<dd>
<span class="badge{{^proficiency}} badge-danger{{/proficiency}} float-left">
<span class="badge {{#proficiency}}badge-success{{/proficiency}}{{^proficiency}}badge-danger{{/proficiency}} float-left">
{{proficiencyname}}
</span>
</dd>
+29
View File
@@ -357,6 +357,7 @@ class api {
*/
public static function get_features_list() {
global $CFG;
require_once($CFG->libdir . '/authlib.php');
$general = new lang_string('general');
$mainmenu = new lang_string('mainmenu', 'tool_mobile');
@@ -366,6 +367,7 @@ class api {
$user = new lang_string('user');
$files = new lang_string('files');
$remoteaddons = new lang_string('remoteaddons', 'tool_mobile');
$identityproviders = new lang_string('oauth2identityproviders', 'tool_mobile');
$availablemods = core_plugin_manager::instance()->get_plugins_of_type('mod');
$coursemodules = array();
@@ -433,6 +435,8 @@ class api {
'$mmLoginEmailSignup' => new lang_string('startsignup'),
'NoDelegate_ForgottenPassword' => new lang_string('forgotten'),
'NoDelegate_ResponsiveMainMenuItems' => new lang_string('responsivemainmenuitems', 'tool_mobile'),
'NoDelegate_H5POffline' => new lang_string('h5poffline', 'tool_mobile'),
'NoDelegate_DarkMode' => new lang_string('darkmode', 'tool_mobile'),
),
"$mainmenu" => array(
'$mmSideMenuDelegate_mmaFrontpage' => new lang_string('sitehome'),
@@ -485,6 +489,31 @@ class api {
$features["$remoteaddons"] = $remoteaddonslist;
}
// Display OAuth 2 identity providers.
if (is_enabled_auth('oauth2')) {
$identityproviderslist = array();
$idps = \auth_plugin_base::get_identity_providers(['oauth2']);
foreach ($idps as $idp) {
// Only add identity providers that have an ID.
$id = isset($idp['url']) ? $idp['url']->get_param('id') : null;
if ($id != null) {
$identityproviderslist['NoDelegate_IdentityProvider_' . $id] = $idp['name'];
}
}
if (!empty($identityproviderslist)) {
$features["$identityproviders"] = array();
if (count($identityproviderslist) > 1) {
// Include an option to disable them all.
$features["$identityproviders"]['NoDelegate_IdentityProviders'] = new lang_string('all');
}
$features["$identityproviders"] = array_merge($features["$identityproviders"], $identityproviderslist);
}
}
return $features;
}
+3
View File
@@ -45,5 +45,8 @@ function xmldb_tool_mobile_upgrade($oldversion) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -45,12 +45,16 @@ $string['custommenuitems_desc'] = 'Additional items can be added to the app\'s m
Link-opening methods are: app (for linking to an activity supported by the app), inappbrowser (for opening a link in a browser without leaving the app), browser (for opening the link in the device default browser outside the app) and embedded (for displaying the link in an iframe in a new page in the app).
When items are missing a translation for a given language, they will use other languages as fallback unless "_only" is appended to the language code.
For example:
<pre>
App help|https://someurl.xyz/help|inappbrowser
My grades|https://someurl.xyz/local/mygrades/index.php|embedded|en
Mis calificaciones|https://someurl.xyz/local/mygrades/index.php|embedded|es
You will only see this in English|https://someurl.xyz/english|browser|en_only
</pre>';
$string['darkmode'] = 'Dark mode';
$string['disabledfeatures'] = 'Disabled features';
$string['disabledfeatures_desc'] = 'Select here the features you want to disable in the Mobile app for your site. Please note that some features listed here could be already disabled via other site settings. You will have to log out and log in again in the app to see the changes.';
$string['displayerrorswarning'] = 'Display debug messages (debugdisplay) is enabled. It should be disabled.';
@@ -62,6 +66,7 @@ $string['forcedurlscheme'] = 'If you want to allow only your custom branded app
$string['forcedurlscheme_key'] = 'URL scheme';
$string['forcelogout'] = 'Force log out';
$string['forcelogout_desc'] = 'If enabled, the app option \'Change site\' is replaced by \'Log out\'. This results in the user being completely logged out. They must then re-enter their password the next time they wish to access the site.';
$string['h5poffline'] = 'View H5P content offline';
$string['httpsrequired'] = 'HTTPS required';
$string['insecurealgorithmwarning'] = 'It seems that the HTTPS certificate uses an insecure algorithm for signing (SHA-1). Please try updating the certificate.';
$string['invalidcertificatechainwarning'] = 'It seems that the certificate chain is invalid.';
@@ -86,6 +91,7 @@ $string['mobilecssurl'] = 'CSS';
$string['mobilefeatures'] = 'Mobile features';
$string['mobilenotificationsdisabledwarning'] = 'Mobile notifications are not enabled. They should be enabled in Notification settings.';
$string['mobilesettings'] = 'Mobile settings';
$string['oauth2identityproviders'] = 'OAuth 2 identity providers';
$string['offlineuse'] = 'Offline use';
$string['pluginname'] = 'Moodle app tools';
$string['pluginnotenabledorconfigured'] = 'Plugin not enabled or configured.';
+7 -1
View File
@@ -30,10 +30,16 @@ require_once($CFG->libdir . '/externallib.php');
$serviceshortname = required_param('service', PARAM_ALPHANUMEXT);
$passport = required_param('passport', PARAM_RAW); // Passport send from the app to validate the response URL.
$urlscheme = optional_param('urlscheme', 'moodlemobile', PARAM_ALPHANUM); // The URL scheme the app supports.
$urlscheme = optional_param('urlscheme', 'moodlemobile', PARAM_NOTAGS); // The URL scheme the app supports.
$confirmed = optional_param('confirmed', false, PARAM_BOOL); // If we are being redirected after user confirmation.
$oauthsso = optional_param('oauthsso', 0, PARAM_INT); // Id of the OpenID issuer (for OAuth direct SSO).
// Validate that the urlscheme is valid.
if (!preg_match('/^[a-zA-Z][a-zA-Z0-9-\+\.]*$/', $urlscheme)) {
throw new moodle_exception('Invalid parameter: the value of urlscheme isn\'t valid. ' .
'It should start with a letter and can only contain letters, numbers and the characters "." "+" "-".');
}
// Check web services enabled.
if (!$CFG->enablewebservices) {
throw new moodle_exception('enablewsdescription', 'webservice');
+1 -1
View File
@@ -63,7 +63,7 @@ if ($hassiteconfig) {
$temp->add(new admin_setting_configtext('tool_mobile/forcedurlscheme',
new lang_string('forcedurlscheme_key', 'tool_mobile'),
new lang_string('forcedurlscheme', 'tool_mobile'), 'moodlemobile', PARAM_ALPHANUM));
new lang_string('forcedurlscheme', 'tool_mobile'), 'moodlemobile', PARAM_NOTAGS));
$temp->add(new admin_setting_configtext('tool_mobile/minimumversion',
new lang_string('minimumversion_key', 'tool_mobile'),
+1 -1
View File
@@ -127,7 +127,7 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
set_config('hostname', 'localhost', 'auth_cas');
set_config('auth_logo', 'http://invalidurl.com//invalid/', 'auth_cas');
set_config('auth_name', 'CAS', 'auth_cas');
set_config('auth', 'oauth2,cas');
list($authinstructions, $notusedformat) = external_format_text($authinstructions, FORMAT_MOODLE, $context->id);
+3
View File
@@ -65,5 +65,8 @@ function xmldb_tool_monitor_upgrade($oldversion) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+6 -5
View File
@@ -131,11 +131,12 @@ if ($execute) {
tool_phpunit_problem('Can not create configuration file');
}
}
$configdir = escapeshellarg($configdir);
// no cleanup of path - this is tricky because we can not use escapeshellarg and friends for escaping,
// this is from admin user so PARAM_PATH must be enough
chdir($CFG->dirroot);
passthru("php $CFG->admin/tool/phpunit/cli/util.php --run -c $configdir $testclass $testpath", $code);
$configdir = escapeshellarg($configdir);
$cleanclass = escapeshellarg($testclass);
$cleanpath = escapeshellarg($testpath);
passthru("php $CFG->admin/tool/phpunit/cli/util.php --run -c $configdir $cleanclass $cleanpath", $code);
chdir($oldcwd);
echo '</pre>';
@@ -146,7 +147,7 @@ if ($execute) {
}
echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter');
echo '<form method="get" action="webrunner.php">';
echo '<form method="post" action="webrunner.php">';
echo '<fieldset class="invisiblefieldset">';
echo '<label for="testpath">Test one file</label> ';
echo '<input type="text" id="testpath" name="testpath" value="'.s($testpath).'" size="50" /> (all test cases from webrunner.xml if empty)';
+3
View File
@@ -66,5 +66,8 @@ function xmldb_tool_policy_upgrade($oldversion) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+15 -1
View File
@@ -39,15 +39,29 @@ if ($userid != $USER->id) {
if (!has_capability('tool/policy:acceptbehalf', $context)) {
require_capability('tool/policy:viewacceptances', $context);
}
$user = core_user::get_user($userid);
$PAGE->navigation->extend_for_user($user);
}
$title = get_string('policiesagreements', 'tool_policy');
$PAGE->set_context($context);
$PAGE->set_pagelayout('standard');
$PAGE->set_url(new moodle_url('/admin/tool/policy/user.php', ['userid' => $userid]));
$PAGE->set_title($title);
if ($userid == $USER->id &&
($profilenode = $PAGE->settingsnav->find('myprofile', null))) {
$profilenode->make_active();
}
$PAGE->navbar->add($title);
$output = $PAGE->get_renderer('tool_policy');
echo $output->header();
echo $output->heading(get_string('policiesagreements', 'tool_policy'));
echo $output->heading($title);
$acceptances = new \tool_policy\output\acceptances($userid, $returnurl);
echo $output->render($acceptances);
$PAGE->requires->js_call_amd('tool_policy/acceptmodal', 'getInstance', [context_system::instance()->id]);
+2 -2
View File
@@ -100,9 +100,9 @@ if (!$problems) {
$count = $problem->racount;
$edit = array();
$aurl = new moodle_url('/admin/roles/define.php', array('roleid'=>$problem->roleid, 'action'=>'edit'));
$edit[] = html_writer::link($aurl, $OUTPUT->pix_icon('t/edit', 'core', get_string('edit')));
$edit[] = html_writer::link($aurl, $OUTPUT->pix_icon('t/edit', get_string('edit')));
$aurl = new moodle_url($PAGE->url, array('roleid'=>$problem->roleid, 'contextlevel'=>$problem->contextlevel, 'action'=>'delete'));
$edit[] = html_writer::link($aurl, $OUTPUT->pix_icon('t/delete', 'core', get_string('delete')));
$edit[] = html_writer::link($aurl, $OUTPUT->pix_icon('t/delete', get_string('delete')));
$data[] = array($levelname, $rolename, $count, implode('&nbsp;', $edit));
}
$table = new html_table();
@@ -412,6 +412,12 @@ class tool_uploadcourse_course {
$this->error('invalidshortname', new lang_string('invalidshortname', 'tool_uploadcourse'));
return false;
}
// Ensure we don't overflow the maximum length of the shortname field.
if (core_text::strlen($this->shortname) > 255) {
$this->error('invalidshortnametoolong', new lang_string('invalidshortnametoolong', 'tool_uploadcourse', 255));
return false;
}
}
$exists = $this->exists();
@@ -479,6 +485,12 @@ class tool_uploadcourse_course {
return false;
}
// Ensure we don't overflow the maximum length of the fullname field.
if (!empty($coursedata['fullname']) && core_text::strlen($coursedata['fullname']) > 254) {
$this->error('invalidfullnametoolong', new lang_string('invalidfullnametoolong', 'tool_uploadcourse', 254));
return false;
}
// If the course does not exist, or will be forced created.
if (!$exists || $mode === tool_uploadcourse_processor::MODE_CREATE_ALL) {
@@ -720,6 +732,12 @@ class tool_uploadcourse_course {
}
}
// Visibility can only be 0 or 1.
if (!empty($coursedata['visible']) AND !($coursedata['visible'] == 0 OR $coursedata['visible'] == 1)) {
$this->error('invalidvisibilitymode', new lang_string('invalidvisibilitymode', 'tool_uploadcourse'));
return false;
}
// Saving data.
$this->data = $coursedata;
$this->enrolmentdata = tool_uploadcourse_helper::get_enrolment_data($this->rawdata);
@@ -90,8 +90,11 @@ $string['invalidcsvfile'] = 'Invalid input CSV file';
$string['invalidencoding'] = 'Invalid encoding';
$string['invalidmode'] = 'Invalid mode selected';
$string['invalideupdatemode'] = 'Invalid update mode selected';
$string['invalidvisibilitymode'] = 'Invalid visible mode';
$string['invalidroles'] = 'Invalid role names: {$a}';
$string['invalidshortname'] = 'Invalid shortname';
$string['invalidfullnametoolong'] = 'The fullname field is limited to {$a} characters';
$string['invalidshortnametoolong'] = 'The shortname field is limited to {$a} characters';
$string['missingmandatoryfields'] = 'Missing value for mandatory fields: {$a}';
$string['missingshortnamenotemplate'] = 'Missing shortname and shortname template not set';
$string['mode'] = 'Upload mode';
@@ -82,6 +82,47 @@ class tool_uploadcourse_course_testcase extends advanced_testcase {
$this->assertArrayHasKey('invalidshortname', $co->get_errors());
}
public function test_invalid_shortname_too_long() {
$this->resetAfterTest();
$mode = tool_uploadcourse_processor::MODE_CREATE_NEW;
$updatemode = tool_uploadcourse_processor::UPDATE_NOTHING;
$upload = new tool_uploadcourse_course($mode, $updatemode, [
'category' => 1,
'fullname' => 'New course',
'shortname' => str_repeat('X', 2000),
]);
$this->assertFalse($upload->prepare());
$this->assertArrayHasKey('invalidshortnametoolong', $upload->get_errors());
}
public function test_invalid_fullname_too_long() {
$this->resetAfterTest();
$mode = tool_uploadcourse_processor::MODE_CREATE_NEW;
$updatemode = tool_uploadcourse_processor::UPDATE_NOTHING;
$upload = new tool_uploadcourse_course($mode, $updatemode, [
'category' => 1,
'fullname' => str_repeat('X', 2000),
]);
$this->assertFalse($upload->prepare());
$this->assertArrayHasKey('invalidfullnametoolong', $upload->get_errors());
}
public function test_invalid_visibility() {
$this->resetAfterTest(true);
$mode = tool_uploadcourse_processor::MODE_CREATE_NEW;
$updatemode = tool_uploadcourse_processor::UPDATE_NOTHING;
$data = array('shortname' => 'test', 'fullname' => 'New course', 'summary' => 'New', 'category' => 1, 'visible' => 2);
$co = new tool_uploadcourse_course($mode, $updatemode, $data);
$this->assertFalse($co->prepare());
$this->assertArrayHasKey('invalidvisibilitymode', $co->get_errors());
}
public function test_create() {
global $DB;
$this->resetAfterTest(true);
+3
View File
@@ -64,5 +64,8 @@ function xmldb_tool_usertours_upgrade($oldversion) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+1 -1
View File
@@ -41,7 +41,7 @@ class test_analysis extends \core_analytics\analysis {
*/
public function process_analysable(\core_analytics\analysable $analysable): array {
// Half a second.
usleep(500000);
sleep(1);
return parent::process_analysable($analysable);
}
}
+1 -1
View File
@@ -292,7 +292,7 @@ class analytics_model_testcase extends advanced_testcase {
$this->resetAfterTest(true);
set_config('modeltimelimit', 1, 'analytics');
set_config('modeltimelimit', 2, 'analytics');
$courses = array();
for ($i = 0; $i < 5; $i++) {
+3
View File
@@ -54,5 +54,8 @@ function xmldb_auth_cas_upgrade($oldversion) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+3
View File
@@ -54,5 +54,8 @@ function xmldb_auth_db_upgrade($oldversion) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+1 -1
View File
@@ -146,7 +146,7 @@ class auth_email_external extends external_api {
new external_single_structure(
array(
'id' => new external_value(PARAM_INT, 'Profile field id', VALUE_OPTIONAL),
'shortname' => new external_value(PARAM_ALPHANUM, 'Password policy', VALUE_OPTIONAL),
'shortname' => new external_value(PARAM_ALPHANUMEXT, 'Profile field shortname', VALUE_OPTIONAL),
'name' => new external_value(PARAM_TEXT, 'Profield field name', VALUE_OPTIONAL),
'datatype' => new external_value(PARAM_ALPHANUMEXT, 'Profield field datatype', VALUE_OPTIONAL),
'description' => new external_value(PARAM_RAW, 'Profield field description', VALUE_OPTIONAL),
+3
View File
@@ -54,5 +54,8 @@ function xmldb_auth_email_upgrade($oldversion) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+82 -12
View File
@@ -691,6 +691,7 @@ class auth_plugin_ldap extends auth_plugin_base {
////
// prepare some data we'll need
$filter = '(&('.$this->config->user_attribute.'=*)'.$this->config->objectclass.')';
$servercontrols = array();
$contexts = explode(';', $this->config->contexts);
@@ -708,24 +709,58 @@ class auth_plugin_ldap extends auth_plugin_base {
do {
if ($ldappagedresults) {
ldap_control_paged_result($ldapconnection, $this->config->pagesize, true, $ldapcookie);
// TODO: Remove the old branch of code once PHP 7.3.0 becomes required (Moodle 4.1).
if (version_compare(PHP_VERSION, '7.3.0', '<')) {
// Before 7.3, use this function that was deprecated in PHP 7.4.
ldap_control_paged_result($ldapconnection, $this->config->pagesize, true, $ldapcookie);
} else {
// PHP 7.3 and up, use server controls.
$servercontrols = array(array(
'oid' => LDAP_CONTROL_PAGEDRESULTS, 'value' => array(
'size' => $this->config->pagesize, 'cookie' => $ldapcookie)));
}
}
if ($this->config->search_sub) {
// Use ldap_search to find first user from subtree.
$ldapresult = ldap_search($ldapconnection, $context, $filter, array($this->config->user_attribute));
// TODO: Remove the old branch of code once PHP 7.3.0 becomes required (Moodle 4.1).
if (version_compare(PHP_VERSION, '7.3.0', '<')) {
$ldapresult = ldap_search($ldapconnection, $context, $filter, array($this->config->user_attribute));
} else {
$ldapresult = ldap_search($ldapconnection, $context, $filter, array($this->config->user_attribute),
0, -1, -1, LDAP_DEREF_NEVER, $servercontrols);
}
} else {
// Search only in this context.
$ldapresult = ldap_list($ldapconnection, $context, $filter, array($this->config->user_attribute));
// TODO: Remove the old branch of code once PHP 7.3.0 becomes required (Moodle 4.1).
if (version_compare(PHP_VERSION, '7.3.0', '<')) {
$ldapresult = ldap_list($ldapconnection, $context, $filter, array($this->config->user_attribute));
} else {
$ldapresult = ldap_list($ldapconnection, $context, $filter, array($this->config->user_attribute),
0, -1, -1, LDAP_DEREF_NEVER, $servercontrols);
}
}
if (!$ldapresult) {
continue;
}
if ($ldappagedresults) {
$pagedresp = ldap_control_paged_result_response($ldapconnection, $ldapresult, $ldapcookie);
// Function ldap_control_paged_result_response() does not overwrite $ldapcookie if it fails, by
// setting this to null we avoid an infinite loop.
if ($pagedresp === false) {
$ldapcookie = null;
// Get next server cookie to know if we'll need to continue searching.
$ldapcookie = '';
// TODO: Remove the old branch of code once PHP 7.3.0 becomes required (Moodle 4.1).
if (version_compare(PHP_VERSION, '7.3.0', '<')) {
// Before 7.3, use this function that was deprecated in PHP 7.4.
$pagedresp = ldap_control_paged_result_response($ldapconnection, $ldapresult, $ldapcookie);
// Function ldap_control_paged_result_response() does not overwrite $ldapcookie if it fails, by
// setting this to null we avoid an infinite loop.
if ($pagedresp === false) {
$ldapcookie = null;
}
} else {
// Get next cookie from controls.
ldap_parse_result($ldapconnection, $ldapresult, $errcode, $matcheddn,
$errmsg, $referrals, $controls);
if (isset($controls[LDAP_CONTROL_PAGEDRESULTS]['value']['cookie'])) {
$ldapcookie = $controls[LDAP_CONTROL_PAGEDRESULTS]['value']['cookie'];
}
}
}
if ($entry = @ldap_first_entry($ldapconnection, $ldapresult)) {
@@ -1504,6 +1539,7 @@ class auth_plugin_ldap extends auth_plugin_base {
if ($filter == '*') {
$filter = '(&('.$this->config->user_attribute.'=*)'.$this->config->objectclass.')';
}
$servercontrols = array();
$contexts = explode(';', $this->config->contexts);
if (!empty($this->config->create_context)) {
@@ -1520,20 +1556,54 @@ class auth_plugin_ldap extends auth_plugin_base {
do {
if ($ldap_pagedresults) {
ldap_control_paged_result($ldapconnection, $this->config->pagesize, true, $ldap_cookie);
// TODO: Remove the old branch of code once PHP 7.3.0 becomes required (Moodle 4.1).
if (version_compare(PHP_VERSION, '7.3.0', '<')) {
// Before 7.3, use this function that was deprecated in PHP 7.4.
ldap_control_paged_result($ldapconnection, $this->config->pagesize, true, $ldap_cookie);
} else {
// PHP 7.3 and up, use server controls.
$servercontrols = array(array(
'oid' => LDAP_CONTROL_PAGEDRESULTS, 'value' => array(
'size' => $this->config->pagesize, 'cookie' => $ldap_cookie)));
}
}
if ($this->config->search_sub) {
// Use ldap_search to find first user from subtree.
$ldap_result = ldap_search($ldapconnection, $context, $filter, array($this->config->user_attribute));
// TODO: Remove the old branch of code once PHP 7.3.0 becomes required (Moodle 4.1).
if (version_compare(PHP_VERSION, '7.3.0', '<')) {
$ldap_result = ldap_search($ldapconnection, $context, $filter, array($this->config->user_attribute));
} else {
$ldap_result = ldap_search($ldapconnection, $context, $filter, array($this->config->user_attribute),
0, -1, -1, LDAP_DEREF_NEVER, $servercontrols);
}
} else {
// Search only in this context.
$ldap_result = ldap_list($ldapconnection, $context, $filter, array($this->config->user_attribute));
// TODO: Remove the old branch of code once PHP 7.3.0 becomes required (Moodle 4.1).
if (version_compare(PHP_VERSION, '7.3.0', '<')) {
$ldap_result = ldap_list($ldapconnection, $context, $filter, array($this->config->user_attribute));
} else {
$ldap_result = ldap_list($ldapconnection, $context, $filter, array($this->config->user_attribute),
0, -1, -1, LDAP_DEREF_NEVER, $servercontrols);
}
}
if(!$ldap_result) {
continue;
}
if ($ldap_pagedresults) {
ldap_control_paged_result_response($ldapconnection, $ldap_result, $ldap_cookie);
// Get next server cookie to know if we'll need to continue searching.
$ldap_cookie = '';
// TODO: Remove the old branch of code once PHP 7.3.0 becomes required (Moodle 4.1).
if (version_compare(PHP_VERSION, '7.3.0', '<')) {
// Before 7.3, use this function that was deprecated in PHP 7.4.
ldap_control_paged_result_response($ldapconnection, $ldap_result, $ldap_cookie);
} else {
// Get next cookie from controls.
ldap_parse_result($ldapconnection, $ldap_result, $errcode, $matcheddn,
$errmsg, $referrals, $controls);
if (isset($controls[LDAP_CONTROL_PAGEDRESULTS]['value']['cookie'])) {
$ldap_cookie = $controls[LDAP_CONTROL_PAGEDRESULTS]['value']['cookie'];
}
}
}
$users = ldap_get_entries_moodle($ldapconnection, $ldap_result);
// Add found users to list.
+3
View File
@@ -72,5 +72,8 @@ function xmldb_auth_ldap_upgrade($oldversion) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+32 -3
View File
@@ -36,7 +36,36 @@ defined('MOODLE_INTERNAL') || die();
class auth_ldap_plugin_testcase extends advanced_testcase {
public function test_auth_ldap() {
/**
* Data provider for auth_ldap tests
*
* Used to ensure that all the paged stuff works properly, irrespectively
* of the pagesize configured (that implies all the chunking and paging
* built in the plugis is doing its work consistently). Both searching and
* not searching within subcontexts.
*
* @return array[]
*/
public function auth_ldap_provider() {
$pagesizes = [1, 3, 5, 1000];
$subcontexts = [0, 1];
$combinations = [];
foreach ($pagesizes as $pagesize) {
foreach ($subcontexts as $subcontext) {
$combinations["pagesize {$pagesize}, subcontexts {$subcontext}"] = [$pagesize, $subcontext];
}
}
return $combinations;
}
/**
* General auth_ldap testcase
*
* @dataProvider auth_ldap_provider
* @param int $pagesize Value to be configured in settings controlling page size.
* @param int $subcontext Value to be configured in settings controlling searching in subcontexts.
*/
public function test_auth_ldap(int $pagesize, int $subcontext) {
global $CFG, $DB;
if (!extension_loaded('ldap')) {
@@ -100,12 +129,12 @@ class auth_ldap_plugin_testcase extends advanced_testcase {
set_config('start_tls', 0, 'auth_ldap');
set_config('ldap_version', 3, 'auth_ldap');
set_config('ldapencoding', 'utf-8', 'auth_ldap');
set_config('pagesize', '2', 'auth_ldap');
set_config('pagesize', $pagesize, 'auth_ldap');
set_config('bind_dn', TEST_AUTH_LDAP_BIND_DN, 'auth_ldap');
set_config('bind_pw', TEST_AUTH_LDAP_BIND_PW, 'auth_ldap');
set_config('user_type', 'rfc2307', 'auth_ldap');
set_config('contexts', 'ou=users,'.$topdn, 'auth_ldap');
set_config('search_sub', 0, 'auth_ldap');
set_config('search_sub', $subcontext, 'auth_ldap');
set_config('opt_deref', LDAP_DEREF_NEVER, 'auth_ldap');
set_config('user_attribute', 'cn', 'auth_ldap');
set_config('memberattribute', 'memberuid', 'auth_ldap');
+3
View File
@@ -54,5 +54,8 @@ function xmldb_auth_manual_upgrade($oldversion) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+3
View File
@@ -54,5 +54,8 @@ function xmldb_auth_mnet_upgrade($oldversion) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+3
View File
@@ -54,5 +54,8 @@ function xmldb_auth_none_upgrade($oldversion) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+3
View File
@@ -84,5 +84,8 @@ function xmldb_auth_oauth2_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2019052001, 'auth', 'oauth2');
}
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+2 -1
View File
@@ -263,7 +263,8 @@ class auth_plugin_shibboleth extends auth_plugin_base {
global $OUTPUT;
if (!isset($this->config->user_attribute) || empty($this->config->user_attribute)) {
echo $OUTPUT->notification(get_string("shib_not_set_up_error", "auth_shibboleth"), 'notifyproblem');
echo $OUTPUT->notification(get_string("shib_not_set_up_error", "auth_shibboleth",
(new moodle_url('/auth/shibboleth/README.txt'))->out()), 'notifyproblem');
return;
}
if ($this->config->convert_data and $this->config->convert_data != '' and !is_readable($this->config->convert_data)) {
+3
View File
@@ -54,5 +54,8 @@ function xmldb_auth_shibboleth_upgrade($oldversion) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+3 -2
View File
@@ -32,8 +32,9 @@
$shibbolethauth = get_auth_plugin('shibboleth');
// Check whether Shibboleth is configured properly
$readmeurl = (new moodle_url('/auth/shibboleth/README.txt'))->out();
if (empty($pluginconfig->user_attribute)) {
print_error('shib_not_set_up_error', 'auth_shibboleth');
print_error('shib_not_set_up_error', 'auth_shibboleth', '', $readmeurl);
}
/// If we can find the Shibboleth attribute, save it in session and return to main login page
@@ -91,7 +92,7 @@
elseif (!empty($_SERVER['HTTP_SHIB_APPLICATION_ID']) || !empty($_SERVER['Shib-Application-ID'])) {
print_error('shib_no_attributes_error', 'auth_shibboleth' , '', '\''.$pluginconfig->user_attribute.'\', \''.$pluginconfig->field_map_firstname.'\', \''.$pluginconfig->field_map_lastname.'\' and \''.$pluginconfig->field_map_email.'\'');
} else {
print_error('shib_not_set_up_error', 'auth_shibboleth');
print_error('shib_not_set_up_error', 'auth_shibboleth', '', $readmeurl);
}
+3 -3
View File
@@ -28,7 +28,7 @@ $string['auth_shib_auth_method_description'] = 'Provide a name for the Shibbolet
$string['auth_shib_auth_logo'] = 'Authentication method logo';
$string['auth_shib_auth_logo_description'] = 'Provide a logo for the Shibboleth authentication method that is familiar to your users. This could be the logo of your Shibboleth federation, e.g. <tt>SWITCHaai Login</tt> or <tt>InCommon Login</tt> or similar.';
$string['auth_shib_contact_administrator'] = 'In case you are not associated with the given organizations and you need access to a course on this server, please contact the <a href="mailto:{$a}">Moodle Administrator</a>.';
$string['auth_shibbolethdescription'] = 'Using this method users are created and authenticated using Shibboleth. For set-up details, see the <a href="../auth/shibboleth/README.txt">Shibboleth README</a>.';
$string['auth_shibbolethdescription'] = 'Using this method users are created and authenticated using Shibboleth. For set-up details, see the <a href="{$a}">Shibboleth README</a>.';
$string['auth_shibboleth_errormsg'] = 'Please select the organization you are member of!';
$string['auth_shibboleth_login'] = 'Shibboleth login';
$string['auth_shibboleth_login_long'] = 'Login to Moodle via Shibboleth';
@@ -36,7 +36,7 @@ $string['auth_shibboleth_manual_login'] = 'Manual login';
$string['auth_shibboleth_select_member'] = 'I\'m a member of ...';
$string['auth_shibboleth_select_organization'] = 'For authentication via Shibboleth, please select your organisation from the drop-down menu:';
$string['auth_shib_convert_data'] = 'Data modification API';
$string['auth_shib_convert_data_description'] = 'You can use this API to further modify the data provided by Shibboleth. Read the <a href="../auth/shibboleth/README.txt">README</a> for further instructions.';
$string['auth_shib_convert_data_description'] = 'You can use this API to further modify the data provided by Shibboleth. Read the <a href="{$a}">README</a> for further instructions.';
$string['auth_shib_convert_data_warning'] = 'The file does not exist or is not readable by the webserver process!';
$string['auth_shib_changepasswordurl'] = 'Password-change URL';
$string['auth_shib_idp_list'] = 'Identity providers';
@@ -57,6 +57,6 @@ $string['auth_shib_username_description'] = 'Name of the webserver Shibboleth en
$string['shib_invalid_account_error'] = 'You seem to be Shibboleth authenticated but Moodle has no valid account for your username. Your account may not exist or it may have been suspended.';
$string['shib_no_attributes_error'] = 'You seem to be Shibboleth authenticated but Moodle didn\'t receive any user attributes. Please check that your Identity Provider releases the necessary attributes ({$a}) to the Service Provider Moodle is running on or inform the webmaster of this server.';
$string['shib_not_all_attributes_error'] = 'Moodle needs certain Shibboleth attributes which are not present in your case. The attributes are: {$a}<br />Please contact the webmaster of this server or your Identity Provider.';
$string['shib_not_set_up_error'] = 'Shibboleth authentication doesn\'t seem to be set up correctly because no Shibboleth environment variables are present for this page. Please consult the <a href="README.txt">README</a> for further instructions on how to set up Shibboleth authentication or contact the webmaster of this Moodle installation.';
$string['shib_not_set_up_error'] = 'Shibboleth authentication doesn\'t seem to be set up correctly because no Shibboleth environment variables are present for this page. Please consult the <a href="{$a}">README</a> for further instructions on how to set up Shibboleth authentication or contact the webmaster of this Moodle installation.';
$string['pluginname'] = 'Shibboleth';
$string['privacy:metadata'] = 'The Shibboleth authentication plugin does not store any personal data.';
+3 -2
View File
@@ -30,8 +30,9 @@ if ($ADMIN->fulltree) {
require_once($CFG->dirroot.'/auth/shibboleth/classes/admin_setting_special_idp_configtextarea.php');
// Introductory explanation.
$readmeurl = (new moodle_url('/auth/shibboleth/README.txt'))->out();
$settings->add(new admin_setting_heading('auth_shibboleth/pluginname', '',
new lang_string('auth_shibbolethdescription', 'auth_shibboleth')));
new lang_string('auth_shibbolethdescription', 'auth_shibboleth', $readmeurl)));
// Username.
$settings->add(new admin_setting_configtext('auth_shibboleth/user_attribute', get_string('username'),
@@ -40,7 +41,7 @@ if ($ADMIN->fulltree) {
// COnvert Data configuration file.
$settings->add(new admin_setting_configfile('auth_shibboleth/convert_data',
get_string('auth_shib_convert_data', 'auth_shibboleth'),
get_string('auth_shib_convert_data_description', 'auth_shibboleth'), ''));
get_string('auth_shib_convert_data_description', 'auth_shibboleth', $readmeurl), ''));
// WAYF.
$settings->add(new auth_shibboleth_admin_setting_special_wayf_select());
-1
View File
@@ -91,7 +91,6 @@ class core_backup_external extends external_api {
require_capability('moodle/backup:backupactivity', $context);
} else {
require_capability('moodle/backup:backupcourse', $context);
$instanceid = $course->id;
}
$results = array();
+2 -2
View File
@@ -55,9 +55,11 @@ require_capability('moodle/restore:restorecourse', $context);
if (is_null($course)) {
$coursefullname = $SITE->fullname;
$courseshortname = $SITE->shortname;
$courseurl = new moodle_url('/');
} else {
$coursefullname = $course->fullname;
$courseshortname = $course->shortname;
$courseurl = course_get_url($course->id);
}
// Show page header.
@@ -173,7 +175,6 @@ if ($restore->get_stage() != restore_ui::STAGE_PROCESS) {
\core\task\manager::queue_adhoc_task($asynctask);
// Add ajax progress bar and initiate ajax via a template.
$courseurl = new moodle_url('/course/view.php', array('id' => $course->id));
$restoreurl = new moodle_url('/backup/restorefile.php', array('contextid' => $contextid));
$progresssetup = array(
'backupid' => $restoreid,
@@ -182,7 +183,6 @@ if ($restore->get_stage() != restore_ui::STAGE_PROCESS) {
'restoreurl' => $restoreurl->out()
);
echo $renderer->render_from_template('core/async_backup_status', $progresssetup);
}
$restore->destroy();
+2 -1
View File
@@ -36,7 +36,8 @@ if (empty($CFG->enablebadges)) {
$hash = required_param('b', PARAM_ALPHANUM); // Issued badge unique hash for badge assertion.
$action = optional_param('action', null, PARAM_BOOL); // Generates badge class if true.
$obversion = optional_param('obversion', OPEN_BADGES_V1, PARAM_INT); // For control format OB specification version.
// OB specification version. If it's not defined, the site will be used as default.
$obversion = optional_param('obversion', badges_open_badges_backpack_api(), PARAM_INT);
$assertion = new core_badges_assertion($hash, $obversion);
+4 -4
View File
@@ -199,7 +199,7 @@ class core_badges_assertion {
$class['criteria'] = $this->_url->out(false); // Currently issued badge URL.
if ($issued) {
if ($this->_obversion == OPEN_BADGES_V2) {
$issuerurl = new moodle_url('/badges/badge_json.php', array('id' => $this->get_badge_id(), 'action' => 0));
$issuerurl = new moodle_url('/badges/issuer_json.php', array('id' => $this->get_badge_id()));
} else {
$issuerurl = new moodle_url('/badges/assertion.php', array('b' => $this->_data->uniquehash, 'action' => 0));
}
@@ -233,7 +233,8 @@ class core_badges_assertion {
$issuer['email'] = $CFG->badges_defaultissuercontact;
}
} else {
$issuer = badges_get_default_issuer();
$badge = new badge($this->get_badge_id());
$issuer = $badge->get_badge_issuer();
}
}
$this->embed_data_badge_version2($issuer, OPEN_BADGES_V2_TYPE_ISSUER);
@@ -341,8 +342,7 @@ class core_badges_assertion {
'/badges/badge_json.php',
array('id' => $this->get_badge_id())
);
$issuerurl = new moodle_url('/badges/badge_json.php', array('id' => $this->get_badge_id(), 'action' => 0,
'obversion' => $this->_obversion));
$issuerurl = new moodle_url('/badges/issuer_json.php', ['id' => $this->get_badge_id()]);
// For assertion.
if ($type == OPEN_BADGES_V2_TYPE_ASSERTION) {
$json['@context'] = OPEN_BADGES_V2_CONTEXT;
+2 -2
View File
@@ -929,12 +929,12 @@ class badge {
*/
public function get_badge_issuer() {
$issuer = array();
$issuerurl = new moodle_url('/badges/badge_json.php', array('id' => $this->id, 'action' => 0));
$issuer['name'] = $this->issuername;
$issuer['url'] = $this->issuerurl;
$issuer['email'] = $this->issuercontact;
$issuer['@context'] = OPEN_BADGES_V2_CONTEXT;
$issuer['id'] = $this->issuerurl;
$issueridurl = new moodle_url('/badges/issuer_json.php', array('id' => $this->id));
$issuer['id'] = $issueridurl->out(false);
$issuer['type'] = OPEN_BADGES_V2_TYPE_ISSUER;
return $issuer;
}
+12 -2
View File
@@ -49,7 +49,6 @@ class badge extends moodleform {
$mform = $this->_form;
$badge = (isset($this->_customdata['badge'])) ? $this->_customdata['badge'] : false;
$action = $this->_customdata['action'];
$languages = get_string_manager()->get_list_of_languages();
$mform->addElement('header', 'badgedetails', get_string('badgedetails', 'badges'));
$mform->addElement('text', 'name', get_string('name'), array('size' => '70'));
@@ -61,6 +60,8 @@ class badge extends moodleform {
$mform->addElement('text', 'version', get_string('version', 'badges'), array('size' => '70'));
$mform->setType('version', PARAM_TEXT);
$mform->addHelpButton('version', 'version', 'badges');
$languages = get_string_manager()->get_list_of_languages();
$mform->addElement('select', 'language', get_string('language'), $languages);
$mform->addHelpButton('language', 'language', 'badges');
@@ -157,7 +158,16 @@ class badge extends moodleform {
$mform->setType('action', PARAM_TEXT);
if ($action == 'new') {
$mform->setDefault('language', $CFG->lang);
// Try to set default badge language to that of current language, or it's parent.
$language = current_language();
if (isset($languages[$language])) {
$defaultlanguage = $language;
} else {
// Calling get_parent_language returns an empty string instead of 'en'.
$defaultlanguage = get_parent_language($language) ?: 'en';
}
$mform->setDefault('language', $defaultlanguage);
$this->add_action_buttons(true, get_string('createbutton', 'badges'));
} else {
// Add hidden fields.
+5 -1
View File
@@ -54,6 +54,9 @@ class issued_badge implements renderable {
/** @var badge class */
public $badgeid = 0;
/** @var unique hash identifying the issued badge */
public $hash;
/**
* Initializes the badge to display
*
@@ -62,7 +65,8 @@ class issued_badge implements renderable {
public function __construct($hash) {
global $DB;
$assertion = new \core_badges_assertion($hash);
$this->hash = $hash;
$assertion = new \core_badges_assertion($hash, badges_open_badges_backpack_api());
$this->issued = $assertion->get_badge_assertion();
$this->badgeclass = $assertion->get_badge_class();
+52
View File
@@ -0,0 +1,52 @@
<?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/>.
/**
* Serve Issuer JSON for related badge or default Issuer if no badge is defined.
*
* @package core
* @subpackage badges
* @copyright 2020 Sara Arjona <sara@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('AJAX_SCRIPT', true);
define('NO_MOODLE_COOKIES', true); // No need for a session here.
require_once(__DIR__ . '/../config.php');
require_once($CFG->libdir . '/badgeslib.php');
$id = optional_param('id', null, PARAM_INT);
if (empty($id)) {
// Get the default issuer for this site.
$json = badges_get_default_issuer();
} else {
// Get the issuer for this badge.
$badge = new badge($id);
if ($badge->status != BADGE_STATUS_INACTIVE) {
$json = $badge->get_badge_issuer();
} else {
// The badge doen't exist or not accessible for the users.
header("HTTP/1.0 410 Gone");
$badgeurl = new moodle_url('/badges/issuer_json.php', array('id' => $id));
$json = ['id' => $badgeurl->out()];
$json['error'] = get_string('error:relatedbadgedoesntexist', 'badges');
}
}
echo $OUTPUT->header();
echo json_encode($json);
+41 -5
View File
@@ -114,23 +114,59 @@ class PNG_MetaDataHandler
* @param string $value Currently an assertion URL that is added to an image metadata.
*
* @return string $result File content with a new chunk as a string. Can be used in file_put_contents() to write to a file.
* @throws \moodle_exception when unsupported chunk type is defined.
*/
public function add_chunks($type, $key, $value) {
if (strlen($key) > 79) {
debugging('Key is too big');
}
// tEXt Textual data.
// Keyword: 1-79 bytes (character string)
// Null separator: 1 byte
// Text: n bytes (character string)
$data = $key . "\0" . $value;
$dataparts = [];
if ($type === 'iTXt') {
// International textual data (iTXt).
// Keyword: 1-79 bytes (character string).
$dataparts[] = $key;
// Null separator: 1 byte.
$dataparts[] = "\x00";
// Compression flag: 1 byte
// A value of 0 means no compression.
$dataparts[] = "\x00";
// Compression method: 1 byte
// If compression is disabled, the method should also be 0.
$dataparts[] = "\x00";
// Language tag: 0 or more bytes (character string)
// When there is no language specified leave empty.
// Null separator: 1 byte.
$dataparts[] = "\x00";
// Translated keyword: 0 or more bytes
// When there is no translation specified, leave empty.
// Null separator: 1 byte.
$dataparts[] = "\x00";
// Text: 0 or more bytes.
$dataparts[] = $value;
} else if ($type === 'tEXt') {
// Textual data (tEXt).
// Keyword: 1-79 bytes (character string).
$dataparts[] = $key;
// Null separator: 1 byte.
$dataparts[] = "\0";
// Text: n bytes (character string).
$dataparts[] = $value;
} else {
throw new \moodle_exception('Unsupported chunk type: ' . $type);
}
$data = implode($dataparts);
$crc = pack("N", crc32($type . $data));
$len = pack("N", strlen($data));
// Chunk format: length + type + data + CRC.
// CRC is a CRC-32 computed over the chunk type and chunk data.
$newchunk = $len . $type . $data . $crc;
$this->_chunks[$type] = $data;
$result = substr($this->_contents, 0, $this->_size - 12)
. $newchunk
+3 -3
View File
@@ -337,13 +337,13 @@ class core_badges_renderer extends plugin_renderer_base {
if ($USER->id == $userinfo->id && !empty($CFG->enablebadges)) {
$output .= $this->output->single_button(
new moodle_url('/badges/badge.php', array('hash' => $issued['uid'], 'bake' => true)),
new moodle_url('/badges/badge.php', array('hash' => $ibadge->hash, 'bake' => true)),
get_string('download'),
'POST');
if (!empty($CFG->badges_allowexternalbackpack) && ($expiration > $now) && badges_user_has_backpack($USER->id)) {
if (badges_open_badges_backpack_api() == OPEN_BADGES_V1) {
$assertion = new moodle_url('/badges/assertion.php', array('b' => $issued['uid']));
$assertion = new moodle_url('/badges/assertion.php', array('b' => $ibadge->hash));
$action = new component_action('click', 'addtobackpack', array('assertion' => $assertion->out(false)));
$attributes = array(
'type' => 'button',
@@ -354,7 +354,7 @@ class core_badges_renderer extends plugin_renderer_base {
$this->output->add_action_handler($action, 'addbutton');
$output .= $tobackpack;
} else {
$assertion = new moodle_url('/badges/backpack-add.php', array('hash' => $issued['uid']));
$assertion = new moodle_url('/badges/backpack-add.php', array('hash' => $ibadge->hash));
$attributes = ['class' => 'btn btn-secondary m-1', 'role' => 'button'];
$tobackpack = html_writer::link($assertion, get_string('addtobackpack', 'badges'), $attributes);
$output .= $tobackpack;
+3
View File
@@ -60,5 +60,8 @@ function xmldb_block_badges_upgrade($oldversion, $block) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+1 -1
View File
@@ -234,7 +234,7 @@ function block_blog_tags_sort($a, $b) {
}
if (is_numeric($a->$tagsort)) {
return ($a->$tagsort == $b->$tagsort) ? 0 : ($a->$tagsort > $b->$tagsort) ? 1 : -1;
return (($a->$tagsort == $b->$tagsort) ? 0 : ($a->$tagsort > $b->$tagsort)) ? 1 : -1;
} elseif (is_string($a->$tagsort)) {
return strcmp($a->$tagsort, $b->$tagsort); //TODO: this is not compatible with UTF-8!!
} else {
+3
View File
@@ -60,5 +60,8 @@ function xmldb_block_calendar_month_upgrade($oldversion, $block) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+3
View File
@@ -60,5 +60,8 @@ function xmldb_block_calendar_upcoming_upgrade($oldversion, $block) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+3
View File
@@ -63,5 +63,8 @@ function xmldb_block_completionstatus_upgrade($oldversion, $block) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+3
View File
@@ -63,5 +63,8 @@ function xmldb_block_course_summary_upgrade($oldversion, $block) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+3
View File
@@ -48,5 +48,8 @@ function xmldb_block_html_upgrade($oldversion) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+14 -6
View File
@@ -121,7 +121,7 @@ class main implements renderable, templatable {
*
* @var boolean
*/
private $displaygroupingstarred;
private $displaygroupingfavourites;
/**
* Store a course grouping option setting.
@@ -168,7 +168,13 @@ class main implements renderable, templatable {
$config = get_config('block_myoverview');
// Build the course grouping option name to check if the given grouping is enabled afterwards.
$groupingconfigname = 'displaygrouping'.$grouping;
if ($grouping === 'favourites') {
// There was a mismatch in parts of block between the name starred and favourites. This helps fix that.
$groupingconfigname = 'displaygroupingstarred';
} else {
$groupingconfigname = 'displaygrouping'.$grouping;
}
// Check the given grouping and remember it if it is enabled.
if ($grouping && $config->$groupingconfigname == true) {
$this->grouping = $grouping;
@@ -214,7 +220,7 @@ class main implements renderable, templatable {
$this->displaygroupinginprogress = $config->displaygroupinginprogress;
$this->displaygroupingfuture = $config->displaygroupingfuture;
$this->displaygroupingpast = $config->displaygroupingpast;
$this->displaygroupingstarred = $config->displaygroupingstarred;
$this->displaygroupingfavourites = $config->displaygroupingstarred; // Note the name mismatch!
$this->displaygroupinghidden = $config->displaygroupinghidden;
$this->displaygroupingcustomfield = ($config->displaygroupingcustomfield && $config->customfiltergrouping);
$this->customfiltergrouping = $config->customfiltergrouping;
@@ -226,7 +232,7 @@ class main implements renderable, templatable {
$this->displaygroupinginprogress,
$this->displaygroupingfuture,
$this->displaygroupingpast,
$this->displaygroupingstarred,
$this->displaygroupingfavourites,
$this->displaygroupinghidden);
$displaygroupingselectorscount = count(array_filter($displaygroupingselectors));
if ($displaygroupingselectorscount > 1 || $this->displaygroupingcustomfield) {
@@ -366,7 +372,9 @@ class main implements renderable, templatable {
return [];
}
$field = \core_customfield\field_controller::create($fieldid);
if (!$field->supports_course_grouping()) {
$isvisible = $field->get_configdata_property('visibility') == \core_course\customfield\course_handler::VISIBLETOALL;
// Only visible fields to everybody supporting course grouping will be displayed.
if (!$field->supports_course_grouping() || !$isvisible) {
return []; // The field shouldn't have been selectable in the global settings, but just skip it now.
}
$values = $field->course_grouping_format_values($values);
@@ -437,7 +445,7 @@ class main implements renderable, templatable {
'displaygroupinginprogress' => $this->displaygroupinginprogress,
'displaygroupingfuture' => $this->displaygroupingfuture,
'displaygroupingpast' => $this->displaygroupingpast,
'displaygroupingstarred' => $this->displaygroupingstarred,
'displaygroupingstarred' => $this->displaygroupingfavourites, // Note the name mismatch!
'displaygroupinghidden' => $this->displaygroupinghidden,
'displaygroupingselector' => $this->displaygroupingselector,
'displaygroupingcustomfield' => $this->displaygroupingcustomfield && $customfieldvalues,
+3
View File
@@ -55,5 +55,8 @@ function xmldb_block_myoverview_upgrade($oldversion) {
upgrade_block_savepoint(true, 2019091800, 'myoverview', false);
}
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -54,7 +54,7 @@ $string['courseprogress'] = 'Course progress:';
$string['completepercent'] = '{$a}% complete';
$string['customfield'] = 'Custom field';
$string['customfiltergrouping'] = 'Field to use';
$string['customfiltergrouping_nofields'] = 'This option requires a course custom field to be set up.';
$string['customfiltergrouping_nofields'] = 'This option requires a course custom field to be set up and visible to everyone.';
$string['displaycategories'] = 'Display categories';
$string['displaycategories_help'] = 'Display the course category on dashboard course items including cards, list items and summary items.';
$string['favourites'] = 'Starred';
@@ -13,14 +13,16 @@ Feature: The my overview block allows users to group courses by custom fields
| Checkbox field | Course fields | checkbox | checkboxfield | |
| Date field | Course fields | date | datefield | {"mindate":0, "maxdate":0} |
| Select field | Course fields | select | selectfield | {"options":"Option 1\nOption 2\nOption 3\nOption 4"} |
| Text field | Course fields | text | textfield | |
| Text field | Course fields | text | textfield | {"visibility":"2"} |
| Text field 2 | Course fields | text | textfield2 | {"visibility":"2"} |
| Hidden field | Course fields | text | hiddenfield | {"visibility":"0"} |
And the following "courses" exist:
| fullname | shortname | category | customfield_checkboxfield | customfield_datefield | customfield_selectfield | customfield_textfield |
| Course 1 | C1 | 0 | 1 | 981028800 | 1 | fish |
| Course 2 | C2 | 0 | 0 | 334324800 | | |
| Course 3 | C3 | 0 | 0 | 981028800 | 2 | dog |
| Course 4 | C4 | 0 | 1 | | 3 | cat |
| Course 5 | C5 | 0 | | 334411200 | 2 | fish |
| fullname | shortname | category | customfield_checkboxfield | customfield_datefield | customfield_selectfield | customfield_textfield | customfield_textfield2 |
| Course 1 | C1 | 0 | 1 | 981028800 | 1 | fish | penguin |
| Course 2 | C2 | 0 | 0 | 334324800 | | | |
| Course 3 | C3 | 0 | 0 | 981028800 | 2 | dog | |
| Course 4 | C4 | 0 | 1 | | 3 | cat | |
| Course 5 | C5 | 0 | | 334411200 | 2 | fish | penguin |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
@@ -172,3 +174,24 @@ Feature: The my overview block allows users to group courses by custom fields
And I should not see "Course 3" in the "Course overview" "block"
And I should not see "Course 4" in the "Course overview" "block"
And I should not see "Course 5" in the "Course overview" "block"
Scenario: Hidden fields not displayed when configuring the custom field filters
Given I log in as "admin"
When I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "Custom field" to "1"
Then the "Field to use" select box should not contain "Hidden field"
Scenario: Hidden fields not displayed in the filter
Given the following config values are set as admin:
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | textfield2 | block_myoverview |
And I log in as "admin"
And I navigate to "Courses > Course custom fields" in site administration
And I click on "Edit" "link" in the "Text field 2" "table_row"
And I set the field "Visible to" to "Nobody"
And I press "Save changes"
And I log out
When I log in as "student1"
And I click on "All (except removed from view)" "button" in the "Course overview" "block"
Then I should not see "penguin" in the "Course overview" "block"
Then I should not see "No text field" in the "Course overview" "block"

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