Compare commits

...

745 Commits

Author SHA1 Message Date
Jun Pataleta ac9e395ed6 Moodle release 4.0.1 2022-05-07 19:34:54 +08:00
Eloy Lafuente (stronk7) 99fc164199 weekly release 4.0+ 2022-05-06 15:58:28 +02:00
Jake Dallimore 9ec2c12f3d MDL-74602 mod_assign: fix js error with assign grader on classic 2022-05-06 16:48:29 +08:00
Jun Pataleta 6ec89f6374 Merge branch 'MDL-74584-400-v1' of https://github.com/mihailges/moodle into MOODLE_400_STABLE 2022-05-06 14:17:37 +08:00
Mihail Geshoski 834c80849c MDL-74584 mod_bigbluebuttonbn: Update behat tests 2022-05-06 13:32:14 +08:00
Mihail Geshoski 674198a799 MDL-74584 mod_bigbluebuttonbn: Update unit tests 2022-05-06 13:32:14 +08:00
Mihail Geshoski 66c32a3687 MDL-74584 course: New optional parameter in get_module_types_names()
Adds new parameter in get_module_types_names() to optionally reset
the $modnames static cache.
2022-05-06 13:32:13 +08:00
Mihail Geshoski 0118227509 MDL-74584 mod_bigbluebuttonbn: Add install script and new upgrade step
Adds a new install script for the BBB module and a new upgrade step.
The BBB module now will be disabled by default for new installations
and also it will be disabled for the existing sites that use the
default BBB server configuration. Admistrators will be required to
confirm the acceptance of the related DPA prior to (re)enabling the
plugin once again.
2022-05-06 12:19:56 +08:00
Mihail Geshoski 2e1478b094 MDL-74584 mod_bigbluebuttonbn: Add DPA info in the general setting page
Adds a note in the BBB general settings page to raise awareness about
the legal obligations related to the data processing agreement with the
service provider which is currently configured.
2022-05-06 12:19:56 +08:00
Mihail Geshoski 6961258bc2 MDL-74584 mod_bigbluebuttonbn: Implement 'pre_enable_plugin_actions'
Implements a function for the 'pre_enable_plugin_actions' callback.
When the default BBB server settings are used while the administrator
attempts to enable the BBB plugin, the function will prevent this
action and trigger a dynamic form requesting the admin to conifrm
their acceptance of the related data processing agreement. The process
of enabling the plugin will continue as usual in cases where the
admin has already confirmed the acceptance of the dpa or a different
BBB server configuration is used other than the default.
2022-05-06 12:19:56 +08:00
Mihail Geshoski b4f6816952 MDL-74584 admin: Add callback executed prior to enabling a module
Adds a callback xxx_pre_enable_plugin_actions in admin/modules.php
which plugins can use to force additional actions before enabling the
plugin. The return value (bool) from the plugin callback method
specifies whether the process of enabling the plugin should continue
after the added actions or not.
2022-05-06 12:19:56 +08:00
Andrew Nicols 16b30d920b MDL-74511 core: Add phpcs default config 2022-05-06 12:01:32 +08:00
Ilya Tregubov 61d140e99f Merge branch 'MDL-41498-400' of https://github.com/ilyatregubov/moodle into MOODLE_400_STABLE 2022-05-06 08:26:59 +06:00
Robert Schrenk cc5eb38cea MDL-41498 course: courses participant page 2022-05-06 08:26:08 +06:00
Víctor Déniz 3b7bba9e75 Merge branch 'MDL-74612-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2022-05-05 13:25:37 +01:00
Víctor Déniz 2e020b506a Merge branch 'MDL-74128-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2022-05-05 12:09:59 +01:00
Víctor Déniz 74cdb7c4c8 Merge branch 'MDL-74567-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2022-05-05 09:39:39 +01:00
Paul Holden ef8d381a2f MDL-74567 core: re-factor flickr libraries to use shared user-agent. 2022-05-05 09:21:22 +01:00
Jun Pataleta 39717b72b1 MDL-74317 blocks: Revert checking of block usage against page format 2022-05-05 10:04:01 +08:00
Jun Pataleta e7ff99758e Merge branch 'MDL-74576-400' of https://github.com/snake/moodle into MOODLE_400_STABLE 2022-05-05 09:55:45 +08:00
Jun Pataleta 26492d4979 Merge branch 'MDL-73981-400' of https://github.com/ilyatregubov/moodle into MOODLE_400_STABLE 2022-05-05 09:49:06 +08:00
Ilya Tregubov 3abbcd9976 Merge branch 'MDL-74602-400' of https://github.com/snake/moodle into MOODLE_400_STABLE 2022-05-05 07:46:55 +06:00
Jun Pataleta 1456551ba6 Merge branch 'MDL-74546-400' of https://github.com/snake/moodle into MOODLE_400_STABLE 2022-05-05 09:41:34 +08:00
Ilya Tregubov c1ebec7cbc MDL-73981 tool_uploadcourse: Validate enrolment role from csv. 2022-05-05 07:39:50 +06:00
Jun Pataleta 812c8b37e5 Merge branch 'MDL-74511-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2022-05-05 09:37:31 +08:00
Jake Dallimore f2ab11aa5b MDL-73736 core_auth: Fix concurrency issue in login_attempt_failed()
This patch wraps the login_failed_count logic in a resource lock and
forces a user preferences cache reload. Each thread must wait for the
lock and must fetch the current count before incrementing it. This
ensures that login_failed_count is correct across threads and that the
lockout threshold is correctly honoured.

Co-Authored-By: Sujith Haridasan <sujith@moodle.com>
2022-05-04 14:45:00 +06:00
Michael Hawkins 240b402523 MDL-74333 badges: Check profile criteria valid when reviewing 2022-05-04 12:58:02 +08:00
Ilya Tregubov 34c4b3ce0c Merge branch 'MDL-74563-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2022-05-04 09:26:06 +06:00
Ferran Recio 8b098b4a4e MDL-71623 core_search: fix user document visibility 2022-05-04 03:55:18 +02:00
Amaia Anabitarte 38a40c5e4b MDL-74318 core_user: Description field as hidden on profile 2022-05-04 03:55:18 +02:00
Paul Holden 72580a5413 MDL-74204 mod_assign: escape identity fields in allocate marker form. 2022-05-04 03:55:18 +02:00
Jun Pataleta 6253ab0170 Merge branch 'MDL-73878-40' of https://github.com/aanabit/moodle into MOODLE_400_STABLE 2022-05-04 09:44:28 +08:00
Amaia Anabitarte ff89abc311 MDL-73878 core_user: Creating a new category for social fields 2022-05-03 17:46:18 +02:00
Amaia Anabitarte 7878d79359 MDL-73878 core_user: Fixing social fields upgrading issue 2022-05-03 17:43:22 +02:00
Jun Pataleta 93319747b2 Merge branch 'MDL-74543_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2022-05-03 22:22:45 +08:00
Tim Hunt f46c1b4fa9 MDL-74543 quiz attemptlib: covert string comparison to ===
Where obviously safe.
2022-05-03 13:48:04 +01:00
Tim Hunt a0297df86e MDL-74543 quiz: correctly record time when overdue attempt submitted 2022-05-03 13:48:04 +01:00
Víctor Déniz da9ab8a2f9 Merge branch 'MDL-74611_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2022-05-03 13:00:59 +01:00
Ilya Tregubov 33829b8b68 Merge branch 'mdl65478-fix-400' of https://github.com/matthewhilton/moodle into MOODLE_400_STABLE 2022-05-03 15:43:59 +06:00
Tim Hunt f5f468f6e1 MDL-74611 course settigns: re-order Common module settings
All the group-related settings should be next to each other.
2022-05-03 10:36:01 +01:00
Jake Dallimore 6b4f55c91b Merge branch 'MDL-74441-400' of https://github.com/cameron1729/moodle into MOODLE_400_STABLE 2022-05-03 16:54:50 +08:00
Cameron Ball 63ed56bc7c MDL-74441 mod_forum: Fix overflow in unified grader 2022-05-03 15:52:26 +08:00
Ilya Tregubov 841214dab2 Merge branch 'MDL-74598-400' of https://github.com/roland04/moodle into MOODLE_400_STABLE 2022-05-03 11:57:07 +06:00
Jason den Dulk 43cbc05a2d MDL-65478 backup, course format: Handle editor elements in course format
Modified course format options reading and writing to be able to handle Editor elements by enabling them to split array values into
multiple values before inserting into database, and combining multiple values into an array when reading from the database.
Modified backup and restore code to use backup_nested_elements, and to interact directly with the database.

Co-authored-by: Jason den Dulk <jasondendulk@catalyst-au.net>
Co-authored-by: Matthew Hilton <matthewhilton@catalyst-au.net>
2022-05-03 14:23:15 +10:00
Ilya Tregubov 973ea46697 Merge branch 'MDL-74450-400' of https://github.com/mihailges/moodle into MOODLE_400_STABLE 2022-05-03 09:52:26 +06:00
Jake Dallimore 98dbb93589 MDL-74602 mod_wiki: disable activity header in wiki print view 2022-05-03 11:09:00 +08:00
Jake Dallimore 5fa19e43b3 MDL-74602 mod_chat: disable activity header in ajax chat interface 2022-05-03 11:09:00 +08:00
Jake Dallimore 0d3a2c9181 MDL-74602 mod_book: disable activity header on book print page 2022-05-03 11:09:00 +08:00
Jake Dallimore 4f7bd72f72 MDL-74602 mod_assign: disable activity header on embedded grader page 2022-05-03 11:09:00 +08:00
Jake Dallimore cc182408aa MDL-74602 theme_boost: fix missing activity header in embedded layout
The activity header, which includes things like dates and completion
information, was moved out of the page $OUTPUT and into a separate
template context variable in 4.0, meaning it was missing from any layout
which didn't actively add it back to the page output. This fixes this
problem for the embedded layout only by adding support for the activity
header in the embedded template.
2022-05-03 11:09:00 +08:00
Jun Pataleta 8b3913605a Merge branch 'MDL-74317-400' of https://github.com/dravek/moodle into MOODLE_400_STABLE 2022-05-02 17:24:23 +08:00
Jun Pataleta 8ff67c91de Merge branch 'MDL-74436-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2022-05-02 16:30:06 +08:00
Jake Dallimore 4cbd6a0c6a MDL-74576 enrol_lti: allow unsupported scopes in ags_info
Instead of hard blocking launches with extension scopes, just ignore
the unsupported scopes and continue.
2022-05-02 15:39:20 +08:00
Paul Holden 203a55f57a MDL-74128 reportbuilder: Behat helper for navigating to view page. 2022-04-29 17:18:06 +01:00
Paul Holden 5b05a9378c MDL-74612 cohort: use data generator for populating cohort members. 2022-04-29 16:23:32 +01:00
Ilya Tregubov 81e5d425c4 weekly release 4.0+ 2022-04-29 07:55:31 +06:00
Ilya Tregubov 6362d7b51c Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2022-04-29 07:55:27 +06:00
Mikel Martín 51d3df8d30 MDL-74598 reportbuilder: Fix action menus alignment to the right 2022-04-28 16:46:00 +02:00
Paul Holden a60a6d41a3 MDL-74567 repository_flickr: replace user-agent value for API calls.
Flickr doesn't like user agent that looks like a bot. Effectively the
same reasoning/fix as b8ee31a0.
2022-04-28 14:45:37 +01:00
Mihail Geshoski d6ba7724ae MDL-74450 admin: Use the context from admin_settingpage as page context
The defined context in admin_settingpage does not always relate to the
system context. One example is the 'frontpagesettings' admin setting
page which specifies front page as it's default context. Therefore, the
page context in admin/settings.php should be consisent with the defined
context in the related admin_settingpage object to make sure that the
expected navigation menus are being displayed and properly highlighted.
Additionally, the code in admin/settings.php related to the breadcrumb
structure specific to 'frontpagesettings' has been removed as it is no
longer relevant.
2022-04-28 13:23:57 +08:00
Jun Pataleta 4f1be71581 Merge branch 'MDL-74478-400' of https://github.com/mihailges/moodle into MOODLE_400_STABLE 2022-04-28 12:54:26 +08:00
Peter Dias 58ddfe84c2 MDL-74478 badges: Check completion_fail when awarding badge
Bring the award_criteria_activity checks in line with the observer checks
2022-04-28 12:16:19 +08:00
Jun Pataleta dd156a4160 Merge branch 'MDL-74461-400' of https://github.com/HuongNV13/moodle into MOODLE_400_STABLE 2022-04-28 11:39:59 +08:00
Huong Nguyen 3bc8fa20bf MDL-74461 Navigation: Add section anchor to activity breadcrumb 2022-04-28 10:05:17 +07:00
Ilya Tregubov 954ae33aa9 Merge branch 'MOODLE_400-MDL-74427-v4' of https://github.com/golenkovm/moodle into MOODLE_400_STABLE 2022-04-28 08:10:29 +06:00
Jun Pataleta 24dbcc0008 Merge branch 'MDL-74537-400-enfix' of https://github.com/vmdef/moodle into MOODLE_400_STABLE 2022-04-27 15:47:30 +06:00
Ilya Tregubov ebb96c2850 Merge branch 'MDL-74510_400' of https://github.com/stronk7/moodle into MOODLE_400_STABLE 2022-04-27 15:47:30 +06:00
Paul Holden 870c5ffbde MDL-74479 reportbuilder: account for custom field context in output. 2022-04-27 15:47:29 +06:00
Eloy Lafuente (stronk7) 049e27a805 MDL-74320 lesson: Remove tested elsewhere parts of the scenario
The scenario has not only grades related completion conditions
but also timing conditions or reach the end conditions that
shouldn't be tested by a grades feature.

More yet, those completion conditions are already tested by
other feature files, namely:
- reach the end: completion_condition_end_reached.feature
- visit and timing: lesson_activity_completion.feature

So we have removed all those parts that are being tested
by other features.

Specially the visit and timing ones, because they lead to
random failures in slow environments and they have been
fixed in the lesson_activity_completion.feature scenarios
by MDL-72698.
2022-04-27 15:47:29 +06:00
Laurent David 6c7fa91d59 MDL-74514 mod_bigbluebuttonbn: BBB server is polled too often
* Fix issue with the roomupdater that should not force the updatecache flag
for get_meeting_info API
* Fix issue when meeting is not started (and does not exist) and bigbluebutton_proxy::get_meeting_info
throws an exception, skipping the cache and then polling the server every second.
2022-04-27 15:47:29 +06:00
Claude Vervoort 7c84b92be3 MDL-74481 mod_lti: fix role lookup for LTI 1.3 2022-04-27 15:47:29 +06:00
Mikhail Golenkov bb36c3a1bb MDL-74427 question: Re-use get_real_question_ids_in_category() 2022-04-27 12:35:08 +10:00
Mikhail Golenkov 990bfee024 MDL-74427 question: Implement get_real_question_ids_in_category() 2022-04-27 12:34:55 +10:00
David Matamoros 17584f9c92 MDL-74317 blocks: Blocks can be added to profile pages
- Fixed method user_can_addto to take into account that
blocks can also be added to user profile pages
2022-04-26 14:34:45 +02:00
David Matamoros f551072f9e MDL-74317 output: Remove capability checks in edit mode WS
- Removed validation on the change edit mode WS. Permission should
be handled where the edit button is rendered in order to show or not
the button.
2022-04-26 14:33:34 +02:00
Helen Foster 3447ab640c MDL-74537 lang: Import fixed English strings (en_fix) 2022-04-26 11:24:27 +01:00
Paul Holden 3dbad11471 MDL-74563 reportbuilder: cast operator parameter in number filter.
Add missing form labels, too.
2022-04-25 21:44:48 +01:00
Paul Holden 43b4b87fbf MDL-74436 calendar: validate course/category field during import. 2022-04-25 18:02:00 +01:00
Paul Holden 7d33385a1d MDL-74477 reportbuilder: sortable custom user profile field columns. 2022-04-25 13:40:12 +06:00
AMOS bot 657617ac21 Automatically generated installer lang files 2022-04-23 00:07:39 +00:00
Eloy Lafuente (stronk7) 205e4152cc MDL-74510 upgrade: add the 4.0.0 separation line to all upgrade scripts 2022-04-22 18:45:16 +02:00
Eloy Lafuente (stronk7) e36fb751e5 weekly release 4.0+ 2022-04-22 18:03:47 +02:00
Jake Dallimore a0c1acd7fd MDL-74546 enrol_lti: add missing d-flex to table to fix safari layout 2022-04-22 10:19:08 +08:00
Ilya Tregubov 2184ea5b64 Merge branch 'MDL-74394_400' of https://github.com/aolley/moodle into MOODLE_400_STABLE 2022-04-22 08:01:09 +06:00
Víctor Déniz c81b3dc384 Merge branch 'MDL-74312-400' of https://github.com/snake/moodle into MOODLE_400_STABLE 2022-04-21 16:39:51 +01:00
Adam Olley ca6a4b1953 MDL-74394 mnet: Better check for openssl_get_publickey() failure
In PHP8, this func now returns an object of type OpenSSLAsymmetricKey, not a
resource.

Reference:
https://www.php.net/manual/en/function.openssl-pkey-get-public.php
2022-04-21 22:08:20 +09:30
Jake Dallimore 20cefd70e2 MDL-74312 enrol_lti: fix copytoclipboard trigger element
This should be a button given it's an action, and making it a button
means it can be activated using either the space or enter keys, instead
of just enter.
2022-04-20 09:49:35 +08:00
Sara Arjona bc87d55a1f Merge branch 'MDL-74512_400' of https://github.com/stronk7/moodle into MOODLE_400_STABLE 2022-04-19 12:55:29 +02:00
Andrew Nicols 51c376cfca MDL-74511 core: Add phpcs config generator 2022-04-19 11:15:27 +08:00
Eloy Lafuente (stronk7) e0034b0566 MDL-74512 behat: Skip tests requiring lang install/upgrade
By adding the step:

Given remote langimport tests are enabled

We make the execution of scenarios requiring to install /
upgrade lang packs optional, based in the existence of the constant:

TOOL_LANGIMPORT_REMOTE_TESTS

That way, when we are skipping language upgrades with the CFG var:

$CFG->skiplangupgrade = true

We can decide not not execute those tests.

With other words, putting something like this in the config.php
file we will be controlling when to execute or no the behat tests:

    // Disable lang updates on upgrade.
    $CFG->skiplangupgrade = true;
    if (empty($CFG->skiplangupgrade)) {
        // Define it only if we aren't skipping lang upgrades.
        define('TOOL_LANGIMPORT_REMOTE_TESTS', true);
    }
2022-04-17 20:35:02 +02:00
Jun Pataleta 8b359ad7a6 Moodle release 4.0 2022-04-17 14:59:54 +08:00
Jun Pataleta 68445c923e NOBUG: Change travis.yml to MOODLE_400_STABLE 2022-04-17 14:59:54 +08:00
Eloy Lafuente (stronk7) f801189795 Moodle release 4.0rc4 2022-04-16 16:31:59 +02:00
Jun Pataleta e25d806abc Merge branch 'MDL-74506-master' of https://github.com/andrewnicols/moodle 2022-04-16 19:14:01 +08:00
Andrew Nicols fb0b57f4ab MDL-74506 block: Correct parentcontextid for blocks in dashboard 2022-04-16 17:49:18 +08:00
Andrew Nicols ed56f9a976 MDL-74506 block: Fix block upgrade to use correct parentcontextid 2022-04-15 20:39:55 +08:00
Ilya Tregubov 4ca5665aa0 Moodle release 4.0rc3 2022-04-15 16:03:34 +06:00
Ilya Tregubov edede57172 Merge branch 'MDL-74407-master' of https://github.com/peterRd/moodle 2022-04-15 07:24:08 +06:00
Sara Arjona d54fa7abd8 Merge branch 'MDL-74447' of https://github.com/Chocolate-lightning/moodle 2022-04-14 12:10:31 +02:00
Ilya Tregubov 5c3563e3a2 Merge branch 'MDL-74064-master' of https://github.com/HuongNV13/moodle 2022-04-14 13:35:11 +06:00
Huong Nguyen 3956dd856b MDL-74064 mod_assign: Behat test for Assignment with time limit 2022-04-14 12:49:55 +07:00
Andrew Nicols e9335eb448 MDL-74447 core: Restrict block drag/drop to container 2022-04-14 17:22:29 +12:00
Peter Dias 40ad488405 MDL-74407 navigation: Perform a strict array_search for node keys
Perform strict array_search due to conflicting results in versions <php8.0
2022-04-14 12:25:15 +08:00
Jun Pataleta 80709ba72d Merge branch 'MDL-74493-master' of https://github.com/snake/moodle 2022-04-14 12:02:10 +08:00
Shamim Rezaie 7252fef24b MDL-74064 mod_assign: Notify submission removal does not reset timelimit 2022-04-14 10:48:45 +07:00
Shamim Rezaie 6ac1477e98 MDL-74064 mod_assign: Use core_user::get_user instead of querying DB 2022-04-14 10:48:37 +07:00
Shamim Rezaie 76c0d3d6bc MDL-74064 mod_assign: Late submission recognition depends on timestarted 2022-04-14 10:48:29 +07:00
Jun Pataleta 821ec66490 Merge branch 'MDL-74498-master' of https://github.com/justusdieckmann/moodle 2022-04-14 10:31:05 +08:00
Jake Dallimore 19a296dfa0 MDL-74493 admin: add check for mbstring extension to prevent errors 2022-04-14 10:13:06 +08:00
Justus Dieckmann bf68b2bc64 MDL-74498 output: Resolve correct icon for modules
Fixes the resolve_image_location function, which previously returned
the 'icon' or 'monologo' icon for modules, no matter the requested
image name.

Also fixes an incorrect pix_icon() call for the context header, which
was hidden by the faulty resolve function.
2022-04-14 01:54:28 +02:00
Sara Arjona 8b7fdc993d Merge branch 'MDL-74486-master' of https://github.com/HuongNV13/moodle 2022-04-13 16:58:52 +02:00
Ilya Tregubov e39a1fff2c Merge branch 'MDL-74471-master' of https://github.com/junpataleta/moodle 2022-04-13 14:59:21 +06:00
Jun Pataleta 0385178826 Merge branch 'MDL-74489' of https://github.com/paulholden/moodle 2022-04-13 16:35:19 +08:00
Jun Pataleta cd3e7bf7eb MDL-74471 versions: main version bump 2022-04-13 10:37:57 +08:00
Jun Pataleta 70f6b1605b MDL-74471 versions: bump all versions and requires near release 2022-04-13 10:37:36 +08:00
Huong Nguyen 156f4fe6ce MDL-74486 tool_usertours: Prevent step to inherit theme background image 2022-04-13 09:33:13 +07:00
Ilya Tregubov 65224aa30d Merge branch 'MDL-74470' of https://github.com/timhunt/moodle 2022-04-13 08:21:18 +06:00
Paul Holden a3a473d644 MDL-74489 admin: consider salt configuration as sensitive to site.
The admin preset tool shouldn't export badge/calendar salt configuration
unless explicitely asked for as changing these values on another site
can be potentially destructive.
2022-04-12 16:19:40 +01:00
Sara Arjona 5423e5f443 Moodle release 4.0rc2 2022-04-12 13:15:22 +02:00
Sara Arjona 1e728ad31d Merge branch 'install_master' of https://git.in.moodle.com/amosbot/moodle-install 2022-04-12 13:15:19 +02:00
Andrew Nicols 01b8e81e7d Merge branch 'MDL-74084' of https://github.com/paulholden/moodle 2022-04-12 09:46:48 +08:00
Shamim Rezaie 5e957e5ed1 Merge branch 'MDL-74459' of https://github.com/paulholden/moodle 2022-04-12 11:29:44 +10:00
AMOS bot b98eff24f2 Automatically generated installer lang files 2022-04-12 00:07:39 +00:00
Tim Hunt 2e1a632302 MDL-74470 quiz: put back random Q description on the Question page
This got lost in the 4.0 question bank work.

We are trying to phase out qtype_random, that is where the old
code and lang strings for describing random questions is, so
OK to add back a call to it. When we get better qbank filtering
we can replace this again.

Note, the asserts in the Behat were copied from my 3.11, checkout,
to really verify we are restoring the previous behaviour.
2022-04-11 19:01:00 +01:00
Paul Holden 27adde9b83 MDL-74084 tool_usertours: ensure presense of tour config in response.
If it's not, then don't try to start the tour. This fix is effectively
the same as that previously made in 3bd9e1e8.

Co-authored-by: Carlos Castillo <carlos.castillo@moodle.com>
2022-04-11 14:15:09 +01:00
Tim Hunt 95b0f86ed3 MDL-74470 quiz: fix typos & small bug from MDL-74255.
I think that, because how PHP works, the MDL-74255 bug (lack
of explode) generally does not break anything, which is why
no tests failed. Still. Good to fix.
2022-04-11 12:21:50 +01:00
Shamim Rezaie b5236ed40f Merge branch 'MDL-74456' of https://github.com/paulholden/moodle 2022-04-11 13:11:17 +10:00
Jake Dallimore 944566fa12 Merge branch 'MDL-74350-master' of https://github.com/HuongNV13/moodle 2022-04-11 10:28:16 +08:00
Jake Dallimore 39be17d918 Merge branch 'MDL-74386-integration-master' of https://github.com/mihailges/moodle 2022-04-11 10:01:00 +08:00
Shamim Rezaie a9a9d8e5c2 Merge branch 'MDL-74463-master' of https://github.com/snake/moodle 2022-04-11 11:55:18 +10:00
Jun Pataleta 217fb9ec66 Merge branch 'MDL-74255' of https://github.com/timhunt/moodle 2022-04-08 20:12:17 +08:00
Tim Hunt 5be2fc1ddc MDL-74255 quiz/question versions: update SQL to work in Oracle 2022-04-08 12:19:53 +01:00
Tim Hunt a43f56836a MDL-74255 quiz: fix redo and regrade question version handling 2022-04-08 12:19:53 +01:00
Tim Hunt 839cccead4 MDL-74255 quiz: handle draft question status correctly
The main issue to fix is that questions vesions which should not have
been used (that is, hidden or draft versions) were getting offered
as an option and acutally being used.

As part of this I was able to substantially un-tangle
mod_quiz\question\bank\qbank_helper, which previously was
a mass of functions calling other functions in a complicated way.
Hopefully, it is now a bit easer to understand, and perhaps
less buggy.
2022-04-08 12:19:53 +01:00
Tim Hunt 5fff990e25 MDL-74255 quiz: clean up lots of stuff mainly in the tests
This fixes lots of stuff like outdated or incomplete PHPdoc comments
or test heler functions where the arguments don't have their types
declared.

A few more significant fixes, like places were a silly method
was used to get a context which was readily available.
2022-04-08 12:19:52 +01:00
Tim Hunt 37e8faf0ed MDL-74255 quiz: Remove un-needed method question_array_sort 2022-04-08 12:19:52 +01:00
Ilya Tregubov f62cd4484e Moodle release 4.0rc1 2022-04-08 16:40:14 +06:00
Ilya Tregubov 50e9313a01 Merge branch 'install_master' of https://git.in.moodle.com/amosbot/moodle-install 2022-04-08 16:40:12 +06:00
Mihail Geshoski 8d0ca00e95 MDL-74386 navigation: Remove redundant set_secondary_navigation() calls
Removes $PAGE->set_secondary_navigation(false) calls which certain pages
were using to prevent displaying secondary navigation menu in the system
context. This logic is now generally handled within the secondary
navigation class.
2022-04-08 15:11:31 +08:00
Mihail Geshoski d08c351701 MDL-74386 contentbank: Set the page context to frontpage
Sets the page context to frontpage when viewing or editing site
contenbank files. This logic was already applied in
contentbank/index.php, so this change will bring consistency in
the contenbanks pages when it comes to setting the page context.
2022-04-08 15:04:58 +08:00
Mihail Geshoski 93aa5ab03e MDL-74386 navigation: Do not load course navigation in system context 2022-04-08 15:02:01 +08:00
Jake Dallimore 75328ec1a8 MDL-74463 enrol_lti: fix location of scopes in registration json 2022-04-08 14:45:30 +08:00
Ilya Tregubov 49eb6ed755 Merge branch 'MDL-74339' of https://github.com/call-learning/moodle 2022-04-08 09:57:41 +06:00
Huong Nguyen d506386d32 MDL-74350 usertours: Prevent adding unnecessary breaktags to the content 2022-04-08 10:56:45 +07:00
Ilya Tregubov bc170bba61 Merge branch 'MDL-73555_master_toolbrickfieldsummaryprocessing' of https://github.com/brickfield/moodle 2022-04-08 09:24:11 +06:00
Andrew Nicols 0098da8239 Merge branch 'MDL-74438-master' of https://github.com/cameron1729/moodle 2022-04-08 11:03:43 +08:00
Shamim Rezaie af77f81522 Merge branch 'MDL-73874-master' of https://github.com/BruceGoodGuy/moodle 2022-04-08 12:38:55 +10:00
Paul Holden 6e85e01d3b MDL-74459 forms: replace import of jqueryui with native code.
We used the import for ensuring collapsible section elements
contained an ID attribute (efbe1530). This conflicted with use
of Bootstrap tooltips.
2022-04-07 22:38:46 +01:00
Sara Arjona d32bb45e43 Merge branch 'MDL-74398' of https://github.com/call-learning/moodle 2022-04-07 22:45:05 +02:00
Víctor Déniz 384f6712bb Merge branch 'MDL-74419-master' of https://github.com/sarjona/moodle 2022-04-07 20:20:54 +01:00
Laurent David 978bdb5b4d MDL-74398 mod_bigbluebuttonbn: Fix issue with Visible groups
* In visible group user should see all recordings. This fixes an issue while integrating
MDL-74052 with this issue.
2022-04-07 19:25:50 +02:00
Sara Arjona 2ce8437d8e Merge branch 'MDL-74297-master' of https://github.com/peterRd/moodle 2022-04-07 17:32:56 +02:00
Eloy Lafuente (stronk7) bdf12da661 Merge branch 'MDL-74434-master' of https://github.com/mihailges/moodle 2022-04-07 17:12:08 +02:00
Jun Pataleta ac3e77b1b1 Merge branch 'MDL-74271-master-squashed' of https://github.com/andrewnicols/moodle 2022-04-07 20:52:10 +08:00
Jun Pataleta d848bc7ece Merge branch 'MDL-74329' of https://github.com/odeialba/moodle 2022-04-07 20:14:14 +08:00
Paul Holden 509bdf4bc5 MDL-74456 reportbuilder: format report/schedule names in actions.
Ensure audience names are also formatted in scheduling form.
2022-04-07 13:10:24 +01:00
Laurent David 8d3f6e7133 MDL-74339 mod_bigbluebuttonbn: Fix upgrade recording from 2.4
* Only delete "Create" or "Update" logs when a recording has been effectively created
* Reschedule task if fail or logs are left over
* One task per meetingid
2022-04-07 13:02:12 +02:00
Odei Alba 9446af726d MDL-74329 mod_quiz: scroll to top and to question container
When reviewing the answers:
1- When there are all the questions in one page and you click in the first question,
it will scroll to the first question.
2- When there is one question per page and you click in the question number,
it will go to that question page and scroll to the top.
If you click again the question number, it will scroll to the question container.
2022-04-07 12:49:42 +02:00
Khoa Nguyen Dang c0e53d297f MDL-73874 Questions: Add new validation for Drag and drop into text 2022-04-07 17:27:23 +07:00
Ilya Tregubov fa1d1ea378 Merge branch 'MDL-74235-patch' of https://github.com/ilyatregubov/moodle 2022-04-07 13:53:44 +06:00
Andrew Nicols 9dc2ee548d MDL-74235 mod_lti: Update use of logo to monologo 2022-04-07 13:43:55 +06:00
Andrew Nicols 3291ee416c Merge branch 'MDL-74202' of https://github.com/paulholden/moodle 2022-04-07 15:28:57 +08:00
Andrew Nicols f40abbdf1d MDL-74235 core: Revert theme changes
These changes were accidentally included from a previous iteration of
the patch.
2022-04-07 13:27:27 +06:00
Andrew Nicols e4aa381679 MDL-74235 mod: Update mod icon to use monologo 2022-04-07 13:27:18 +06:00
Andrew Nicols f57461cfb7 Merge branch 'MDL-74398' of https://github.com/call-learning/moodle 2022-04-07 15:25:36 +08:00
Sara Arjona 08c4173fc9 Merge branch 'MDL-58044_master' of https://github.com/Chocolate-lightning/moodle 2022-04-07 09:15:08 +02:00
Laurent David d8f3c831c9 MDL-74398 mod_bigbluebuttonbn: Remove (All participants) meeting title
* When course groups are disable the meeting title should not display (All participants)
2022-04-07 08:15:12 +02:00
Shamim Rezaie 43e37471f1 MDL-74404 mod_bigbluebuttonbn: Delete the unnecessary $datagenerator var 2022-04-07 16:13:11 +10:00
Shamim Rezaie db75461893 Merge branch 'MDL-74404' of https://github.com/call-learning/moodle 2022-04-07 16:09:34 +10:00
Ilya Tregubov 29da0c7f2a Merge branch 'MDL-74235-master-2' of https://github.com/andrewnicols/moodle 2022-04-07 12:06:38 +06:00
Mihail Geshoski 32754bdf2a MDL-74434 block_tag_youtube: Update instances only if category is set
Modifies the existing upgrade step to only take into consideration
block instances that have a specific category set prior to determening
if a legacy category is being used and updating them. Instances that do
not have any category set should be ignored.
2022-04-07 13:24:08 +08:00
Jake Dallimore 73107117db Merge branch 'MDL-74341' of https://github.com/paulholden/moodle 2022-04-07 13:06:49 +08:00
Andrew Nicols 4b388fc239 MDL-74235 core: Update core uses of activity icons to monologo 2022-04-07 12:56:14 +08:00
Andrew Nicols eb0a95956f MDL-74235 mod: Rename activity icons to new monologo naming 2022-04-07 12:56:14 +08:00
Andrew Nicols ffc227c9d5 MDL-74235 output: Fall back to icon and support monologo 2022-04-07 12:56:13 +08:00
Andrew Nicols 748608b318 Merge branch 'MDL-74331' of https://github.com/timhunt/moodle 2022-04-07 11:47:30 +08:00
Andrew Nicols 9de93892b7 Merge branch 'MDL-74421-master' of https://github.com/sammarshallou/moodle 2022-04-07 11:43:58 +08:00
Peter Dias d693e93969 MDL-74297 core: Scroll and sticky heading/footer updates 2022-04-07 08:34:37 +08:00
AMOS bot 58fb8c7c5c Automatically generated installer lang files 2022-04-07 00:07:35 +00:00
Víctor Déniz 21aa01c0bc Merge branch 'MDL-74189-master' of https://github.com/mihailges/moodle 2022-04-06 22:55:44 +01:00
Jun Pataleta 55fb55f7dc Merge branch 'MDL-74332-master' of https://github.com/sharidas/moodle 2022-04-07 00:35:20 +08:00
Sara Arjona aa96ef42ca Merge branch 'MDL-74052' of https://github.com/call-learning/moodle 2022-04-06 17:47:11 +02:00
Andrew Nicols 00efa6aecf MDL-74271 context: Improve performance of block context creation 2022-04-06 23:40:15 +08:00
Andrew Nicols 14dca23e1f MDL-74271 core: Replace upgrade steps for blocks to be more performant
The previous upgrade step was both duplicating a lot of code, and also
very non-performant as each record was fetched from the DB into PHP and
updated there.

Most of the operations can be performed straight into the database
without requiring any fetch to PHP at all.

This change includes unit tests for the new upgrade steps to ensure that
only the relevant data is created, updated, or deleted.
2022-04-06 23:40:15 +08:00
Mihail Geshoski 2ca9f4354e MDL-74189 tool_moodlenet: Add upgrade step to remove irrelevant data
Upgrade step to identify all existing cases where users have linked
their MoodleNet profile on the site and remove the related data from
the database. Due to some recent changes on the MoodleNet platform,
this data is now irrelevant and can no longer be used to authenticate
on the MoodleNet platform.
2022-04-06 23:30:11 +08:00
Sara Arjona f2d666e8c6 Merge branch 'MDL-74325' of https://github.com/ssj365/moodle 2022-04-06 16:29:11 +02:00
Mihail Geshoski c3b14552f9 MDL-74189 tool_moodlenet: Update language strings
Updates the existing language strings in order to provide more accurate
instructions on how users can link existing their MoodleNet profile on
the site.
2022-04-06 22:24:20 +08:00
Sara Arjona 2496a8910c Merge branch 'MDL-74412-master' of https://github.com/lucaboesch/moodle 2022-04-06 15:59:55 +02:00
Tim Hunt 4144d09b4d MDL-74331 question bank: prevent any one column getting too wide 2022-04-06 14:56:24 +01:00
Sara Arjona b04f010a95 Merge branch 'wip_MDL-59545_master' of https://github.com/gjb2048/moodle 2022-04-06 12:42:07 +02:00
Ilya Tregubov 5975e3d203 Merge branch 'MDL-74348-master' of https://github.com/bmbrands/moodle 2022-04-06 16:23:37 +06:00
Ilya Tregubov e2a8a3cbf9 Merge branch 'MDL-74381-master' of https://github.com/aanabit/moodle 2022-04-06 15:37:42 +06:00
Sara Arjona f2ff93b3bc MDL-74419 search_simpledb: Search with quotes not working on Oracle
Global search with quotes is not working on DB engines without
full-text search support (i.e. Oracle).
2022-04-06 11:32:50 +02:00
Amaia Anabitarte 915b90b1ad MDL-74381 tool_componentlibrary: Resize icons to 24px in component library 2022-04-06 11:28:13 +02:00
Amaia Anabitarte 8d8b8d9066 MDL-74381 core_themes: Resizing svg mod icons to 24px 2022-04-06 11:19:10 +02:00
Cameron Ball 8937de6f40 MDL-74438 cache: Check if cached value is boolean false 2022-04-06 17:14:52 +08:00
Shamim Rezaie 7bc978482a Merge branch 'MDL-74420-master' of https://github.com/aanabit/moodle 2022-04-06 18:40:00 +10:00
Shamim Rezaie c62042d528 Merge branch 'MDL-74208-master-1' of https://github.com/mihailges/moodle 2022-04-06 15:57:16 +10:00
Ilya Tregubov e20d28bffb Merge branch 'MDL-74363' of https://github.com/Chocolate-lightning/moodle 2022-04-06 11:08:24 +06:00
Jake Dallimore 1f16a2cd69 Merge branch 'MDL-74371-master' of https://github.com/sharidas/moodle 2022-04-06 12:25:55 +08:00
Jake Dallimore 5d7a2019dd Merge branch 'MDL-74424-master' of https://github.com/mihailges/moodle 2022-04-06 12:15:32 +08:00
Sujith Haridasan cc24705880 MDL-74371 mod_survey: Indent the file as per coding style
Indent the file as per the coding style.
Adjust the comments so that they start with Caps and have a full
stop at the end.
Added file-level phpdoc.
2022-04-06 09:37:02 +05:30
Sujith Haridasan 33923a7969 MDL-74371 mod_survey: Wordrap long questions in response reports
Word wrap long questions in Response reports so that the users dont
see broken questions in the questions page.
2022-04-06 09:37:02 +05:30
AMOS bot ba08fa7361 Automatically generated installer lang files 2022-04-06 00:07:37 +00:00
Mihail Geshoski 540a9e35f2 MDL-74424 repository_googledocs: Update phpunit tests 2022-04-06 01:42:09 +08:00
Mihail Geshoski 63be4ed49f MDL-74424 repository_googledocs: Respect default import formats
Makes sure that the correct file extension is attributed when importing
a file using the Google Drive repository based on the set configuration
values for the default import format settings.
2022-04-06 01:23:51 +08:00
Eloy Lafuente (stronk7) 70e29b77f0 Merge branch 'MDL-74330-master-enfix' of https://github.com/vmdef/moodle 2022-04-05 18:39:23 +02:00
Luca Bösch ac2e962f61 MDL-74412 question: Not every column needs pr-3 in question bank. 2022-04-05 16:16:23 +02:00
Sara Arjona ad6dc71c56 on-demand release 4.0beta+ 2022-04-05 13:25:54 +02:00
Sara Arjona 97310ea55e Merge branch 'install_master' of https://git.in.moodle.com/amosbot/moodle-install 2022-04-05 13:25:51 +02:00
Bas Brands ea5638c354 MDL-74348 tool_lp: fix dialogue height and add scroll 2022-04-05 11:08:14 +02:00
Mathew May 96304ae607 MDL-74363 navigation: Add breadcrumbs in course use sub pages 2022-04-05 19:50:50 +12:00
Jun Pataleta f949a28d1d Merge branch 'MDL-74302-master' of https://github.com/rezaies/moodle 2022-04-05 12:05:55 +08:00
Shamim Rezaie 96644c0514 Merge branch 'MDL-74285-master' of https://github.com/sammarshallou/moodle 2022-04-05 14:00:38 +10:00
Jake Dallimore bd331da961 Merge branch 'MDL-74362-master' of https://github.com/sharidas/moodle 2022-04-05 11:50:25 +08:00
Sujith Haridasan 245610fc8f MDL-74362 admin: Add header text to the notifications page 2022-04-05 07:27:30 +05:30
Víctor Déniz bcb7b5b838 Merge branch 'MDL-74113-master' of https://github.com/HuongNV13/moodle 2022-04-04 19:20:44 +01:00
Sara Arjona fea804b5dc Merge branch 'MDL-74383-master' of https://github.com/mihailges/moodle 2022-04-04 15:46:19 +02:00
Sara Arjona 4388caf0af Merge branch 'MDL-74222' of https://github.com/paulholden/moodle 2022-04-04 15:22:26 +02:00
sam marshall 8c926d5cca MDL-74421 core_admin: Task log classname filter should be clearer
Change filter title from 'Name' to 'Class name' to indicate that
it only filters the classname, not the display name of the task.
2022-04-04 14:18:51 +01:00
Sara Arjona e9883614ab Merge branch 'MDL-74078-master' of https://github.com/mickhawkins/moodle 2022-04-04 15:09:34 +02:00
Amaia Anabitarte 23b751d131 MDL-74420 core_tags: Remove secondary navigation from tags page 2022-04-04 14:24:42 +02:00
Shamim Rezaie abbb55eadf MDL-74302 mod_quiz: Users with preview cap should see prevent messages 2022-04-04 19:03:20 +10:00
Shamim Rezaie 2b5be06b68 MDL-74302 mod_quiz: use notification renderable to display quiz notices 2022-04-04 19:03:20 +10:00
Shamim Rezaie 3a25a52375 MDL-74302 mod_quiz: preview cap has higher priority than the attempt cap 2022-04-04 19:03:20 +10:00
Jake Dallimore bd58b70e66 Merge branch 'MDL-74276-master-linkfarm' of https://github.com/peterRd/moodle 2022-04-04 15:59:19 +08:00
Jun Pataleta 9d5020ad10 Merge branch 'MDL-74303-master' of https://github.com/snake/moodle 2022-04-04 15:51:57 +08:00
Mihail Geshoski d5a48c941e MDL-74208 navigation: Avoid showing empty menu in single activity course
The following change prevents showing the 'Course' item (dropdown) in
the secondary navigation if this dropdown does not contain any items
when using the single activity course format.
2022-04-04 15:46:18 +08:00
Jake Dallimore 0dcb53ec19 MDL-74303 lib: pull upstream lib/lti1p3 changes to support JWKS parsing
This pulls in the latest changes from the moodle-fixes branch of
snake/lti-1-3-php-library. This specific change is required so JWKS
key parsing works when launching from platforms which omit the 'alg'
property in their JWKs.
2022-04-04 14:43:22 +08:00
Michael Hawkins a640f43181 MDL-74078 core_my: Lock all blocks on the my courses page 2022-04-04 14:24:56 +08:00
Sujith Haridasan 6edb78c86b MDL-74332 mod_survey: Indent the file properly
Correct the indentation of the file.
Replaced print_error with moodle_exception.
Updated the comments to start with capital and end with fullstop.
2022-04-04 11:29:15 +05:30
Jun Pataleta 8db56aeb31 Merge branch 'MDL-70014' of https://github.com/stronk7/moodle 2022-04-04 13:56:40 +08:00
Jun Pataleta 37f37a42d4 Merge branch 'MDL-74096-master' of https://github.com/ilyatregubov/moodle 2022-04-04 13:06:06 +08:00
Ilya Tregubov b470097bdb Merge branch 'MDL-74026' of https://github.com/paulholden/moodle 2022-04-04 10:47:10 +06:00
Ilya Tregubov 39ff636316 Merge branch 'master_MDL-74361-course-restore' of https://github.com/catalyst/moodle-MDL-70329 2022-04-04 10:28:32 +06:00
Sujith Haridasan bfb4c2797a MDL-74332 mod_survey: Critical incidents dont require summary and scales
Do not show summary and scales for the survey with critical
incidents. So critical incidents survey would have questions
and participants only under response reports.
Also corrected the heading for the Questions page.
2022-04-04 09:56:15 +05:30
Mihail Geshoski c1ab472180 MDL-74383 assignfeedback_editpdf: Fix comment issues in the pdf editor 2022-04-04 10:55:46 +08:00
Mihail Geshoski 2202c71a76 MDL-74383 assignfeedback_editpdf: 'Annotated PDF' link style update 2022-04-04 10:55:46 +08:00
AMOS bot fda33f6838 Automatically generated installer lang files 2022-04-04 00:07:31 +00:00
Gareth Barnard 8af8eeef69 MDL-59545 navigation: Missing editing icons on activity pages 2022-04-03 21:54:51 +01:00
Safat Shahin 294c77d8f7 MDL-74361 quiz: pre4.0 course restore bug fix for random question tags 2022-04-03 23:20:44 +10:00
Eloy Lafuente (stronk7) fa47604c20 MDL-70014 tool_customlang: Workaround to make behat happier
This is a BEHAT_RUNNING only hack, so it doesn't affect normal
operations at all. What it achieves is to reduce the number of
strings loaded when customising a lang pack from current 31K ones
to the just needed ones for Behat testing purposes.

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

Also, unrelated, a couple of tiny changes:
- Modified constant (that was really outdated) to current number
  of lang strings (so the progress bar behaves better).
- Remove an elseif occurrence because it was hurting my eyes.
2022-04-01 23:56:58 +02:00
Shamiso.Jaravaza 4483261625 MDL-74325 mod_bigbluebuttonbn: Fix presentation setting 2022-04-01 17:12:49 -02:30
Laurent David 8ab0990345 MDL-74404 mod_bigbluebuttonbn: Delete logs when course reset
* When Delete custom logs is selected we should delete all logs in
bigbluebuttonbn_logs table related to this course (join, add events...)
2022-04-01 20:07:08 +02:00
Paul Holden 4150685592 MDL-74222 course: add aria-controls attribute to expand/collapse all. 2022-04-01 18:44:24 +01:00
Paul Holden efbe15306a MDL-74222 forms: add aria-controls attribute to expand/collapse all. 2022-04-01 18:44:24 +01:00
Paul Holden b7417f2adf MDL-74026 admin: consistently show search element on admin pages. 2022-04-01 18:41:16 +01:00
Paul Holden c00a97c527 MDL-74341 reportbuilder: re-factor audience form permission checks. 2022-04-01 18:13:19 +01:00
sam marshall 896d0c225a MDL-74285 cachestore_redis: Unable to delete a Redis cache instance
When deleting a cache instance, it tried to purge it, even though
purge only makes sense for an individual definition (not the whole
instance). As a result, it errored.
2022-04-01 17:40:41 +01:00
Sara Arjona ec19f9f8cd Merge branch 'MDL-74298-master' of https://github.com/peterRd/moodle 2022-04-01 17:38:26 +02:00
Sara Arjona e2d435ca93 Merge branch 'MDL-74286-master' of https://github.com/ferranrecio/moodle 2022-04-01 17:34:30 +02:00
Sara Arjona b5f51883f0 on-demand release 4.0beta+ 2022-04-01 16:41:07 +02:00
Sara Arjona 2a50ee4464 NOBUG: Fixed SVG browser compatibility 2022-04-01 16:41:04 +02:00
Sara Arjona c9c372567f Merge branch 'install_master' of https://git.in.moodle.com/amosbot/moodle-install 2022-04-01 16:41:03 +02:00
Víctor Déniz a51d24c8a8 MDL-74330 lang: Replace modified strings in tests 2022-04-01 13:17:18 +01:00
Helen Foster 3719878cbf MDL-74330 lang: Import fixed English strings (en_fix) 2022-04-01 13:17:08 +01:00
Sara Arjona 7f6439674e Merge branch 'MDL-74221-master-form-buttons-revert' of https://github.com/snake/moodle 2022-04-01 12:31:58 +02:00
Ilya Tregubov 1d4c22a64a MDL-74096 mlbackend_python: Update mlbackend version. 2022-04-01 16:27:01 +06:00
Laurent David 96050a58ec MDL-74052 mod_bigbluebuttonbn: Wait for moderator not working with app
* On the server the poll was not started when we load the page
resulting in the status not being updated on moodle / browser side.
2022-04-01 11:43:43 +02:00
Jake Dallimore 706d7885b4 MDL-74221 enrol_lti: revert order change for action buttons 2022-04-01 17:33:54 +08:00
Jun Pataleta 20f8914f1e Merge branch 'MDL-74390' of https://github.com/timhunt/moodle 2022-04-01 17:00:21 +08:00
Michael Hawkins a0c6b4a174 MDL-74078 core: Add the ability to lock all blocks on a page 2022-04-01 15:12:56 +08:00
Bas Brands 1ed689080a MDL-74078 theme: Add missing block regions to mycourses 2022-04-01 15:12:56 +08:00
Peter Dias 2c27a33213 MDL-74276 report: Update behat tests to account for new page. 2022-04-01 12:44:04 +08:00
Peter Dias 6b25d957bf MDL-74298 core: Render complete links when searching for a setting. 2022-04-01 11:22:05 +08:00
Huong Nguyen 2fa497df65 MDL-74113 atto_media: Listen to play/pause events 2022-04-01 10:03:17 +07:00
Andrew Nicols 6d586191aa Merge branch 'MDL-69552-master' of https://github.com/HuongNV13/moodle 2022-04-01 10:57:33 +08:00
Andrew Nicols 54edee7468 Merge branch 'MDL-70731-master' of https://github.com/junpataleta/moodle 2022-04-01 10:19:56 +08:00
Jun Pataleta fc1f7014c1 Merge branch 'MDL-74221-master' of https://github.com/andrewnicols/moodle 2022-04-01 10:13:46 +08:00
Andrew Nicols 11d63a54a6 Merge branch 'MDL-74313-master' of https://github.com/peterRd/moodle 2022-04-01 10:13:46 +08:00
Andrew Nicols 46bdfc9b93 Merge branch 'MDL-72446' of https://github.com/stronk7/moodle 2022-04-01 10:13:46 +08:00
Andrew Nicols 80ec9a1c92 Merge branch 'MDL-74367-master' of https://github.com/vmdef/moodle 2022-04-01 10:13:44 +08:00
Jun Pataleta a3958a297e Merge branch 'MDL-74221-master' of https://github.com/andrewnicols/moodle 2022-04-01 10:12:58 +08:00
Eloy Lafuente (stronk7) b83e35d0ee Merge branch 'MDL-74221-master-fix' of https://github.com/snake/moodle 2022-04-01 10:12:58 +08:00
Ilya Tregubov d8208e6366 Merge branch 'MDL-73948-master-v4' of https://github.com/golenkovm/moodle 2022-04-01 10:12:58 +08:00
Jake Dallimore f739a10700 MDL-74221 enrol_lti: fix upgrade code to set correct status default 2022-04-01 10:12:57 +08:00
Ilya Tregubov 6dee96e420 Merge branch 'MDL-73197' of https://github.com/call-learning/moodle 2022-04-01 10:12:57 +08:00
Ilya Tregubov 14dcfbaf75 Merge branch 'MDL-74353' of https://github.com/paulholden/moodle 2022-04-01 10:12:56 +08:00
Andrew Nicols 3ba580e3f2 Merge branch 'MDL-74221-master' of https://github.com/snake/moodle 2022-04-01 10:12:56 +08:00
Jun Pataleta e4eb3b489f Merge branch 'MDL-74324-master' of https://github.com/ferranrecio/moodle 2022-04-01 10:12:56 +08:00
Jun Pataleta b5b9067828 Merge branch 'MDL-74294-master' of https://github.com/sarjona/moodle 2022-04-01 10:12:56 +08:00
Andrew Nicols b2ea2f87d8 Merge branch 'MDL-73900-master-fix' of https://github.com/junpataleta/moodle 2022-04-01 10:12:56 +08:00
Peter Dias 3eb80e7386 MDL-74276 report: Render a new 'Reports Overview' page 2022-04-01 08:56:00 +08:00
Tim Hunt 409b94cf09 MDL-74390 filter admin: log filter order changes in config_log 2022-03-31 16:49:03 +01:00
Andrew Nicols fa6920327e MDL-74221 enrol_lti: Update tests to match new icon and strings 2022-03-31 23:29:02 +08:00
Jun Pataleta 1c9448bfff MDL-70731 mod_forum: Fix moodle_exception error messages 2022-03-31 22:49:35 +08:00
Tim Hunt fbbd3d585e MDL-74390 filter admin: modernise coding style in admin/filters.php 2022-03-31 15:48:54 +01:00
Andrew Nicols 73ffa2e067 MDL-74221 enrol_lti: Fix misuse of moodle_url constructor 2022-03-31 21:37:51 +08:00
Eloy Lafuente (stronk7) c21a82df58 MDL-72446 behat: Ensure that the day reset happens on enabled element
Before this change we were setting the month day to 1 unconditionally
and that was working ok for enabled by default elements.

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

Backed with tests using disabled form elements, so we have now
both enabled and disabled fields covered.
2022-03-31 11:29:22 +02:00
Mikhail Golenkov e7f8064679 MDL-73948 report_loglive: Fix missing records 2022-03-31 18:34:53 +11:00
Huong Nguyen b307f3df02 MDL-69552 Quiz: Fix tag filter does not work when adding random question 2022-03-31 11:55:21 +07:00
Jake Dallimore 662c659324 MDL-74221 enrol_lti: change registration workflow to support drafts
This changes the admin pages such that to see the endpoints required
by the platform, an admin user must first create a draft registration.
This allows the registration uniqueid to be generated and included in
the initiate login and dynamic registration URLs.
2022-03-31 12:15:46 +08:00
Jun Pataleta cd1cec7529 MDL-73900 block_recentlyaccesseditems: Behat fix for "Show more items" 2022-03-31 10:08:17 +08:00
Andrew Nicols 465a300e47 Merge branch 'MDL-74370' of https://github.com/paulholden/moodle 2022-03-31 09:30:28 +08:00
AMOS bot 50f5cf64cf Automatically generated installer lang files 2022-03-31 00:07:35 +00:00
Paul Holden e5434fac25 MDL-74353 reportbuilder: improvements to report sidebar searching.
* Filter on item textContent instead of dataset, which isn't always
  present;
* Fix hiding of cards when they have no matching items
2022-03-30 21:17:45 +01:00
Paul Holden 7ca314023a MDL-74370 reportbuilder: fix permission check to edit own reports. 2022-03-30 16:26:33 +01:00
Sara Arjona 920946808d MDL-74294 theme: Update boost and classic screenshots
This patch updates the screenshots for boost and classic
themes, displayed in the theme selector.
These images have been created by Mary Cooch.

Co-authored by: Mary Cooch <mary@moodle.com>
2022-03-30 16:59:49 +02:00
Jun Pataleta 23b625340e Merge branch 'MDL-74295' of https://github.com/timhunt/moodle 2022-03-30 19:48:26 +08:00
Laurent David 52fdeaf112 MDL-73197 mod_bigbluebuttonbn: Fix activity join message
* When schedule is assigned to an activity, the Room still shows as ready to be joined, even if the room is still not open.
2022-03-30 13:41:34 +02:00
Ferran Recio 4d5395d27b MDL-74324 contentbank: fix RTL dropdown menu 2022-03-30 12:40:00 +02:00
Víctor Déniz c32c3e89ef MDL-74367 recentlyaccesseditems: full name in item card tooltip 2022-03-30 11:28:21 +01:00
Ilya Tregubov 67ac38811e Merge branch 'MDL-74245-master' of https://github.com/bmbrands/moodle 2022-03-30 15:10:24 +06:00
Víctor Déniz c6c99abe7a Merge branch 'MDL-74205-master' of https://github.com/ilyatregubov/moodle 2022-03-30 09:51:50 +01:00
Jun Pataleta a4d0770b87 Merge branch 'MDL-71801-master' of https://github.com/snake/moodle 2022-03-30 16:14:11 +08:00
Ilya Tregubov 337f727d39 Merge branch 'MDL-74342' of https://github.com/paulholden/moodle 2022-03-30 12:31:23 +06:00
Jun Pataleta 3ec0b7848d Merge branch 'MDL-74231' of https://github.com/stronk7/moodle 2022-03-30 14:28:28 +08:00
Jake Dallimore 6b071a03db Merge branch 'MDL-73105' of https://github.com/paulholden/moodle 2022-03-30 13:54:11 +08:00
Ilya Tregubov 053785ff5f MDL-74205 navigation: Don't show participants link to user if he has no permission. 2022-03-30 10:42:11 +06:00
Jun Pataleta bf13032bf7 Merge branch 'MDL-73900-master' of https://github.com/vmdef/moodle 2022-03-30 11:08:05 +08:00
Peter Dias 62c086ee72 MDL-74313 badge: Disable secondary navigation in badges 2022-03-30 09:17:53 +08:00
Eloy Lafuente (stronk7) 4e2b4a138d MDL-74231 grader report: Fix case where old settings are empty / null
There is an edge case in the conversion from old collapse/expand
settings (stored as user preference) to the new ones that can lead
to notices / warnings / errors.

Before PHP 8, they weren't being detected, but now they are.

Basically, if some of the expected components of the preferences
are missing, then some array (array_diff(), array_intersect()..)
operations now are failing, because now those parameter functions
do require to be arrays (so empty strings or nulls aren't allowed).

Also, there were some cases where the old preference was not being
removed ever, so its removal has been moved to a common place at
the end of the function, where it's always evaluated in case
the preference still exists but is empty of contents.

I've tried to cover all the cases I've been able to imagine with
unit tests (empty information, some component not set, all components
not set...), have moved it to a new unit test because the one
already performing some tests with those old preferences was
already too long to add more cases.
2022-03-29 23:46:45 +02:00
Eloy Lafuente (stronk7) 7ce003b666 on-demand release 4.0beta+ 2022-03-29 17:54:11 +02:00
Eloy Lafuente (stronk7) 37026d69bd Merge branch 'install_master' of https://git.in.moodle.com/amosbot/moodle-install 2022-03-29 17:54:07 +02:00
Paul Holden 949212ffda MDL-73105 qbank_managecategories: correct category edit URL. 2022-03-29 16:52:26 +01:00
Víctor Déniz e5d207a518 MDL-73900 recentlyaccesseditems: vertical display in blocks drawer 2022-03-29 11:50:17 +01:00
Paul Holden dcda9c08e2 MDL-74342 reportbuilder: remove unnecessary template/dataset values. 2022-03-29 09:46:55 +01:00
Jake Dallimore a1e763e670 MDL-71801 mod_lti: set default keytype value when upgrading tool types
MDL-66920 added this field but didn't set defaults for upgrading tool
types. This patch fixes that for any 1.3 tools which don't yet have a
value for this field.
2022-03-29 14:10:55 +08:00
Jun Pataleta 32f44c3534 Merge branch 'MDL-74291-master' of https://github.com/andrewnicols/moodle 2022-03-29 11:57:06 +08:00
Jun Pataleta a646e7999e Merge branch 'MDL-74243-master' of https://github.com/dravek/moodle 2022-03-29 11:33:28 +08:00
Andrew Nicols d3ba4dfb2b Merge branch 'MDL-74117-master' of https://github.com/rezaies/moodle 2022-03-29 11:24:48 +08:00
Jun Pataleta 4aad8fe6a4 Merge branch 'MDL-74110' of https://github.com/paulholden/moodle 2022-03-29 10:51:30 +08:00
Víctor Déniz ec0e5ee734 Merge branch 'MDL-74321-master' of https://github.com/junpataleta/moodle 2022-03-28 22:37:32 +01:00
Paul Holden a896ea6473 MDL-74342 reportbuilder: allow audiences to be immediately renamed.
Return rendered editable component in response to form submission
so that the audience card can be updated straight away.
2022-03-28 22:28:03 +01:00
Víctor Déniz 07d4b60341 Merge branch 'MDL-74300-master' of https://github.com/sharidas/moodle 2022-03-28 22:23:37 +01:00
Jun Pataleta a1e2933590 Merge branch 'MDL-74279' of https://github.com/stronk7/moodle 2022-03-28 23:28:54 +08:00
Jun Pataleta 328bba2743 Merge branch 'MDL-74266-master' of https://github.com/mihailges/moodle 2022-03-28 22:27:41 +08:00
Tim Hunt d3ef035706 MDL-74295 question bank: add help icons to columns that need it 2022-03-28 09:33:02 +01:00
Andrew Nicols d5e0a57333 Merge branch 'MDL-74299-master' of https://github.com/ericmerrill/moodle 2022-03-28 15:52:25 +08:00
Shamim Rezaie 8248badec7 MDL-74117 theme_boost: Remove handling of Space and Enter in dropdowns
The custom handling of Space and Enter for dropdowns that was added to
aria.js were not needed in the latests Bootstrap versions. So removed
them. Vanilla Bootstrap emulates click when Space or Enter keys are
pressed on a tab.
2022-03-28 18:19:47 +11:00
Shamim Rezaie ad19422833 MDL-74117 theme_boost: Only focus the trigger if nothing else is focused 2022-03-28 18:19:47 +11:00
Jun Pataleta 53fc54cce5 Merge branch 'MDL-74257-master' of https://github.com/ferranrecio/moodle 2022-03-28 14:45:14 +08:00
Jun Pataleta 1a6bf2e5ff MDL-74321 mod_forum: Add forum_check_throttling unit tests 2022-03-28 14:39:21 +08:00
Andrew Nicols 4bb0feb176 MDL-73952 course: Revert iscurrent => highlighted rename 2022-03-28 14:37:55 +08:00
Ilya Tregubov 305a25ae53 Merge branch 'MDL-59681-recursive-file' of https://github.com/brendanheywood/moodle 2022-03-28 11:53:50 +06:00
Sujith Haridasan f2c7f35f78 MDL-74300 core_grades: Fix errors in bulk to gradebook
This change prevents the printing of header when the
moodles page's state is STATE_IN_BODY. Due to the absence
of this check when user entered graded in bulk was causing
errors.
2022-03-28 11:12:40 +05:30
Andrew Nicols 495da02824 MDL-73952 core_course: Rename iscurrent to highlighted
The term 'iscurrent' suggests that something is current, when this may
not be technically true. The term highlight is more appropriate as we
are highlighting content. Whether that content is for the current week
may also be true, but it may be that some course formats allow multiple
sections to be highlighted.
2022-03-28 13:15:12 +08:00
Andrew Nicols a313795354 Merge branch 'MDL-73952-master' of https://github.com/bmbrands/moodle 2022-03-28 13:09:55 +08:00
Jun Pataleta 86f97c625e MDL-74321 mod_forum: Forum_check_throttling improvements and fixes
* Fetch only the fields required by the function.
* Quick validation of the passed forum parameter. If the forum parameter
is an object, it should have the forum ID and the course ID.
* Default return when there's no need to show a warning yet.
2022-03-28 13:08:47 +08:00
Jun Pataleta 0a77eb4ace MDL-74321 mod_forum: Pass course module to forum_check_throttling() 2022-03-28 10:04:05 +08:00
Jun Pataleta 996534fbea MDL-74321 mod_forum: forum_check_throttling performance improvements
* Return early if the forum's blockafter or blockperiod attributes
are empty.
* If $cm is not passed in forum_check_throttling(), try to fetch it
using get_fast_modinfo() which avoids DB reads. Fetch it via
get_coursemodule_from_instance() as a last resort (though it's unlikely
to happen).
2022-03-28 10:03:57 +08:00
Eloy Lafuente (stronk7) b7dc12b160 Merge branch 'MDL-72634' of https://github.com/paulholden/moodle 2022-03-27 16:50:29 +02:00
Eloy Lafuente (stronk7) 1c2fd1cfb9 Merge branch 'MDL-74309' of https://github.com/timhunt/moodle 2022-03-27 16:47:08 +02:00
Eloy Lafuente (stronk7) 4344d4b55b Merge branch 'MDL-72958' of https://github.com/timhunt/moodle 2022-03-27 16:43:15 +02:00
Eloy Lafuente (stronk7) ad2d361db1 Merge branch 'MDL-74306' of https://github.com/paulholden/moodle 2022-03-27 16:04:14 +02:00
Eloy Lafuente (stronk7) c3f1c89a00 Merge branch 'master_MDL-73808-question-bank-upgrade-bkp' of https://github.com/catalyst/moodle-MDL-70329 2022-03-27 16:01:49 +02:00
Nadav Kavalerchik ba98dcfa9c MDL-58044 report/progress: Fix table headers labels display in RTL mode. 2022-03-26 23:31:14 +03:00
Eloy Lafuente (stronk7) 8f414e42a9 MDL-74279 phpunit: Tests using sqlsrv AdoDB must reset settings
AdoDB SQL*Server drivers use to modify some error and
logging preferences. As far as the connection is shared
with the main one, that implies that those settings
remain for the whole remaining execution.

We don't want his in tests, because can affect to other
tests at distance.

We are fixing this here, only for tests, because it
doesn't affect normal requests and because, once we
remove AdoDB this won't be needed anymore.
2022-03-26 18:40:11 +01:00
AMOS bot c0ce09040c Automatically generated installer lang files 2022-03-26 00:07:34 +00:00
Víctor Déniz efda17d3b0 on-demand release 4.0beta+ 2022-03-25 15:01:23 +00:00
Víctor Déniz 1aa213d761 Merge branch 'install_master' of https://git.in.moodle.com/amosbot/moodle-install 2022-03-25 15:01:16 +00:00
Jun Pataleta 935a18f7b0 Merge branch 'MDL-73848-master' of https://github.com/junpataleta/moodle 2022-03-25 17:58:18 +08:00
Jun Pataleta 616fe3ac3a Merge branch 'MDL-74138-master' of https://github.com/snake/moodle 2022-03-25 17:56:11 +08:00
Jun Pataleta 097d14c3f2 Merge branch 'MDL-74143' of https://github.com/stronk7/moodle 2022-03-25 17:56:10 +08:00
Shamim Rezaie 6c93bd7e21 Merge branch 'MDL-74103-master' of https://github.com/HuongNV13/moodle 2022-03-25 17:56:10 +08:00
Tim Hunt de8472df88 MDL-74309 quiz: removed obsolete code related to random tags 2022-03-25 09:53:46 +00:00
Paul Holden 17dd5bbae0 MDL-74202 webservice: fix protocol type in exception message. 2022-03-25 09:53:23 +00:00
Sujith Haridasan 49dabbbf32 MDL-73848 administration: Fix the Site home settings breadcrumbs 2022-03-25 17:45:04 +08:00
Sujith Haridasan 1bb972ae0a MDL-73848 administration: Add tests for breadcrumbs and nav highlights
This change includes addition of tests for verifying the secondary
and tertiary nav highlights.
It also includes the tests to verify the breadcrumbs for the pages.
2022-03-25 17:44:58 +08:00
Sujith Haridasan aa1c2e2382 MDL-73848 administration: Fix the breadcrumbs and nav highlights
Create or update the breadcrumbs in the site administration
pages where it is required.
Highlight the corresponding site adminstration tab.
Highlight the primary nav to Site administration when user
is navigating to any of the site administration pages.

Also changed the boostnavbar so that the nodes in the secondary
navigation are not shown in the breadcrumbs when user is in site
administration page.
2022-03-25 17:44:47 +08:00
Mihail Geshoski eac7fa895e MDL-74266 navigation: Perform strict check whether key exists in array 2022-03-25 16:06:24 +08:00
Mihail Geshoski 9e602435a7 MDL-74266 mod_chat: Add identifier to the 'Past sessions' nav node 2022-03-25 15:14:40 +08:00
Huong Nguyen ab659db113 MDL-74103 usertours: Make step position calculation based on contenttype 2022-03-25 11:10:17 +07:00
Víctor Déniz 06eded2a8b Merge branch 'MDL-74224-master' of https://github.com/HuongNV13/moodle 2022-03-24 16:30:15 +00:00
Víctor Déniz c21f2a73b1 Merge branch 'MDL-73393-master' of https://github.com/peterRd/moodle 2022-03-24 15:59:50 +00:00
Víctor Déniz c5a510cd09 Merge branch 'MDL-73914-master' of https://github.com/lameze/moodle 2022-03-24 15:54:56 +00:00
Jun Pataleta c1c52cfddd Merge branch 'MDL-73556-master' of https://github.com/ferranrecio/moodle 2022-03-24 23:50:07 +08:00
Ferran Recio fb3fb34b09 MDL-74286 gradereport_grader: fix overlap scale selector 2022-03-24 14:07:54 +01:00
Peter Dias 0a7b8dbc46 MDL-73393 navigation: Reintroduce nav-drawer and add a button
- Reintroduce nav components to have backwards compatibility with existing themes
- Mark for deprecation flat_navigation and flat_navigation_node
2022-03-24 19:59:48 +08:00
David Matamoros d3bc3ec0c9 MDL-74243 reportbuilder: Fixed double encoding in report/filter name 2022-03-24 11:46:55 +01:00
Safat Shahin 6045e6b67b MDL-73808 core_question: Add efficiency in question migration
This commit will add some efficiency around the question
migration.

Co-Authored-By: Safat Shahin <safatshahin@catalyst-au.net>
Co-Authored-By: Andrew Lyons <andrew@nicols.co.uk>
2022-03-24 20:34:14 +11:00
Víctor Déniz 0366908f12 Merge branch 'MDL-74307-master' of https://github.com/sharidas/moodle 2022-03-24 09:20:40 +00:00
Jun Pataleta 9f951edbff Merge branch 'MDL-72007-master' of https://github.com/peterRd/moodle 2022-03-24 16:37:46 +08:00
Peter Dias e3921e1c74 MDL-72007 navigation: Update upgrade.txt files 2022-03-24 16:36:22 +08:00
Jun Pataleta 2bce5d8be5 Merge branch 'MDL-74274-master' of https://github.com/peterRd/moodle 2022-03-24 16:33:39 +08:00
Sara Arjona 8c502259f3 Merge branch 'MDL-74280' of https://github.com/paulholden/moodle 2022-03-24 08:33:49 +01:00
Ilya Tregubov 7bedf54f5b Merge branch 'master_MDL-73763_index-fix' of https://github.com/catalyst/moodle-MDL-70329 2022-03-24 13:14:03 +06:00
Ilya Tregubov 84fbc7b31b Merge branch 'MDL-74193' of https://github.com/paulholden/moodle 2022-03-24 13:08:13 +06:00
Marc-Alexandre Ghaly c3ac868bf7 MDL-73763 core : Index fixes for reference tables
This commit will add the index for the question_reference
and the question_set_reference table if its not already
added. This commit will also implement the logic of adding
the question area and component in the joins of the question
reference table in order to make sure any other plugin using
the qbank api does not conflict with each other.
2022-03-24 18:04:47 +11:00
Jake Dallimore 86f08a393f MDL-74221 enrol_lti: db changes supporting draft registrations
Summary:
- Allows nulls for a number of fields meaning largely empty drafts can
be stored.
- Adds 'uniqueid', an id unique to each issuer which is intended
to be used as a parameter in both the initiate login and dynamic
registration urls provided to platforms, as a means to identify specific
registrations for the issuer, in the absense of client_id (optional in
the 1.3 spec).
- Add 'status', used to denote draft or active registrations.
2022-03-24 14:12:24 +08:00
Huong Nguyen 9f9e940a19 MDL-74224 atto_managefiles: Remove unnecessary scrollbar 2022-03-24 09:37:12 +07:00
Jun Pataleta efe227d1bf Merge branch 'MDL-73713-readonly-txn-latency' of https://github.com/catalyst/moodle 2022-03-24 10:17:30 +08:00
Srdjan d8baf29573 MDL-73713 dml: moodle_read_slave_trait default latency to 1 second
In practice it is as if the feature was turned off most of the time.
However, some long processes may benefit from this very safe value
in case admins missed to configure it.
2022-03-24 09:32:24 +10:00
Srdjan 343384d921 MDL-73713 dml: test namespaces fix - a noop 2022-03-24 09:30:10 +10:00
Eric Merrill 29f83023a6 MDL-74299 question: Don't use a strict comparison for DB objects 2022-03-23 19:20:22 -04:00
Srdjan 8a386d68f6 MDL-73713 dml: moodle_read_slave_trait table written time adjustment
moodle_database::commit_delegated_transaction() calls
core\event\manager::database_transaction_commited() which may invoke
events that do database reads.
This change adjusts tables last written time in moodle_read_slave_trait *before*
calling moodle_database::commit_delegated_transaction().
2022-03-24 09:19:56 +10:00
Eloy Lafuente (stronk7) 848ec32df0 MDL-74143 database: Make get_indexes() to return original column names
Sometimes, in order to provide a cross-db behaviour of unique indexes
mixing null and not null columns, we create, under the hood, some
function based indexes.

When that happens get_indexes() is returning the name of the
expression objects used to calculate that function index. But we need
the original column names to be able to compare indexes and get
column dependencies properly.

So, this patch just looks, when the index is unique and function based,
to the expressions (pretty standard CASE statements) and gets the
original column name from it.

Covered with tests.
2022-03-23 23:16:53 +01:00
Paul Holden e420fbe303 MDL-74306 mod_assign: fix undefined property in override cache key. 2022-03-23 18:55:03 +00:00
Ferran Recio b4f62d2426 MDL-74257 core_courseforrmat: fix make available badge 2022-03-23 17:31:22 +01:00
Víctor Déniz 7a65b2a3c7 Merge branch 'MDL-74288-master' of https://github.com/snake/moodle 2022-03-23 15:25:38 +00:00
Sara Arjona 733419daa9 Merge branch 'master-MDL-48633' of https://github.com/golenkovm/moodle 2022-03-23 15:14:27 +01:00
Sara Arjona d084f08db3 Merge branch 'MDL-74283' of https://github.com/paulholden/moodle 2022-03-23 13:53:16 +01:00
Sara Arjona b46c643276 Merge branch 'MDL-57383' of https://github.com/paulholden/moodle 2022-03-23 13:51:08 +01:00
Ilya Tregubov 56c82a85e8 Merge branch 'MDL-74121-master' of https://github.com/sharidas/moodle 2022-03-23 17:22:15 +06:00
Sujith Haridasan 6c7324856d MDL-74307 core_search: Use PARAM_ALPHANUMEXT for $areaid
Use PARAM_ALPHANUMEXT for $areaid as areaid can also be
say mod_h5pactivity. When PARAM_ALPHAEXT is used it would
become mod_hpactivity and would cause exception in code flow.
2022-03-23 14:47:34 +05:30
Sujith Haridasan ff5381ad95 MDL-74121 mod_forum: Fix the posting threshold issue
When a student post exceeds the posting threshold
block then 'Add discussion topic' button should not be shown.
Also the student cannot reply to a topic if this is exceeded.
2022-03-23 14:23:29 +05:30
Shamim Rezaie b66925ce26 Merge branch 'MDL-73792-master' of https://github.com/HuongNV13/moodle 2022-03-23 19:07:28 +11:00
Bas Brands 8ccc266f4d MDL-73792 theme_boost: drawer layout spacing for mobile 2022-03-23 11:31:09 +07:00
Ilya Tregubov a824011103 Merge branch 'MDL-74091-master' of https://github.com/lucaboesch/moodle 2022-03-23 09:11:30 +06:00
Peter Dias 3c51d8a87b MDL-74274 lesson: Set maxattempts reached when retries allowed 2022-03-23 10:26:23 +08:00
AMOS bot 85022e2172 Automatically generated installer lang files 2022-03-23 00:07:32 +00:00
Paul Holden 4102ae35a4 MDL-74283 dml: replace hardcoded concat SQL with appropriate API. 2022-03-22 17:33:03 +00:00
Paul Holden b6d8939959 MDL-72634 user: populate default city/country during user creation. 2022-03-22 17:28:09 +00:00
Sara Arjona 838704aa85 MDL-74184 behat: Unrelated, remove the @skip_interim tag
This commit is UNRELATED to the MDL-74184, but we need the
@skip_interim tag removed to a couple of scenarios that were
causing lots of noise and failures @ci infrastructure.
MDL-74265 was created to deal with this issue but these jobs
are now passing, and nothing has been changed...

So we are using MDL-74184 (this extra commit) to remove that
tag (sorry for the noise).
2022-03-22 17:22:58 +01:00
Sara Arjona a3de1eff1b Merge branch 'MDL-74160-master' of https://github.com/ferranrecio/moodle 2022-03-22 16:51:05 +01:00
Sara Arjona d5ade9c68c Merge branch 'MDL-74049' of https://github.com/Chocolate-lightning/moodle 2022-03-22 16:47:49 +01:00
Sara Arjona f4730df85e Merge branch 'MDL-74184' of https://github.com/timhunt/moodle 2022-03-22 16:42:03 +01:00
Tim Hunt ee80bc47b7 MDL-72958 questions: tidy up all question-related upgrade.txt files 2022-03-22 14:53:43 +00:00
Luca Bösch 96581087a9 MDL-74091 core_question: 'table-responsive' qtable avoids overlap. 2022-03-22 14:19:42 +01:00
Mikhail Golenkov 4c3932dbca MDL-48633 mod_lesson: Fix lesson grade handling when scales in use 2022-03-22 23:02:20 +11:00
Sara Arjona 34ce1463cc on-demand release 4.0beta+ 2022-03-22 12:55:08 +01:00
Sara Arjona aca06f668c Merge branch 'install_master' of https://git.in.moodle.com/amosbot/moodle-install 2022-03-22 12:55:03 +01:00
Tim Hunt 439ecc57fd MDL-74184 quiz: prevent repagination of quizzes with attepts
There was a loophole to this rule on the settings form, which is now fixed.
2022-03-22 10:32:24 +00:00
Ferran Recio ce7edab8a8 MDL-74160 core_coureformat: fix legacy renderer methods
To ensure legacy course formats works on Moodle 4.0 some method are
reintroduced (but marked as deprecated) like start_section_list and
end_section_list. Furthermore, the course_section_cm_availability
returns a string again as expected.
2022-03-22 10:59:14 +01:00
Andrew Nicols 6212b71318 MDL-74291 mod_bigbluebuttonbn: Allow students to join moderated meetings 2022-03-22 16:09:45 +08:00
Jake Dallimore afbf15cd97 MDL-74288 enrol_lti: fix cross-origin postMessage call in registration
This isn't using the targetOrigin, which should be passed as 2nd param.
2022-03-22 11:06:23 +08:00
Ilya Tregubov debe19b49b Merge branch 'MDL-74161' of https://github.com/Chocolate-lightning/moodle 2022-03-22 08:56:04 +06:00
Ilya Tregubov 719cc6024e Merge branch 'MDL-74169-master' of https://github.com/FMCorz/moodle 2022-03-22 08:46:46 +06:00
Jun Pataleta ad1660721c Merge branch 'MDL-73795-master' of https://github.com/bmbrands/moodle 2022-03-22 10:22:45 +08:00
Jun Pataleta 5fffb343cb Merge branch 'MDL-72698' of https://github.com/stronk7/moodle 2022-03-22 10:19:37 +08:00
Simey Lameze 37bf03b2f4 MDL-73914 course: move both options to more menu
This commit moves the 'Download course content' and 'Unenrol me from course'
options to more menu.
2022-03-22 10:03:29 +08:00
Simey Lameze b74b47065a MDL-73914 course: remove download course content button 2022-03-22 10:03:29 +08:00
Mathew May 4eb7094908 MDL-74049 navigation: Set active secondary node in course reuse areas 2022-03-22 09:53:01 +08:00
Eloy Lafuente (stronk7) b3a7c45930 MDL-72698 behat: fix problem with FF, not able to auto-scroll iframes
The "Save changes" button in the SCORM package falls out from the
viewport and that seems to be a problem for Firefox, not being able
to auto-scroll to it before clicking.

So we are just making the window 200 points taller and that
makes the button to be visible (within the viewport) and clickable.

Also, change the way we "wait" at the end of the scenario and,
instead of reloading, we re-visit one of the contents to allow
completion to be ready for final assertions.
2022-03-22 01:36:40 +01:00
AMOS bot e77c71110c Automatically generated installer lang files 2022-03-22 00:07:32 +00:00
Sara Arjona 5ca12a21a6 Merge branch 'MDL-74253-master' of https://github.com/aanabit/moodle 2022-03-21 15:51:10 +01:00
Jun Pataleta 8c68977785 Merge branch 'MDL-74254-master' of https://github.com/marinaglancy/moodle 2022-03-21 22:46:01 +08:00
Sara Arjona 375cdaa6a5 Merge branch 'MDL-73950-master' of https://github.com/snake/moodle 2022-03-21 15:38:21 +01:00
Andrew Nicols 459c37755b Merge branch 'MDL-74072_master' of https://github.com/TomoTsuyuki/moodle 2022-03-21 22:30:32 +08:00
Sara Arjona 24ab8bba41 Merge branch 'MDL-74062-master' of https://github.com/bmbrands/moodle 2022-03-21 15:21:55 +01:00
Marina Glancy 09446a2934 MDL-74254 course: User may not have capability to browse courses 2022-03-21 14:44:14 +01:00
Sara Arjona 0babca4344 Merge branch 'MDL-74225' of https://github.com/paulholden/moodle 2022-03-21 12:59:30 +01:00
Sara Arjona f013b9c339 Merge branch 'MDL-74228-master' of https://github.com/dravek/moodle 2022-03-21 12:49:51 +01:00
Sara Arjona a221c171f0 Merge branch 'MDL-74183-master' of https://github.com/ericmerrill/moodle 2022-03-21 12:41:10 +01:00
Víctor Déniz bc02234cee Merge branch 'MDL-74109-master' of https://github.com/lameze/moodle 2022-03-21 10:56:32 +00:00
Frédéric Massart bee1bb317e MDL-74169 core_message: Hide preferences link when permissions lacking 2022-03-21 18:37:45 +08:00
Paul Holden 652242f618 MDL-74280 reportbuilder: ensure calendar panel zIndex calculated.
Since 29c00fc1 it is calculated dynamically. Ensure all elements
that would otherwise overlap the panel add appropriate class so
they are accounted for during this calculation.
2022-03-21 09:51:59 +00:00
Jun Pataleta 76edf78668 Merge branch 'MDL-74031-master' of https://github.com/bmbrands/moodle 2022-03-21 17:38:54 +08:00
Ilya Tregubov d7e5e22117 Merge branch 'MDL-73607-master' of https://github.com/rezaies/moodle 2022-03-21 15:35:03 +06:00
Jun Pataleta 4a5a25cbc4 Merge branch 'MDL-72698' of https://github.com/stronk7/moodle 2022-03-21 17:13:55 +08:00
Brendan Heywood 34efb9a19e MDL-59681 file: Stop recursive file serving 2022-03-21 17:50:20 +11:00
Ilya Tregubov bbb3f3edcd Merge branch 'MDL-74088-master' of https://github.com/lameze/moodle 2022-03-21 12:48:31 +06:00
Andrew Nicols 424143b2e6 Merge branch 'MDL-74229-master' of https://github.com/bmbrands/moodle 2022-03-21 13:07:48 +08:00
Andrew Nicols 6d8bb892ec Merge branch 'MDL-74269-master' of https://github.com/ericmerrill/moodle 2022-03-21 12:51:24 +08:00
Ilya Tregubov 8a8001fcae Merge branch 'MDL-74134-master' of https://github.com/lucaboesch/moodle 2022-03-21 10:22:13 +06:00
Ilya Tregubov 8b871d98b4 Merge branch 'MDL-73891-master' of https://github.com/sarjona/moodle 2022-03-21 10:12:27 +06:00
Eloy Lafuente (stronk7) 9392313b88 MDL-72698 behat: Reduce random lesson behat failures on slow envs
In very slow environments viewing the lesson page for a student takes
more than 1 second and, because of this, the "Spend at least 1 sec"
completion condition is considered done.

So, in order to alleviate this problem, that leads to random failures
in CIs with slow databases, we have changed the condition to be 3
seconds instead.

That seems to do the work in super-slow environments, with 100
executions passing ok (when previously the scenario was failing 33%
of times).

The only cost is that now the behat run will be 2 seconds slower (there
is a wait changed from 2 to 4 seconds), but that's an acceptable
price to pay to get the scenarios consistent passing.

See the issue for more details.
2022-03-19 18:10:01 +01:00
Eloy Lafuente (stronk7) 2663e21be3 MDL-72698 behat: Reduce random scorm behat failures on slow envs
This just applies two "tricks" to make the test to behave better:
- Ensuring that the "wait until the page is loaded" happens in the scorm frame.
- Ensuring that the last item in the package gets some extra time
  by reloading the page completely at the end.

With them, a testing environment with a 100% of failures has become 100%
passing (25 repetitions). That should be good enough to reduce the
impact of that failure everywhere.

See the issue for more details.
2022-03-19 18:09:45 +01:00
Paul Holden ec89abc5bf MDL-74110 forms: disable calendar link when date selector disabled. 2022-03-19 14:24:23 +00:00
Andrew Nicols 322395f29c Merge branch 'MDL-74199-master' of https://github.com/aanabit/moodle 2022-03-19 22:00:16 +08:00
Andrew Nicols 18f79ec838 Merge branch 'MDL-74258-master' of https://github.com/cescobedo/moodle 2022-03-19 21:48:14 +08:00
Andrew Nicols ca4fd43f48 Merge branch 'MDL-74270' of https://github.com/timhunt/moodle 2022-03-19 21:40:31 +08:00
Tim Hunt d76a072636 MDL-74270 format_float: fix bug with $decimalpoints=0, $stripzeros=true 2022-03-18 22:12:38 +00:00
Eric Merrill dd5406527a MDL-74269 course: Make sure category exists before updating 2022-03-18 15:30:19 -04:00
Amaia Anabitarte 13e66c48f8 MDL-74253 core_course: get_nearest_editable_subcategory for hidden cat 2022-03-18 18:15:59 +01:00
Luca Bösch f10e19c41c MDL-74134 graphics: Adding SVG log icon. 2022-03-18 17:55:20 +01:00
cescobedo 8581555f9d MDL-74258 mod_h5pactivity: Add global search to h5pactivity 2022-03-18 17:06:11 +01:00
Sara Arjona 0d0f09bc7f on-demand release 4.0beta+ 2022-03-18 16:28:33 +01:00
Ferran Recio bf642fb6fc MDL-73556 core_courseformat: fix course index click toggle
When the user clicks on a course index chevron the section is toggled.
However, when clicks on the section name the section is expanded but
never collapsed.
2022-03-18 14:39:32 +01:00
Sara Arjona 5584c7b6a6 MDL-74116 behat: Unrelated, add the @skip_interim tag
This commit is UNRELATED to the MDL-74116, but we need the
@skip_interim tag added to a couple of scenarios that are
causing lots of noise and failures  @CI infrastructure.
MDL-74265 has been created to deal with this issue.

So we are using MDL-74116 (this extra commit) to add that tag
(sorry for the noise).
2022-03-18 13:45:42 +01:00
Jun Pataleta a96cec3ed3 Merge branch 'MDL-73233-fix' of https://github.com/sarjona/moodle 2022-03-18 16:15:19 +08:00
Sara Arjona 30b75b7190 MDL-73233 navigation: Breadcrumbs removed from user preferences
In MDL-74087 breadcrumbs were removed from the User preferences page.
This patch re-introduces a piece of code that was removed originally
in MDL-73233 while reviewing all the places where the Dashboard was
displayed by default (to avoid inconsistencies). New item in primary
navigation has been changed to "Home" but we still need the code
re-added to hide breadcrumbs when its content matches the primary
navigation.
2022-03-18 07:44:55 +01:00
Jun Pataleta cd2225a71b Merge branch 'MDL-73383-master' of https://github.com/rezaies/moodle 2022-03-18 12:00:23 +08:00
Jun Pataleta 9a9244dcf9 Merge branch 'MDL-73793-master' of https://github.com/bmbrands/moodle 2022-03-18 11:51:20 +08:00
Shamim Rezaie bdccf3eb3b Merge branch 'MDL-73593-master' of https://github.com/bmbrands/moodle 2022-03-18 11:30:27 +11:00
Víctor Déniz d60d936c0e Merge branch 'MDL-74153-master' of https://github.com/ferranrecio/moodle 2022-03-17 23:02:24 +00:00
Eloy Lafuente (stronk7) 337dea4afa Merge branch 'MDL-69078-better-error-message-for-wrong-encoding' of https://github.com/ziegenberg/moodle 2022-03-17 22:22:03 +01:00
Daniel Ziegenberg f942a5cedd MDL-69078 questions: check for UTF-8 encoding of the import file
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2022-03-17 20:53:50 +01:00
Eloy Lafuente (stronk7) 05c07f2656 Merge branch 'MDL-74159-master' of https://github.com/sarjona/moodle 2022-03-17 18:08:25 +01:00
Eloy Lafuente (stronk7) 3a2b094973 Merge branch 'MDL-74240-master' of https://github.com/bmbrands/moodle 2022-03-17 18:06:05 +01:00
Jun Pataleta 1e533995dd Merge branch 'MDL-73233-master' of https://github.com/sarjona/moodle 2022-03-18 00:35:11 +08:00
Sara Arjona 47550abe6b Merge branch 'MDL-74080-master' of https://github.com/aanabit/moodle 2022-03-17 17:21:23 +01:00
Sara Arjona d51c17a2ca Merge branch 'MDL-74076' of https://github.com/paulholden/moodle 2022-03-17 16:58:00 +01:00
Sara Arjona 12252ebec0 Merge branch 'MDL-74172-master' of https://github.com/bmbrands/moodle 2022-03-17 15:48:14 +01:00
Sara Arjona 1ccea2c9ff Merge branch 'MDL-74132' of https://github.com/roland04/moodle 2022-03-17 15:42:34 +01:00
Andrew Nicols 27bed0b928 Merge branch 'MDL-72991-master-4' of https://github.com/HuongNV13/moodle 2022-03-17 22:25:10 +08:00
Bas Brands 0ee53f2dcd MDL-74240 mod_forum: tertiary nav button wrapper 2022-03-17 13:56:29 +01:00
Sara Arjona 08bae4cce8 Merge branch 'MDL-74214' of https://github.com/paulholden/moodle 2022-03-17 13:11:47 +01:00
Jun Pataleta cb9480841c Merge branch 'MDL-74216-master' of https://github.com/mihailges/moodle 2022-03-17 19:47:46 +08:00
Bas Brands 012ba2d823 MDL-74245 tool_lp: region-main overflow for dropdowns 2022-03-17 12:27:41 +01:00
Sara Arjona dbb63cfffc Merge branch 'MDL-73863-master' of https://github.com/mihailges/moodle 2022-03-17 11:33:58 +01:00
Bas Brands c546292739 MDL-74062 theme_boost: fix header with for course admin pages 2022-03-17 11:01:17 +01:00
Ilya Tregubov ff0b43830a Merge branch 'MDL-73999' of https://github.com/paulholden/moodle 2022-03-17 15:23:56 +06:00
Bas Brands 40357a1976 MDl-74031 mod_assign: limited pagewidth for view action 2022-03-17 10:23:32 +01:00
Jun Pataleta 23ea7d6b43 Merge branch 'MDL-74112-master' of https://github.com/andrewnicols/moodle 2022-03-17 17:08:47 +08:00
Huong Nguyen bfe14e2312 MDL-72991 Course: Partial course cache rebuild with cache versioning 2022-03-17 15:34:26 +07:00
Huong Nguyen 457d10a49f MDL-72991 Course: Fix move_section_to is not updating correct section
When we change the position of two sections, we just need to update
the position of the affected sections, not all the sections in the course.
This will improve the performance since the system only executes the queries to affected sections.
Also, the system only clears the cache for affected sections, not all the sections in the course.
2022-03-17 15:34:26 +07:00
Huong Nguyen 273fbac739 MDL-72991 Course: Create PHPUnit for course_modinfo and move_section_to
Newly PHPUnit tests were created to verify the below methods
 - course_modinfo::purge_section_cache_by_id()
 - course_modinfo::purge_section_cache_by_number()
 - move_section_to()
2022-03-17 15:34:26 +07:00
Huong Nguyen 4bc2b24a51 MDL-72991 Course: Modify the courseminfo cacheid to force a rebuild
Co-authored-by: Andrew Lyons <andrew@nicols.co.uk>
2022-03-17 15:34:26 +07:00
Dongsheng Cai f97b86e841 MDL-72991 Course: Partial course cache rebuild
When updating/deleting a section/module, the system now only
invalidate of the element (section/module), not the whole course cache
Also, the system now only recalculate the cache for element (section/module)
if necessary, not the whole course cache

Move module/section purging to course_modinfo:
  + course_modinfo::purge_course_section_cache_by_id was created to purge section by id
  + course_modinfo::purge_course_section_cache_by_number was created to purge section by number
  + course_modinfo::purge_course_module_cache was created to purge module
2022-03-17 15:34:01 +07:00
Sara Arjona 95e3d07435 Merge branch 'MDL-74127-master' of https://github.com/peterRd/moodle 2022-03-17 09:14:58 +01:00
Jun Pataleta e2e048d49a Merge branch 'MDL-73597-master' of https://github.com/HuongNV13/moodle 2022-03-17 15:50:36 +08:00
Simey Lameze 177c5cbd7f MDL-74109 lib: replace deprecated compile call 2022-03-17 12:10:18 +08:00
Andrew Nicols 44a4e78075 MDL-74112 course: Support multiple mforms in format chooser
The format chooser JS assumes that it is the only mform on the page. If
it is not, and another mform appears before it, then the jump will not
work.

This change:
* updates the formatchooser to modern JS
* allows multiple forms to exist on the page
* stops using id fields
* always hide the format selection button
2022-03-17 11:11:53 +08:00
Eloy Lafuente (stronk7) 5b98ad241a Merge branch 'MDL-74116-master' of https://github.com/andrewnicols/moodle 2022-03-16 22:18:40 +01:00
Eloy Lafuente (stronk7) 89e020a872 Merge branch 'MDL-74114-master' of https://github.com/aanabit/moodle 2022-03-16 22:13:57 +01:00
Eloy Lafuente (stronk7) cee098f8bf Merge branch 'MDL-74175' of https://github.com/paulholden/moodle 2022-03-16 22:03:25 +01:00
Eloy Lafuente (stronk7) 06e7273add Merge branch 'MDL-74154-fix' of https://github.com/sarjona/moodle 2022-03-16 16:45:42 +01:00
Eloy Lafuente (stronk7) c885ef8b92 Merge branch 'MDL-74181-fix' of https://github.com/sarjona/moodle 2022-03-16 16:36:49 +01:00
Sara Arjona 19af5abcfa MDL-74181 user: has_secondary_navigation_setter has been renamed
In MDL-72481, method has_secondary_navigation_setter has been renamed
to set_secondary_navigation.
2022-03-16 16:23:33 +01:00
Víctor Déniz 3f1e26b54e Merge branch 'MDL-73489-master' of https://github.com/HuongNV13/moodle 2022-03-16 15:12:30 +00:00
Sara Arjona 8893ba5236 MDL-74154 calendar: has_secondary_navigation_setter has been renamed
In MDL-72481, method has_secondary_navigation_setter has been renamed
to set_secondary_navigation.
2022-03-16 16:10:23 +01:00
Andrew Nicols c3404942e4 MDL-74116 behat: Fix browser instantiation for Selenium 4 2022-03-16 22:29:20 +08:00
Bas Brands f0e32f99b4 MDL-74229 navigation: add data-key to navtabs 2022-03-16 13:30:35 +01:00
Sara Arjona ff402712a3 Merge branch 'MDL-74154-master' of https://github.com/peterRd/moodle 2022-03-16 12:29:07 +01:00
David Matamoros 56b035321a MDL-74228 filters: Fixed typos in core_filters events file 2022-03-16 12:21:26 +01:00
Sara Arjona dd7d03a50e Merge branch 'MDL-74073-master-2' of https://github.com/junpataleta/moodle 2022-03-16 12:17:08 +01:00
Sara Arjona 9261157cc3 MDL-73233 course: Remove make_active() call
When accessing to User grades and then to the grades from a
specific course, this call was causing several behat errors
because the dashboard node was not found.
The code causing this issue can be safely removed because it
isn't used (the current node is calculated a few lines below).
2022-03-16 11:35:09 +01:00
Sara Arjona 07f7da93cc MDL-73233 tool_mobile: Return enabledashboard setting
External function tool_mobile::get_config now returns the
enabledashboard setting.
2022-03-16 11:35:09 +01:00
Sara Arjona 42c96d1708 MDL-73233 navigation: Remove dashboard when it is disabled
- Only add Dashboard to 'home' the root node if the $CFG->enabledashboard
setting is enabled.
- The "More..." link displayed in the "My courses" section from the
navigation block was pointing to the dashboard. However, now that we have
the "My courses" page, it makes more sense to change it and link to it.
- For the User preferences, I've changed breadcrumbs from "Dashboard" to
"Home" because they are more generic (and don't strictly belong to the
dashboard).
2022-03-16 11:35:09 +01:00
Sara Arjona 599cb8bbb1 MDL-73233 shibboleth: Change urltogo only when dashboard is enabled 2022-03-16 11:35:08 +01:00
Sara Arjona 04d8b5999a MDL-73233 moodlenet: Change cancel link to /
The cancel link when content is imported from MoodleNet has
been changed from /my to /, in order to get it working always,
regardless the $CFG->enabledashboard setting is enabled or not.
2022-03-16 11:35:08 +01:00
Sara Arjona 40894d7c31 MDL-73233 frontpage: Display link to My courses
Before MDL-70801, the "My courses" page didn't exist so the "More"
button displayed bellow the "Enrolled courses" in frontpage pointed
to Dashboard.
I think this is a leftover from the issue when the "My courses" page
was added and it makes more sense using the "My courses" page here
always.
2022-03-16 11:35:08 +01:00
Sara Arjona 31ed9a6c2f MDL-73233 my: Disable /my page depending on setting
When $CFG->enabledashboard will be disabled, the /my page
will redirect to a different page or display an error message.
2022-03-16 11:35:08 +01:00
Sara Arjona c612f121a0 MDL-73233 navigation: Hide Dashboard from primary nav
When the $CFG->enabledashboard is disabled, the "Dashboard"
menu option won't be displayed in the primary navigation.
2022-03-16 11:35:07 +01:00
Sara Arjona e3d2fa41d0 MDL-73233 user: Review Start page user preferences
The "Start page" user preferences page has been reviewed to
consider the new $CFG->enabledashboard setting.
The "Dashboard" won't be displayed in the list if it's disabled.
Besides, the default value is now calculated calling the new
get_default_home_page() method.
2022-03-16 11:22:22 +01:00
Sara Arjona 5349861e69 MDL-73233 admin: Add enabledashboard setting
The $CFG->enabledashboard setting has been added to Appearance >
Navigation, to let admins disable the "Dashboard" option from the
primary navigation.

This commit also changes the behaviour of get_home_page(), to take
into account this setting and adds a new method, get_default_home_page(),
to return the expected default home page (that wil be used when current
default page is not defined or valid).
2022-03-16 11:22:22 +01:00
Mihail Geshoski 5f227de8f3 MDL-74216 navigation: Add behat tests 2022-03-16 18:16:58 +08:00
Mihail Geshoski 7066c7618c MDL-74216 navigation: Do not show 'My courses' in primary nav to guests 2022-03-16 18:16:58 +08:00
Ferran Recio e9de12ec51 MDL-74153 portfolio_download: fix download form
The download form usas autosubmit to start downloading the content. This
breaks the JS modules loading because the page loading is cancelled when
the form is submitted. To prevent this from happen the download form now
has a hidden iframe to execute the download action without affecting the
rest of the page.
2022-03-16 11:03:12 +01:00
Paul Holden 9ccaf711d5 MDL-74225 dataformat: load plugin settings into admin tree. 2022-03-16 09:40:11 +00:00
Bas Brands e71f567f28 MDL-74172 theme_boost: printer friendly drawers layout 2022-03-16 10:24:29 +01:00
Mikel Martín 9e329ab152 MDL-74132 reportbuilder: Fix horizontal scrolling regression in editor
MDL-73902 caused a regression in reportbuilder editor horizontal scrolling because of the 'no-overflow' class removal
in the table container wrapper. This patch add styles to allow horizontal scroll in reportbuilder editor table.
2022-03-16 10:21:57 +01:00
Huong Nguyen 0c33dbb2ed MDL-73597 Questions: Form checker integration for D&D question types 2022-03-16 16:09:56 +07:00
Ilya Tregubov a5ef320720 Merge branch 'MDL-74071' of https://github.com/paulholden/moodle 2022-03-16 13:57:59 +06:00
Jun Pataleta b9ff0ff99b MDL-74073 courseformat: Toggle Collapse/Expand all via space key
* Add 'space' keydown event handler on the Collapse/Expand all element
on the course homepage.
* Set aria-expanded attribute of the Expand/Collapse all element
accordingly

Reference:
https://www.w3.org/TR/wai-aria-practices-1.1/#disclosure
2022-03-16 14:09:15 +08:00
Jun Pataleta ed55f45754 MDL-74073 theme_boost: Enhanced kb handling for BS Collapse components
* Make sure that Bootstrap Collapse components can also be toggled by
the Space key.

Reference:
https://www.w3.org/TR/wai-aria-practices-1.1/#disclosure
2022-03-16 14:09:15 +08:00
Jun Pataleta 7dfb64c7cb MDL-74073 core: Fix collapsesections accessibility
* Fix focus outline
* Set aria-expanded state accordingly
* Set aria-expanded in the template to false by default as the default
mode of the link is to expand all the sections.

Reference:
https://www.w3.org/TR/wai-aria-practices-1.1/#disclosure
2022-03-16 14:09:14 +08:00
Ilya Tregubov 6c21d64437 Merge branch 'MDL-74144' of https://github.com/paulholden/moodle 2022-03-16 10:33:22 +06:00
Ilya Tregubov 4e90732ebe Merge branch 'MDL-73344-master' of https://github.com/peterRd/moodle 2022-03-16 10:05:03 +06:00
Jun Pataleta 8c07f33d80 Merge branch 'MDL-72481-master' of https://github.com/rezaies/moodle 2022-03-16 11:45:40 +08:00
Peter Dias 8802254c8e MDL-74154 calendar: Disable secondary nav in calendar 2022-03-16 09:24:07 +08:00
Eloy Lafuente (stronk7) 337e740568 Merge branch 'MDL-74141-master' of https://github.com/sarjona/moodle 2022-03-15 23:38:14 +01:00
Eloy Lafuente (stronk7) 984669aeb2 Merge branch 'MDL-73193' of https://github.com/call-learning/moodle 2022-03-15 23:07:47 +01:00
Laurent David 1587ab4c27 MDL-73193 mod_bigbluebuttonbn: Fix random failures in behat tests
* On selenium chrome this fixes random failure of the "I can delete a recording"
test due to race condition between the popup being closed and the script waiting
for it to be displayed
2022-03-15 19:22:46 +01:00
Paul Holden ac24d90182 MDL-57383 tool_uploaduser: don't overwrite auth during update.
If updating users during upload along with the option to fill in
missing fields from file content, then we should exclude the auth
column because it will always be present for a user.
2022-03-15 17:06:20 +00:00
Amaia Anabitarte c28b5ad8c0 MDL-74199 core_user: Remove breadcrumbs on private files 2022-03-15 18:01:17 +01:00
Sara Arjona 302d147331 Merge branch 'MDL-74180-master' of https://github.com/mihailges/moodle 2022-03-15 17:42:38 +01:00
Víctor Déniz 4da9f3a03a Merge branch 'MDL-74098' of https://github.com/stronk7/moodle 2022-03-15 16:14:17 +00:00
Eloy Lafuente (stronk7) 103365191c Merge branch 'MDL-74131-master' of https://github.com/aanabit/moodle 2022-03-15 16:46:07 +01:00
Eloy Lafuente (stronk7) 3377bf10f7 Merge branch 'MDL-74181' of https://github.com/paulholden/moodle 2022-03-15 16:41:26 +01:00
Paul Holden b73a69b920 MDL-74175 cohort: correct type/callback of entity category column. 2022-03-15 15:28:54 +00:00
Víctor Déniz 7fbd4942a6 Merge branch 'MDL-73865-master' of https://github.com/rezaies/moodle 2022-03-15 15:13:48 +00:00
Eloy Lafuente (stronk7) 040d005dc5 Merge branch 'MDL-74156-master' of https://github.com/junpataleta/moodle 2022-03-15 15:38:01 +01:00
Eloy Lafuente (stronk7) 820cdbc9e1 Merge branch 'MDL-74100' of https://github.com/paulholden/moodle 2022-03-15 15:07:02 +01:00
Paul Holden 29c00fc100 MDL-74214 forms: re-calculate calendar panel zIndex each time.
The previous iteration only calculated it's zIndex value on
initial load. This meant that any nodes added subsequent to this
would not be taken into account (e.g. modal forms).
2022-03-15 13:41:42 +00:00
Sara Arjona 877a882253 Merge branch 'MDL-74173-master' of https://github.com/junpataleta/moodle 2022-03-15 14:27:55 +01:00
Sara Arjona 2d0675e986 Merge branch 'MDL-73979-master' of https://github.com/HuongNV13/moodle 2022-03-15 12:28:56 +01:00
Sara Arjona a26f985cae Merge branch 'MDL-74130' of https://github.com/timhunt/moodle 2022-03-15 12:19:10 +01:00
Sara Arjona 9344149aba on-demand release 4.0beta+ 2022-03-15 11:30:47 +01:00
Sara Arjona 814f91f935 Merge branch 'install_master' of https://git.in.moodle.com/amosbot/moodle-install 2022-03-15 11:30:42 +01:00
Simey Lameze 4fe474fad4 MDL-74088 assign: backup and restore support for time limit fields 2022-03-15 17:39:04 +08:00
Jun Pataleta b8248d3b92 MDL-74030 mod_lesson: Access lesson report via page administration step
* So it will consistently pass between Boost and Classic runs.
2022-03-15 17:08:15 +08:00
Huong Nguyen 2e3c9f10c4 MDL-73489 Quiz: Fix question was added in the wrong place 2022-03-15 12:22:18 +07:00
Huong Nguyen 76360c254e MDL-73489 Quiz: Fix incorrect XPath for custom Behat step 2022-03-15 12:19:30 +07:00
Paul Holden 61e5f6da55 MDL-74194 mod_bigbluebuttonbn: access checks for inplace editables. 2022-03-15 09:57:55 +06:00
Shamim Rezaie 1058a2fbd9 MDL-72481 theme_boost: Do not update tabindex of the "more" tab 2022-03-15 14:36:14 +11:00
Eric Merrill f3ea6862aa MDL-74183 completion: Protect against index conflict in cron 2022-03-14 22:56:20 -04:00
Shamim Rezaie ef84c1607d MDL-72481 core: prevent loosing the tick next to selected dropdown itme
prevent loosing the tick when user clicks on the toggle button
or when they Press Esc to close the dropdown.
2022-03-15 12:48:22 +11:00
Shamim Rezaie 50c8bf68a8 MDL-72481 core: Make more menu tabbable when the active tab moves inside 2022-03-15 12:48:22 +11:00
Sujith Haridasan 1168e5fff1 MDL-72481 core: Fix the keyboard navigation in RTL
Also updated e.keyCode to e.key because keyCode is deprecated.

Co-authored-by: Shamim Rezaie <shamim@moodle.com>
2022-03-15 12:48:22 +11:00
Shamim Rezaie 4489132505 MDL-72481 core: only move through visible tabs 2022-03-15 12:48:22 +11:00
Sujith Haridasan 044439fc84 MDL-72481 theme_boost: Find the tab if it is inside the more dropdown
keep the selector limited to tablists to prevent infinite redirects

Co-authored-by: Shamim Rezaie <shamim@moodle.com>
2022-03-15 12:48:22 +11:00
Sujith Haridasan af496f2c85 MDL-72481 admin: Update behat selector
The more menu can be a tablist or a manubar

Co-authored-by: Shamim Rezaie <shamim@moodle.com>
2022-03-15 12:48:22 +11:00
Jun Pataleta 6937d87ddd MDL-72481 admin: Render the site admin navigation menu as tablist
only render the secondary nav as tablist if it is for the site admin tabs

Co-authored-by: Shamim Rezaie <shamim@moodle.com>
2022-03-15 12:48:21 +11:00
Jun Pataleta 1f21daf8b3 MDL-72481 core: Fix more menu keyboard navigation
* Allow the more menu to be rendered as a tablist when needed.
* Let menu_navigation handle keyboard navigation only when
menu items are not rendered as dropdowns. Otherwise, leave
the keyboard navigation handling via the default handlers
(e.g. dropdown.js/aria.js/tab.js).
* When the more menu is rendered as a tablist, use aria-selected
for the selected tab. When it's rendered as a menu, use aria-current
for the selected menu item. (The menuitem role supports aria-current and
not aria-selected)
* Make sure that the active tab is tabbable by default.
* Submenu items should always have tabindex=-1
* Update behat to use css_element instead of xpath. Also, improved it
to consider that it is the active element that should be tabbable.

Co-authored-by: Shamim Rezaie <shamim@moodle.com>
2022-03-15 12:48:21 +11:00
Shamim Rezaie bc52715d75 MDL-73865 blocks_timeline: Increase debounce wait to 1 second 2022-03-15 12:46:22 +11:00
Shamim Rezaie 06b64c8284 MDL-73865 blocks_myoverview: Increase debounce wait to 1 second 2022-03-15 12:45:35 +11:00
Paul Holden 4711a73731 MDL-74181 user: remove secondary nav when viewing profile as guest. 2022-03-15 00:50:13 +00:00
Paul Holden ef1be5935f MDL-74193 mod_assign: specify itemid in external attachment filearea. 2022-03-14 22:54:54 +00:00
Tim Hunt 85c0b1d2fa MDL-74130 question behat: Update tests to use the new navigation steps 2022-03-14 22:13:04 +00:00
Tim Hunt d54bef46f1 MDL-74130 question behat: support I am on ... page or key qbank pages 2022-03-14 22:13:04 +00:00
Tim Hunt 9c65fe8b8f MDL-74130 question behat: rename behat_question -> behat_core_question
This is the expected naming for a Behat file for a core component.

Note, there are no acutal references to the deprecated class name
in core, but there might be in plugins, so we added a
backwards compatibility class with the old name. Thanks to
Andrew Lyons for hints about how to do that.
2022-03-14 22:13:04 +00:00
Víctor Déniz e95d99ebf1 Merge branch 'MDL-74030' of https://github.com/roland04/moodle 2022-03-14 21:39:40 +00:00
Sara Arjona 5195ac05f1 Merge branch 'MDL-74179-master' of https://github.com/cescobedo/moodle 2022-03-14 18:48:44 +01:00
Amaia Anabitarte 9bfefc4975 MDL-74114 block_myoverview: Fix set favourite changes 2022-03-14 17:19:49 +01:00
Sara Arjona 6000e3ae6a Merge branch 'MDL-74151-master' of https://github.com/mihailges/moodle 2022-03-14 16:55:24 +01:00
Eloy Lafuente (stronk7) abc57c853a MDL-74098 phpunit: Normalise dir separator to match expectations 2022-03-14 16:46:52 +01:00
Sara Arjona 066b9ac6ed Merge branch 'MDL-74162-master' of https://github.com/mihailges/moodle 2022-03-14 16:41:47 +01:00
Ilya Tregubov eb6e99aafe Merge branch 'MDL-74033-master-2' of https://github.com/rezaies/moodle 2022-03-14 16:56:45 +06:00
cescobedo 22cf291fd9 MDL-74179 mod_chat: Fix warnings header when accessing as a guest
Initialize  before showing the no guest message
when user is accesing as a guest.
2022-03-14 10:56:55 +01:00
Mihail Geshoski b34b626588 MDL-74180 database: Add behat test 2022-03-14 17:10:55 +08:00
Amaia Anabitarte 329586411d MDL-74131 tags: Fix flagged tags color contrast 2022-03-14 09:59:13 +01:00
Ilya Tregubov 5da8aeaa8b Merge branch 'MDL-73704-master' of https://github.com/bmbrands/moodle 2022-03-14 14:53:29 +06:00
Amaia Anabitarte 89849347e5 MDL-74080 block_myoverview: Fix create course link based on permissions 2022-03-14 09:21:22 +01:00
Bas Brands c3f0f59134 MDL-73952 core_course: update section badges using JS 2022-03-14 09:10:07 +01:00
Bas Brands 58fa5da723 MDL-73704 tool_componentlibrary: activity icons 2022-03-14 08:54:33 +01:00
Sara Arjona 42d2954eef Merge branch 'MDL-73629-master_color_errors' of https://github.com/brickfield/moodle 2022-03-14 08:36:34 +01:00
Jun Pataleta def7df4825 Merge branch 'master_MDL-72890_quiz-regrade' of https://github.com/catalyst/moodle-MDL-70329 2022-03-14 14:19:56 +08:00
Peter Dias 07e8f72f72 MDL-74127 lesson: Show remaining attempts on all types of jumps
- Show remaining attempts on all types of jumps
- Highlight the lesson tab when viewing the continue page.
2022-03-14 12:55:26 +08:00
Mihail Geshoski 3bb3cdf369 MDL-74180 database: Perform checks before showing the 'add entry' option 2022-03-14 10:59:02 +08:00
AMOS bot 4256181399 Automatically generated installer lang files 2022-03-12 00:07:37 +00:00
Mike Churchward daffa8b1fc MDL-73629 tool_brickfield: Ensuring colour check causes no errors. 2022-03-11 15:25:21 -05:00
Jun Pataleta 6e528ca463 MDL-74173 reportbuilder: Convert action links to action menu links 2022-03-11 18:35:16 +08:00
Ilya Tregubov 967d9b2546 on-demand release 4.0beta+ 2022-03-11 16:20:26 +06:00
Mathew May 9e78d8de6d MDL-74161 login: Constrain the language selector to force a scroll 2022-03-11 16:14:39 +08:00
Jun Pataleta a06268b67a Merge branch 'MDL-73760-master-fix' of https://github.com/sarjona/moodle 2022-03-11 15:17:50 +08:00
Sara Arjona debbce8745 MDL-73760 quiz: Fix behat failures with classic
Author: Luca Bosch
2022-03-11 07:40:02 +01:00
Jun Pataleta 2431f7bff8 Merge branch 'MDL-71305-master' of git://github.com/rezaies/moodle 2022-03-11 11:51:00 +08:00
Ilya Tregubov cb0278a91f Merge branch 'MDL-74032-master' of https://github.com/sammarshallou/moodle 2022-03-11 09:23:17 +06:00
Jun Pataleta a1b520e38c Merge branch 'MDL-73895' of https://github.com/paulholden/moodle 2022-03-11 11:17:28 +08:00
Huong Nguyen f136ae7149 MDL-73979 timeline: Views should display consistent information
The course view is updated to display the events that match
the filter condition, no matter the course start date is in the future
or the course end date is in the past
2022-03-11 09:30:20 +07:00
Jun Pataleta b364b8437a Merge branch 'MDL-74087-master-1' of git://github.com/mihailges/moodle 2022-03-11 09:28:46 +08:00
Víctor Déniz f4d27bd04c MDL-54724 qtype_multianswer: fix version.php 2022-03-11 00:05:18 +00:00
Víctor Déniz 9a0a05ef39 Merge branch 'MDL-54724-master' of https://github.com/cameron1729/moodle 2022-03-10 23:21:24 +00:00
Sara Arjona d60e802006 MDL-74159 output: Add icon near docs link
An icon has been added near the 'Help and documentation' link in the
site footer When the site admin setting 'Open in new window' (doctonewwindow)
is enabled, for consistency with other similar links like 'Give feedback
about this software'.

Apart from that, now the link will be opened using the standard target
'_blank' instead of using the new window Javascript, to let users decide
whether the new page should be opened in a new tab or a new window.
2022-03-10 17:07:32 +01:00
Mihail Geshoski f6104220d6 MDL-74162 glossary: Fix the returned data type by create_add_button() 2022-03-11 00:03:52 +08:00
Mihail Geshoski 6e85ca08df MDL-74151 core_user: Add behat tests for the private files area 2022-03-10 23:39:20 +08:00
Mihail Geshoski d9ea0ba758 MDL-74151 core_user: Add heading in the private files page 2022-03-10 23:38:00 +08:00
Sara Arjona 730bc8735e MDL-74141 tool_task: Display error when Path to CLI not defined
When "Path to PHP CLI" is not defined, an exception with the message
in cannotfindthepathtothecli should be displayed, and the page should
be redirected to System paths settings page.

Apart from that, this patch also replaced core_task to tool_task,
because this message wasn't traslated properly.
2022-03-10 16:19:07 +01:00
Mikel Martín d2acd08934 MDL-74030 navigation: Add reports link
Add report builder 'Reports' link to the user menu

AMOS BEGIN
 CPY [reports,moodle],[reports,core_reportbuilder]
AMOS END
2022-03-10 15:46:44 +01:00
Mihail Geshoski 748ce930b4 MDL-74087 theme_boost: Add behat tests 2022-03-10 22:30:00 +08:00
Sara Arjona a42f38fe28 Merge branch 'MDL-73760' of https://github.com/mkassaei/moodle 2022-03-10 13:17:25 +01:00
Sara Arjona a27c19b73a Merge branch 'MDL-74142-master' of https://github.com/aanabit/moodle 2022-03-10 11:58:21 +01:00
Jun Pataleta 972b5a2d3f Merge branch 'MDL-73908-master' of https://github.com/bmbrands/moodle 2022-03-10 17:15:34 +08:00
Ilya Tregubov cb8778c2f1 Merge branch 'MDL-73073-master_assign_timing_web_services' of https://github.com/andrewmadden/moodle 2022-03-10 15:01:06 +06:00
Jun Pataleta 4ea491f305 MDL-74156 block: Remove redundant configure block headings 2022-03-10 16:46:03 +08:00
Sara Arjona ae935e8349 Merge branch 'MDL-74123_h5p_duplicate_file' of https://github.com/davosmith/moodle 2022-03-10 08:40:55 +01:00
Jake Dallimore a745a7dfae Merge branch 'MDL-73899-master' of https://github.com/andrewnicols/moodle 2022-03-10 15:34:21 +08:00
Andrew Madden 4ae22703c6 MDL-73073 mod_assign: Add new time limit fields to external functions
* Add activity, activityformat, timelimit and submissionattachments to mod_assign_get_assignments
* Add timestarted to mod_assign_get_submissions and mod_assign_get_submission_status
* Add assignmentdata to mod_assign_get_submission_status
* Move mod_assign external helper methods to an external_api child class to be used with modern external classes
* Add start_submission external function
* Create mod_assign child class of externallib_advanced_testcase for shared helper functions
* Add extra logic to get_assignments on whether to provide intro
attachments.
2022-03-10 18:31:37 +11:00
Mihail Geshoski 3436e1ad22 MDL-73863 core_completion: Update behat tests 2022-03-10 12:28:39 +08:00
Mihail Geshoski 135e1a2dce MDL-73863 course: Deprecate unused methods 2022-03-10 12:28:39 +08:00
Mihail Geshoski 36fe5695fe MDL-73863 course: Add tertiary navigation in completion pages 2022-03-10 12:28:39 +08:00
Jun Pataleta d93739be3f Merge branch 'MDL-73520_replace-deprecated-php_errormsg-with-error_get_last' of https://github.com/ziegenberg/moodle 2022-03-10 12:28:28 +08:00
Ilya Tregubov 3e056f0999 Merge branch 'MDL-74136-master' of https://github.com/junpataleta/moodle 2022-03-10 09:25:11 +06:00
Ilya Tregubov 441ed4c180 Merge branch 'MDL-67428-filter-context' of https://github.com/Peterburnett/moodle 2022-03-10 09:04:05 +06:00
Shamim Rezaie babf9e5770 Merge branch 'master_MDL-67802_2' of https://github.com/mattporritt/moodle 2022-03-10 08:57:16 +11:00
Eloy Lafuente (stronk7) 558f852ff8 Merge branch 'MDL-74007' of https://github.com/timhunt/moodle 2022-03-09 20:59:57 +01:00
Sara Arjona 87da5630ae Merge branch 'MDL-74104-master' of https://github.com/ferranrecio/moodle 2022-03-09 18:23:12 +01:00
Eloy Lafuente (stronk7) 2758101a75 Merge branch 'MDL-73737' of https://github.com/paulholden/moodle 2022-03-09 16:43:20 +01:00
Sara Arjona c67453cff2 Merge branch 'MDL-73586' of https://github.com/stronk7/moodle 2022-03-09 16:26:13 +01:00
Sara Arjona d1eb8aef66 Merge branch 'MDL-71807' of https://github.com/stronk7/moodle 2022-03-09 16:22:02 +01:00
Jun Pataleta 99f0eacda6 Merge branch 'MDL-74085-master' of https://github.com/sharidas/moodle 2022-03-09 22:45:59 +08:00
Sara Arjona 7fe83dfe2c Merge branch 'MDL-73923_tool_task_cronrunning-has-very-tight-limits-on-checking-cron-interval-and-expected-frequency' of https://github.com/ziegenberg/moodle 2022-03-09 13:52:51 +01:00
Sujith Haridasan d67e15a2c4 MDL-74085 data: Add entry button should follow max allowed entries
When max entries is set in the database activity, the students
should not see the 'Add entry' button if they have reached the
maximum allowed entries.
2022-03-09 18:14:24 +05:30
Sara Arjona 9b5da4de17 Merge branch 'MDL-73993-master' of https://github.com/golenkovm/moodle 2022-03-09 13:24:29 +01:00
sam marshall 3776b5542f MDL-74032 core_cache: Coding error before upgrade with versioned cache
In certain cases where it doesn't already redirect to run the upgrade,
users could see an exception 'Unexpectedly found non-versioned cache
entry'. This change ensures the upgrade happens instead.
2022-03-09 12:11:14 +00:00
Sara Arjona 869b0fb1bb Merge branch 'MDL-73779_dynreg_sup_msgs' of https://github.com/cengage/moodle 2022-03-09 13:11:12 +01:00
Ferran Recio 37893f9878 MDL-74104 mod_folder: fix recent activity with forcedownload links
The folder module has a setting to force the download links. However,
the recent activity block ignored this setting until now.
2022-03-09 13:05:55 +01:00
Amaia Anabitarte c36ab09b66 MDL-74075 core_badges: Check accepted criterias 2022-03-09 12:31:29 +01:00
Paul Holden 134773553d MDL-74144 user: add cancel button to user private files form. 2022-03-09 11:31:06 +00:00
Ilya Tregubov bf842246c6 Merge branch 'MDL-73549-master-2' of https://github.com/HuongNV13/moodle 2022-03-09 16:41:02 +06:00
Amaia Anabitarte 6c1adeec74 MDL-74142 mod_assign: Show time limit information to teachers 2022-03-09 11:08:14 +01:00
Jun Pataleta 8ac5e00dd4 Merge branch 'MDL-74097' of https://github.com/stronk7/moodle 2022-03-09 17:59:04 +08:00
Jake Dallimore 3a6aa8ceeb MDL-74138 auth_lti: fix unique key definition in upgrade 2022-03-09 17:36:22 +08:00
Ilya Tregubov aa53d83114 Merge branch 'MDL-72504-master' of https://github.com/aanabit/moodle 2022-03-09 10:05:41 +06:00
Ilya Tregubov cb48ea4f7e Merge branch 'MDL-74118-master' of https://github.com/aanabit/moodle 2022-03-09 09:50:21 +06:00
Jun Pataleta d96e5a9620 MDL-74136 theme_boost: Display blocks drawer icon properly on RTL 2022-03-09 10:07:11 +08:00
Matt Porritt 07d40a91ee MDL-67802 Authentication: Allow disabling email verification for OAuth
Allow email account verification to be disabled for any Oauth2 provider.
Also add clear indications to administrators of the danger of doing do,
this is done by an additional form checkbox.
This patch also reverts MDL-66598
2022-03-09 01:12:38 +00:00
Paul Holden 598698bc10 MDL-74100 course: relax initial parameter types of external methods.
These methods can be called via UI, and would throw confusing exceptions
if a user entered "unsafe" characters in a search input (e.g. "<").

Defer cleaning of supplied text to inside the methods.
2022-03-08 21:13:02 +00:00
Mihail Geshoski bc0cb6be01 MDL-74087 theme_boost: Remove breadcrumb nodes that exist in primary nav
Generally, we want to avoid displaying any breadcrumb nodes which are
already present in the primary navigation menu. Currently, this is done
by manually specifying which breadcrumb node (by its identification key)
should be removed. This change provides more reliable, automatic removal
of these breadcrum nodes by utilizing the exising method
remove_items_that_exist_in_navigation().
2022-03-09 00:02:26 +08:00
Sara Arjona 68a5612ec2 Merge branch 'MDL-73846-master' of https://github.com/golenkovm/moodle 2022-03-08 16:34:40 +01:00
Eloy Lafuente (stronk7) 2e48f924e7 MDL-73586 phpunit: Simply, remove the setting
It's not available since PHP 7.0, so no use at all.
2022-03-08 14:56:59 +01:00
Eloy Lafuente (stronk7) cb95e0b707 MDL-73586 mod_wiki: Removed php init param for php80 and up
For PHP 8 and up, the 'mbstring.func_overload' doesn't exist
anymore, so skip any check/condition based on it.

The patch has been done that way, so it's easier to remove
the whole block of code once PHP 8.0 becomes our min supported
PHP version.

The change is self-coveres (changes the external and its own tests).
2022-03-08 14:56:49 +01:00
Davo Smith 4202104a2e MDL-74123 h5p: delete any existing files when downloading new files 2022-03-08 13:52:26 +00:00
Amaia Anabitarte 7d5190433a MDL-72504 block_myoverview: Show starred course changes 2022-03-08 13:40:43 +01:00
Michael Hawkins c2794752ea MDL-74074 badges: Ensure profile criteria exists before completion check 2022-03-08 11:59:25 +00:00
Eloy Lafuente (stronk7) 254108755a MDL-73586 mustache.php: Removed php init param for php80 and up
The 'mbstring.func_overload' php init setting was removed for
php80 (it was deprecated since php72). So it won't evaluate to
true ever, so the whole block can be put under php version condition.

Note that this is already fixed upsteam, for commit:
https://github.com/bobthecow/mustache.php/commit/e7165a33b282ab4d20b3863825caadb46313d62b

And it has been released with version 2.14.1 of the library, so, once
we upgrade to it, the fix will be incorporated.
2022-03-08 12:35:01 +01:00
Bas Brands 322f13207a MDL-73908 block_calendar_upcoming: new mod icons 2022-03-08 11:07:38 +01:00
Bas Brands 1c3e12e71b MDL-73908 block_recentlyaccassitems: new mod icons 2022-03-08 11:02:46 +01:00
Eloy Lafuente (stronk7) a5c91474ee MDL-71807 cleanup: Replace deprecated codingStandardsIgnore annotations
The PHP_CodeSniffer @codingStandardsIgnore annotations are deprecated
and, since version 3.x, the new // phpcs:ignore comments should be used
instead.

This commits just reviews all the uses in core, replacing them for
the better new candidate, or removing when no longer needed.
2022-03-08 10:48:53 +01:00
Eloy Lafuente (stronk7) 1af724e105 MDL-74097 core_text: Add some tests to cover all the logic 2022-03-08 10:37:47 +01:00
Eloy Lafuente (stronk7) 3255c42bf4 MDL-74097 core_text: Add coverage info to better see what's missing 2022-03-08 10:37:47 +01:00
Eloy Lafuente (stronk7) 2def80568b MDL-74097 core_text: Ensure that transliteration always happens
Before the patch, transliteration was only happening when the
encoding of the string was utf-8. For other encodings only a
simpler conversion (iconv) to ascii was done. For some reason
iconv() own transliteration abilities are not consistent
between systems (depends of libraries installed, locales and
other bits).

So now we always convert the string to utf-8, in order to
transliterate it. And finally, also perform an iconv to
cover some characters that transliterate doesn't handle ok.

Also, remove a block of code that does nothing (previously
it was executing some code, but now it just sets and restores
the error level for nothing).
2022-03-08 10:37:47 +01:00
Paul Holden addd4f894d MDL-72972 tool_uploaduser: observe capability to delete users. 2022-03-08 10:04:20 +01:00
cescobedo 4025695552 MDL-71722 h5plib_v124: Add required changes after lib upgrade 2022-03-08 10:04:20 +01:00
cescobedo 1b5af6aa4f MDL-71722 h5plib_v124: Upgrade ckeditor to 4.17.1 2022-03-08 10:04:20 +01:00
Ilya Tregubov e118f7576b MDL-71703 lib: update phpmailer to 6.5.3 2022-03-08 10:04:20 +01:00
Eloy Lafuente (stronk7) 01eb6d2e9b on-demand release 4.0beta+ 2022-03-08 10:02:22 +01:00
Amaia Anabitarte 34b75603af MDL-74118 themes: Last section style when one section per page 2022-03-08 09:40:31 +01:00
Huong Nguyen 481cfdc3f0 MDL-73549 Course: My course page menu improvement
- Introduce core_course_category::get_nearest_editable_subcategory()
 - This function will return the first creatable/manageable category
for current user
 - With this new function, we can fix the issue that the users with
course management or creation permision at category level cannot see
the manage menu on My courses page
2022-03-08 14:25:19 +07:00
Peter Dias 5bb98d99ec MDL-73344 reports: Include the user/report node based on context
Properly indicate the report node based on context.
2022-03-08 13:59:00 +08:00
Jun Pataleta 37519b3687 Merge branch 'MDL-72646-font-mimetype' of https://github.com/doctorlard/moodle 2022-03-08 12:18:41 +08:00
Ilya Tregubov bdd0356fde Merge branch 'MDL-66940-master' of https://github.com/sarjona/moodle 2022-03-08 05:01:47 +02:00
Shamim Rezaie d237361d4a MDL-71305 core_question: Deprecate notflagged language string 2022-03-08 13:45:18 +11:00
Shamim Rezaie bc8bf406c8 MDL-71305 core_question: Use toggle button for flag question element 2022-03-08 13:45:18 +11:00
Jun Pataleta ecfc31191c Merge branch 'MDL-74106' of https://github.com/paulholden/moodle 2022-03-08 09:46:29 +08:00
Mikhail Golenkov ae80480ebe MDL-73846 assignfeedback_editpdf: Add limit for convert_submissions task 2022-03-08 12:36:13 +11:00
Shamim Rezaie c6a74d4752 MDL-74033 theme_boost: Ability to remove primary nav items in boost 2022-03-08 11:39:38 +11:00
Víctor Déniz 2ac75e55a9 Merge branch 'MDL-74090-master' of https://github.com/junpataleta/moodle 2022-03-08 00:00:19 +00:00
Paul Holden 2916f89d12 MDL-74106 reportbuilder: handle non-recurring schedules properly.
When a schedule is created with "No recurrence", it should only be
sent when both conditions are true: it's start time is after the
current time; and the time it was last sent is before it's start
time (either 0/never sent; or a time it was manually sent).
2022-03-07 15:47:33 +00:00
Shamim Rezaie e016d20e5f MDL-71305 core_question: Remove duplicate strings 2022-03-07 11:28:10 +11:00
Mahmoud Kassaei 1bf0fa4719 MDL-73760 Quiz: Manual grading report does not handle separate groups
when the user is not in any group
2022-03-05 13:24:33 +00:00
Daniel Ziegenberg 13ad25310d MDL-73520 adodb: Remove usage of $php_errormsg from DB2 driver
This applies #791 from upstream libraries: https://github.com/ADOdb/ADOdb/issues/791

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2022-03-05 14:19:50 +01:00
Daniel Ziegenberg f60f6dfade MDL-73520 general: replace deprecated php_errormsg with error_get_last()
For a better PHP8 compatibility this commit replaces the deprecated $php_errormsg
with error_get_last().

The PHP 8.0 migration guide (https://www.php.net/manual/de/migration80.incompatible.php) says:
    The track_errors ini directive has been removed.
    This means that php_errormsg is no longer available.
    The error_get_last() function may be used instead.
Also the documentation on $php_errormsg (https://www.php.net/manual/en/reserved.variables.phperrormsg.php) says:
    This feature has been DEPRECATED as of PHP 7.2.0.
    Relying on this feature is highly discouraged.
    Use error_get_last() instead.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2022-03-05 14:19:48 +01:00
Jun Pataleta 3314000eaf MDL-74090 core: Proper RTL/LTR display of collapsed icons 2022-03-05 00:45:32 +08:00
Eloy Lafuente (stronk7) 87791a13a4 Merge branch 'MDL-74020' of https://github.com/paulholden/moodle 2022-03-04 16:52:21 +01:00
Paul Holden ad7583cd33 MDL-74076 reportbuilder: deterministic ordering of schedule users.
Now that we have consistent ordering we can also revert 898f3d0a.
2022-03-04 15:25:22 +00:00
Shamim Rezaie a9d8207da9 Merge branch 'MDL-73824' of https://github.com/stronk7/moodle 2022-03-05 00:39:29 +11:00
Eloy Lafuente (stronk7) 93b59411f1 Merge branch 'MDL-73954' of https://github.com/timhunt/moodle 2022-03-04 14:20:27 +01:00
Marc-Alexandre Ghaly 3e09319e7a MDL-72890 core_question : Question regrade for question versions
This commit implements a question regrade for the selected
version in the quiz for a slot.

Co-Authored-By: Safat Shahin <safatshahin@catalyst-au.net>
Co-Authored-By: Tim Hunt <tim.hunt@open.ac.uk>
2022-03-04 23:06:50 +11:00
Tim Hunt 4f99e92a81 MDL-73954 quiz: fix decimal places for the percentage on review page 2022-03-04 11:58:16 +00:00
Eloy Lafuente (stronk7) c111717ffb Merge branch 'MDL-74042-master' of https://github.com/jleyva/moodle 2022-03-04 12:19:22 +01:00
Sara Arjona bc7dec8c2b MDL-66940 badges: Create page to display badges info
The OBv2.0 specification includes a field "Criteria" for
BadgeClass. Until now, this field was filled using the
URL of the badge assertion, but that is causing some issues
in Badgr because it linked to the badge assertion of the
first user sending this badge to the Badgr backpack (so then,
the following users linked to the first user assertion page
too).

This patch adds a new page, badgeclass.php which will be
used from now to display any badge information which is
not related to any assertion (like happens with the criteria
in BadgeClass).
2022-03-04 12:18:59 +01:00
Tim Hunt 61f11f848d MDL-74007 quiz: questions should start as 'Always latest' version
Thanks to Safat Shahin <safatshahin@catalyst-au.net> for help with
the Behat scenarios.
2022-03-04 10:59:13 +00:00
Jun Pataleta 1aa65fbdfe Merge branch 'MDL-73902-master' of https://github.com/bmbrands/moodle 2022-03-04 18:28:18 +08:00
Eloy Lafuente (stronk7) 43b4e6b339 MDL-73824 test: Cover all the changed code with special decsep tests
Various tests have been added to cover the points fixed in the previous
commit, using a localised decimal separator (#). Using the same
numbering, here there are the details:

A. grade/report/singleview/tests/behat/singleview.feature
   grade/tests/behat/grade_category_validation.feature

B. grade/tests/behat/grade_override_letter.feature

C. (done within various scenarios)

D. grade/report/singleview/tests/behat/singleview.feature

E. admin/tool/behat/tests/behat_form_text_test.php

F. grade/tests/behat/grade_to_pass.feature
   mod/lesson/tests/behat/lesson_informations_at_end.feature

G. quiz/tests/behat/preview.feature

H. mod/quiz/tests/behat/info_page.feature

I. question/type/ddimageortext/tests/behat/edit.feature
2022-03-04 10:22:49 +01:00
Eloy Lafuente (stronk7) 3a016e2784 MDL-73824 gradebook: Add support for localised floats where missing
It has been detected, thanks to php80 specially, that there are
various places in core where support for localised floats is
missing. Before php80, some locale-dependent conversions were
performed by PHP, allowing things to work. But with php80 all
those comparisons are now locale-independent. See:

https://wiki.php.net/rfc/locale_independent_float_to_string

That implies that we now need to, always, unformat floats to
be internally the correct (decimal point as separator) in
order to compare it.

While this was visited in the php80 epic (MDL-70745), nothing
was found, all automated tests were passing ok. Problem is that
we run behat tests with en-AU laguage that has the decimal point
separator.

So, in this issue we are fixing all the problems detected by
running those Behat tests using localised (comma) decimal
separator.

Note that there may be other places still causing problems, but
it's really hard to find them programmatically, so we'll have to
wait for real use reports / issues and go fixing them while they
happen.

Back to this commit, this is the list of changes performed (note that
in the next commit, we'll be adding scenarios explicitly using
a localised decimal separator to ensure that they work ok).

A. Changes to various grade forms to ensure that, on their validation
  floats are unformatted properly. Also, changed the corresponding
  form element from current text/PARAM_RAW to proper float ones that
  take care of the conversion in a number of places (but when disabled,
  that's the reason we still have to unformat in validation.
  This includes the following forms:
    - edit_category_form
    - edit_item_form
  (this is the original problem reported that cause all the research
  to be performed against full behat runs)

B. Changes to edit_letter_form, so it uses a proper PARAM_LOCALISEDFLOAT
  (note this is the type of change that surely should be used for all
  the rest of /grade/edit/tree form, including those in the previous
  point).

C. Changes to the grade_item behat generator, so it's able to work with
  localised floats, un-formatting them when needed.
  At lib/behat/classes/behat_core_generator.php

D. Fix problem passing localised floats to scales, not displaying
  properly. At grade/report/singleview/classes/local/ui/finalgrade.php

E. Change the behat text matcher in order to allow comparison of
  localised floats when they are the current ones. Before this change
  the matches was using soft/lazy comparison, so '50' and '50.0000'
  match. Now, when the comma (for example) is used (and only then),
  '50' and '50,000' will also match. This comparison is in use in a
  bunch of tests and makes sense to make it localisation-aware.
  At grade/report/singleview/classes/local/ui/finalgrade.php

F. Fix a couple of number_format() uses in lesson, because they are
  not localised-aware. Switched to format_float(). At mod/lesson/locallib.php

G. Change the quiz_contains_the_following_questions() step to accept
  localised maxmark expectations. At mod/quiz/tests/behat/behat_mod_quiz.php

H. Change the quiz generator so it accepts localised gradepass.
  At mod/quiz/tests/generator/lib.php

I. Change the edit question form to show proper localised penalties,
  previously it was always showing point-decimal ones. Of course,
  leaving the values of the select element unmodified (internal floats).
  Related, also change a couple of tests to, instead of try to match the
  value (always internal floats), match the description (now localised),
  so we can test them with different separators. At:
    - question/type/ddimageortext/tests/behat/backup_and_restore.feature
    - question/type/ddmarker/tests/behat/backup_and_restore.feature
    - question/type/edit_question_form.php
2022-03-04 10:22:49 +01:00
Jake Dallimore 7192744443 Merge branch 'MDL-74048-master' of https://github.com/bmbrands/moodle 2022-03-04 16:18:31 +08:00
Jake Dallimore 8ccf8390c3 Merge branch 'MDL-73796-master' of https://github.com/bmbrands/moodle 2022-03-04 14:56:09 +08:00
Jun Pataleta c9d466cb80 Merge branch 'MDL-73799' of https://github.com/stronk7/moodle 2022-03-04 14:47:39 +08:00
Jun Pataleta e9ee905619 Merge branch 'MDL-73785' of https://github.com/stronk7/moodle 2022-03-04 14:36:47 +08:00
Jun Pataleta 4aa63901c3 Merge branch 'MDL-73906-master' of https://github.com/bmbrands/moodle 2022-03-04 13:06:43 +08:00
Peter Spicer edde68e078 MDL-67428 navigation: Apply navigation text filters at system context
On some larger sites, processing the navigation with format_string will
habitually load all the contexts for navigation which can take 400+ DB
queries. Explicitly tying all those format_string calls to the system
context reduces this overhead to a single DB query that probably has
already been run on the page previously.

Co-authored-by: Peter Burnett <peterburnett@catalyst-au.net>
2022-03-04 14:36:25 +10:00
Jake Dallimore 9be31a19dd Merge branch 'MDL-73457-master-2' of https://github.com/HuongNV13/moodle 2022-03-04 11:59:26 +08:00
Jake Dallimore 84160619c6 Merge branch 'MDL-74002' of https://github.com/Chocolate-lightning/moodle 2022-03-04 10:24:48 +08:00
Shamim Rezaie 29c14e979b Merge branch 'MDL-74045-master' of https://github.com/bmbrands/moodle 2022-03-04 10:13:05 +11:00
Eloy Lafuente (stronk7) 3965067836 Merge branch 'MDL-64770' of https://github.com/paulholden/moodle 2022-03-03 23:20:26 +01:00
Sara Arjona 4495182ac5 Merge branch 'MDL-72915-master' of https://github.com/HuongNV13/moodle 2022-03-03 17:30:54 +01:00
Sara Arjona a9f15ed952 MDL-73891 admin: Display a notification in manage blocks
An info notification has been added to the "Manage blocks"
page to warn admins about the "Unneeded blocks" theme setting.
2022-03-03 16:35:54 +01:00
Sara Arjona 4f95c39ef0 Merge branch 'MDL-73841-master' of https://github.com/bmbrands/moodle 2022-03-03 16:31:15 +01:00
Paul Holden 4471724bab MDL-73737 report_loglive: ensure action link popups work post-AJAX. 2022-03-03 14:02:42 +00:00
Daniel Ziegenberg a4d64bd71b MDL-73923 tool_task: make a more relaxed check on cron run interval
Prior to this change, the tool_task_cronrunning check had very tight
limits for checking the last cron interval and comparing it to the
expected frequency. When a cron job should take 1:00 min and the last
run was 1:02 min it complained that there was 1:02 between the last two
runs of the cron maintenance script and it should run every 1:00.

This change makes the check a bit more relaxed and adds an additional
minute on top of the expectedfrequency to give the cron job some time.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2022-03-03 14:27:32 +01:00
Eloy Lafuente (stronk7) b3c4bd6250 MDL-73799 phpunit: Move some test names, as agreed in the issue
- behaviourtype_test => behaviour_type_test (10)
- questiontype_test => question_type_test (16)
- upgradelibnewqe_test => upgrade_old_attempt_data_test (13)
2022-03-03 12:22:36 +01:00
Eloy Lafuente (stronk7) 68b4a13cec MDL-73799 phpunit: various question & quiz testcase names
To all the walkthrough, questiontype, question, upgradelibnewqe,
behaviourtype_test and edit_form testcase classes::

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to:
- When belonging to other component and being valid api:
  - form related tests have been moved to tests/form subdir.
2022-03-03 12:22:36 +01:00
Eloy Lafuente (stronk7) 4003e31983 MDL-73785 phpunit: Move more tests to use correct names and namespaces
Applied the following changes to various testcase classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to:

- When belonging to other components and being valid api:
  - analytics related tests have been moved to tests/analytics subdir.
  - backup & restore related tests have been moved to tests/backup subdir.
  - events related tests have been moved to tests/event subdir.
  - privacy related tests have been moved to tests/privacy.
  - task related tests have been moved to tests/task subdir.
- Some simple renames, not including the component part anymore (not
  needed now that they are namespaced):
  - some xxxlib_test.php have been renamed lib_test.php
    (when they where testing the corresponding lib.php).
  - cache stores tests have been all renamed store_test, originally
    each one had its own name (file_test, apcu_test, redis_test...)
  - assign feedback tests have been all renamed feedback_test, originally
    each one had its own name (file_test, editpdf_test...)
2022-03-03 12:19:30 +01:00
Eloy Lafuente (stronk7) e2821bf1ce MDL-73824 gradebook: Stricter float check to some gradelib functions
It has been detected that, right now, some localised floats are
being passed to those functions (say comma separator, say thousands)
and that's leading to all sort of problems later when comparing,
processing or storing those "wrong-floats" (user entered).

This just makes all those functions to be stricter, so any attempt
of passing to them a wrong float will fail with a clear TypeError.

Any existing case must be converted to a corrrect (X.Y) format, using
unformat_float() or PARAM_LOCALISEDFLOAT before any processing.

Localised floats cannot be used.

Also, fix all the places where those functions are called from
files having strict_types enabled because, with that, now float-like
strings are not accepted any more. Luckily, there is only case,
within the grade/classes/component_gradeitem.php file, and it has
been fixed by casting the float-like string coming from DB to float.
2022-03-03 12:19:02 +01:00
Paul Holden 7f3d270a37 MDL-74071 output: code docs for activity header API to aid IDE hints. 2022-03-03 09:59:57 +00:00
Paul Holden 506229dd95 MDL-73999 quizaccess_seb: use raw getter in pre-validate method.
Changes in 78735a72 made the persistent `get` method return property
values consistently, according to their type and nullability.

The rule `templateid` property is not nullable, but still has code
that treats it as such. Fix that by retrieving the raw value.
2022-03-03 09:34:21 +00:00
Bas Brands 729ae8f096 MDL-73902 theme_boost: prevent dropdowns being cut off 2022-03-03 09:44:33 +01:00
Tomo Tsuyuki 25a6a42477 MDL-74072 cachestore_redis: Add error check for envoy proxy 2022-03-03 17:16:52 +11:00
Mikhail Golenkov 8c914c8756 MDL-73993 phpdoc: get_module_types_names returns lang_string objects 2022-03-03 10:39:09 +11:00
Bas Brands aa134f981b MDL-74048 theme_boost: category manament nav margins 2022-03-02 16:50:24 +01:00
Mathew May 030ade06ff MDL-74002 admin: Change conditions for rendering nav tabs 2022-03-02 19:29:47 +08:00
Bas Brands a31cade872 MDL-74045 theme_boost: set the base layout to drawers 2022-03-02 11:07:45 +01:00
Cameron Ball 53d3843955 MDL-54724 qtype_multianswer: Better handle corrupted questions
When questions are deleted, we now check if the parent is in use before deletion.

Prior to this, it would be possible for multianswer questions to reference
questions that have been deleted. This results in fatal errors when the quiz
is viewed.

This patch uses a dummy 'subquestion_replacement' to handle this case and
display some information to the end user about what has happened so that
they may take action to repair the corrupted question.

As a result of the bug described above, the sequence column of
mdl_question_multianswer can contiain references to questions that no
longer exist, and these IDs can make their way in to backups.

When this happens, the backups cannot be restored. To avoid this,
this patch skips trying to restore those questions that reference
question IDs that no longer exist (as there is no way to recover them).
2022-03-02 17:12:19 +08:00
Bas Brands 62fadb8ddb MDL-73906 core_my: default dashboard page header 2022-03-01 14:12:22 +01:00
Bas Brands 757b8c636e MDL-73796 theme_boost: mobile navcrumb design 2022-03-01 13:55:32 +01:00
Juan Leyva c112780113 MDL-74042 vimeo: Support security hash for restricted videos 2022-03-01 13:32:34 +01:00
Bas Brands fa6e4b2c9e MDL-73593 theme_boost: update boost top margins 2022-03-01 13:09:08 +01:00
Paul Holden 5f810c4724 MDL-74020 course: update how required libraries are loaded in test.
Test data providers are executed before `setUpBeforeClass`, so any
library constants used by the providers must already be present.

Reverts part of the change in 691c5b83.
2022-03-01 09:33:35 +00:00
Bas Brands 137b2dd638 MDL-73841 block_myoverview: use text for selectors 2022-03-01 09:18:37 +01:00
Paul Holden 4f8aeb1cdf MDL-64770 tool_uploaduser: validate unique field values in upload.
If a custom user profile field is set to be unique, then we should
ensure that is respected in the entirety of the uploaded data.
2022-02-28 14:25:52 +00:00
Huong Nguyen 0d4069918e MDL-73457 Course: Fix drag & drop image prevents moving resources
Including in this commit:
 - Modify the UI to make the section dropzone more visible
 - Prevent the direct image dragging in Chrome, Safari by improving the check
2022-02-28 14:00:57 +07:00
Andrew Nicols 39588c2ee1 MDL-73899 behat: Fix coding style issues to change third-party status
This commit removes the moodle-behat-extension from the list of
third-party libraries.

In order to do this properly, all pending coding-style issues are fixed.
In addition the following niceties have also been included:
* convert long form array() syntax to short form
* alphabetically sort class imports (use)
* remove unused class imports
* correct documentation
* Normalise whitespace in concat operators
* Remove unnecessary file docblocks
2022-02-23 08:19:30 +08:00
Bas Brands d5db2b18ce MDL-73793 theme_boost: iOS scroll and drawertoggle 2022-02-22 15:37:04 +01:00
Jake Dallimore ae5aaf9b82 MDL-73950 enrol_lti: fix icon spacing in dynamic registration URL 2022-02-21 16:02:12 +08:00
Shamim Rezaie 3094b2cf38 MDL-73383 atto_collapse: Do not announce the list of added buttons 2022-02-17 12:46:25 +11:00
Paul Holden 44ce37902d MDL-73895 message: hide empty component notification categories.
If a component has no available notification types (because they're
disabled), then it (the component) should be hidden entirely from
the user notification preferences page.
2022-02-16 10:31:07 +00:00
Jonathan Harker 55fff62fb4 MDL-72646 theme: update font download MIME types, RFC-8081 2022-02-16 19:10:05 +13:00
Shamim Rezaie cb3ccf14b2 MDL-73607 theme: hide drawers when they are not visible
This is to prevent browser search find texts that are not visible
on the page.
As part of this change, I deleted $drawer-transition that I had added
ats part of MDL-72910. It was a master only change and I deleted it
because customising it would only create problems (because of the many
other hardcoded values in other files).
2022-02-16 13:30:13 +11:00
Bas Brands d9cefeba09 MDL-73795 theme_boost: align header actions on mobile 2022-02-09 15:06:04 +01:00
Huong Nguyen b5c181f117 MDL-72915 qtype_ddimageortext: Fix eventHandler for Unlimited items
Sometimes, for the question that has a lot of input groups and unlimited draggable items,
the 'clone' process takes longer than usual, so the questionManager.init() method
will not add the eventHandler for the cloned drag.
We should make sure to bind the eventHandler for the cloned too
2022-02-09 15:23:37 +07:00
Claude Vervoort b4d9519c47 MDL-73779 mod_lti: dynreg fix messages supported 2022-02-04 15:32:55 -05:00
Max Larkin 4e104467ce MDL-73555 tool_brickfield: More efficient summary data processing 2022-01-20 11:40:55 -05:00
2220 changed files with 27451 additions and 23630 deletions
+1
View File
@@ -54,3 +54,4 @@ moodle-plugin-ci.phar
/admin/tool/componentlibrary/docs
/admin/tool/componentlibrary/hugo/site/data/my-index.json
.hugo_build.lock
.phpcs.xml
+39
View File
@@ -21,6 +21,43 @@
*/
module.exports = grunt => {
/**
* Generate the PHPCS configuration.
*
* @param {Object} thirdPartyPaths
*/
const phpcsIgnore = (thirdPartyPaths) => {
const {toXML} = require('jstoxml');
const config = {
_name: 'ruleset',
_attrs: {
name: "MoodleCore",
},
_content: [
{
rule: {
_attrs: {
ref: './.phpcs.xml.dist',
},
},
},
],
};
thirdPartyPaths.forEach(library => {
config._content.push({
'exclude-pattern': library,
});
});
grunt.file.write('.phpcs.xml', toXML(config, {
header: true,
indent: ' ',
}) + "\n");
};
/**
* Generate ignore files (utilising thirdpartylibs.xml data)
*/
@@ -53,6 +90,8 @@ module.exports = grunt => {
'admin/tool/componentlibrary/hugo/dist/css/docs.css',
].concat(thirdPartyPaths);
grunt.file.write('.stylelintignore', stylelintIgnores.join('\n') + '\n');
phpcsIgnore(thirdPartyPaths);
};
grunt.registerTask('ignorefiles', 'Generate ignore files for linters', handler);
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="MoodleCore">
<rule ref="moodle"/>
</ruleset>
+1 -1
View File
@@ -221,7 +221,7 @@ before_script:
# We need the official upstream for comparison
git remote add upstream https://github.com/moodle/moodle.git;
git fetch upstream master;
git fetch upstream MOODLE_400_STABLE;
export GIT_PREVIOUS_COMMIT="`git merge-base FETCH_HEAD $TRAVIS_COMMIT`";
export GIT_COMMIT="$TRAVIS_COMMIT";
export UPSTREAM_FETCH_HEAD=`git rev-parse FETCH_HEAD`
+1
View File
@@ -69,6 +69,7 @@
echo $OUTPUT->header();
echo $OUTPUT->heading($strmanageblocks);
echo $OUTPUT->notification(get_string('noteunneededblocks', 'admin'), 'info');
/// Main display starts here
/// Get and sort the existing blocks
+6
View File
@@ -48,6 +48,12 @@ if (!($settingspage->check_access())) {
print_error('accessdenied', 'admin');
}
$hassiteconfig = has_capability('moodle/site:config', $PAGE->context);
if ($hassiteconfig) {
$PAGE->add_header_action($OUTPUT->render_from_template('core_admin/header_search_input', [
'action' => new moodle_url('/admin/search.php'),
]));
}
$statusmsg = '';
$errormsg = '';
+1 -1
View File
@@ -243,7 +243,7 @@ class task_log extends base {
$filters[] = (new filter(
text::class,
'name',
new lang_string('name'),
new lang_string('classname', 'tool_task'),
$this->get_entity_name(),
"{$tablealias}.classname"
))
+35 -27
View File
@@ -31,14 +31,15 @@ $filterpath = optional_param('filterpath', '', PARAM_PLUGIN);
admin_externalpage_setup('managefilters');
// Clean up bogus filter states first.
/** @var core\plugininfo\filter[] $plugininfos */
$plugininfos = core_plugin_manager::instance()->get_plugins_of_type('filter');
$filters = array();
$filters = [];
$states = filter_get_global_states();
foreach ($states as $state) {
if (!isset($plugininfos[$state->filter]) and !get_config('filter_'.$state->filter, 'version')) {
// Purge messy leftovers after incorrectly uninstalled plugins and unfinished installs.
$DB->delete_records('filter_active', array('filter' => $state->filter));
$DB->delete_records('filter_config', array('filter' => $state->filter));
// Purge messy leftovers after incorrectly uninstalled plugins and unfinished installations.
$DB->delete_records('filter_active', ['filter' => $state->filter]);
$DB->delete_records('filter_config', ['filter' => $state->filter]);
error_log('Deleted bogus "filter_'.$state->filter.'" states and config data.');
} else {
$filters[$state->filter] = $state;
@@ -50,7 +51,6 @@ foreach ($plugininfos as $filter => $info) {
if (isset($filters[$filter])) {
continue;
}
/** @var \core\plugininfo\base $info */
if ($info->is_installed_and_upgraded()) {
filter_set_global_state($filter, TEXTFILTER_DISABLED);
$states = filter_get_global_states();
@@ -72,7 +72,8 @@ switch ($action) {
case 'setstate':
if (isset($filters[$filterpath]) and $newstate = optional_param('newstate', '', PARAM_INT)) {
$class = \core_plugin_manager::resolve_plugininfo_class('filter');
/** @var \core\plugininfo\filter $class */
$class = core_plugin_manager::resolve_plugininfo_class('filter');
$class::enable_plugin($filterpath, $newstate);
}
break;
@@ -117,12 +118,12 @@ $states = filter_get_global_states();
$stringfilters = filter_get_string_filters();
$table = new html_table();
$table->head = array(get_string('filter'), get_string('isactive', 'filters'),
get_string('order'), get_string('applyto', 'filters'), get_string('settings'), get_string('uninstallplugin', 'core_admin'));
$table->head = [get_string('filter'), get_string('isactive', 'filters'),
get_string('order'), get_string('applyto', 'filters'), get_string('settings'), get_string('uninstallplugin', 'core_admin')];
$table->colclasses = array ('leftalign', 'leftalign', 'centeralign', 'leftalign', 'leftalign', 'leftalign');
$table->attributes['class'] = 'admintable generaltable';
$table->id = 'filterssetting';
$table->data = array();
$table->data = [];
$lastactive = null;
foreach ($states as $state) {
@@ -159,15 +160,16 @@ die;
/**
* Return action URL.
*
* @param string $filterpath
* @param string $action
* @return moodle_url
* @param string $filterpath which filter to get the URL for.
* @param string $action which action to get the URL for.
* @return moodle_url|null the requested URL.
*/
function filters_action_url($filterpath, $action) {
function filters_action_url(string $filterpath, string $action): ?moodle_url {
if ($action === 'delete') {
return core_plugin_manager::instance()->get_uninstall_url('filter_'.$filterpath, 'manage');
}
return new moodle_url('/admin/filters.php', array('sesskey'=>sesskey(), 'filterpath'=>$filterpath, 'action'=>$action));
return new moodle_url('/admin/filters.php',
['sesskey' => sesskey(), 'filterpath' => $filterpath, 'action' => $action]);
}
/**
@@ -180,24 +182,25 @@ function filters_action_url($filterpath, $action) {
* @param bool $applytostrings
* @return array data
*/
function get_table_row(\core\plugininfo\filter $plugininfo, $state, $isfirstrow, $islastactive, $applytostrings) {
function get_table_row(\core\plugininfo\filter $plugininfo, stdClass $state,
bool $isfirstrow, bool $islastactive, bool $applytostrings): array {
global $OUTPUT;
$row = array();
$row = [];
$filter = $state->filter;
$active = $plugininfo->is_installed_and_upgraded();
static $activechoices;
static $applytochoices;
if (!isset($activechoices)) {
$activechoices = array(
$activechoices = [
TEXTFILTER_DISABLED => get_string('disabled', 'core_filters'),
TEXTFILTER_OFF => get_string('offbutavailable', 'core_filters'),
TEXTFILTER_ON => get_string('on', 'core_filters'),
);
$applytochoices = array(
];
$applytochoices = [
0 => get_string('content', 'core_filters'),
1 => get_string('contentandheadings', 'core_filters'),
);
];
}
// Filter name.
@@ -211,7 +214,7 @@ function get_table_row(\core\plugininfo\filter $plugininfo, $state, $isfirstrow,
// Disable/off/on.
$select = new single_select(filters_action_url($filter, 'setstate'), 'newstate', $activechoices, $state->active, null, 'active' . $filter);
$select->set_label(get_string('isactive', 'filters'), array('class' => 'accesshide'));
$select->set_label(get_string('isactive', 'filters'), ['class' => 'accesshide']);
$row[] = $OUTPUT->render($select);
// Re-order.
@@ -219,12 +222,14 @@ function get_table_row(\core\plugininfo\filter $plugininfo, $state, $isfirstrow,
$spacer = $OUTPUT->spacer();
if ($state->active != TEXTFILTER_DISABLED) {
if (!$isfirstrow) {
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'up'), new pix_icon('t/up', get_string('up'), '', array('class' => 'iconsmall')));
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'up'),
new pix_icon('t/up', get_string('up'), '', ['class' => 'iconsmall']));
} else {
$updown .= $spacer;
}
if (!$islastactive) {
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'down'), new pix_icon('t/down', get_string('down'), '', array('class' => 'iconsmall')));
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'down'),
new pix_icon('t/down', get_string('down'), '', ['class' => 'iconsmall']));
} else {
$updown .= $spacer;
}
@@ -232,20 +237,23 @@ function get_table_row(\core\plugininfo\filter $plugininfo, $state, $isfirstrow,
$row[] = $updown;
// Apply to strings.
$select = new single_select(filters_action_url($filter, 'setapplyto'), 'stringstoo', $applytochoices, $applytostrings, null, 'applyto' . $filter);
$select->set_label(get_string('applyto', 'filters'), array('class' => 'accesshide'));
$select = new single_select(filters_action_url($filter, 'setapplyto'),
'stringstoo', $applytochoices, $applytostrings, null, 'applyto' . $filter);
$select->set_label(get_string('applyto', 'filters'), ['class' => 'accesshide']);
$select->disabled = ($state->active == TEXTFILTER_DISABLED);
$row[] = $OUTPUT->render($select);
// Settings link, if required.
if ($active and filter_has_global_settings($filter)) {
$row[] = html_writer::link(new moodle_url('/admin/settings.php', array('section'=>'filtersetting'.$filter)), get_string('settings'));
$row[] = html_writer::link(new moodle_url('/admin/settings.php',
['section' => 'filtersetting'.$filter]), get_string('settings'));
} else {
$row[] = '';
}
// Uninstall.
$row[] = html_writer::link(filters_action_url($filter, 'delete'), get_string('uninstallplugin', 'core_admin'));
$row[] = html_writer::link(filters_action_url($filter, 'delete'),
get_string('uninstallplugin', 'core_admin'));
return $row;
}
+7
View File
@@ -53,6 +53,12 @@ if (!extension_loaded('xml')) {
die();
}
// Make sure mbstring extension is available.
if (!extension_loaded('mbstring')) {
echo 'Moodle requires the mbstring PHP extension. Please install or enable the mbstring extension.';
die();
}
define('NO_OUTPUT_BUFFERING', true);
if (isset($_POST['upgradekey'])) {
@@ -825,6 +831,7 @@ $insecuredataroot = is_dataroot_insecure(true);
$SESSION->admin_critical_warning = ($insecuredataroot==INSECURE_DATAROOT_ERROR);
$adminroot = admin_get_root();
$PAGE->set_primary_active_tab('siteadminnode');
// Check if there are any new admin settings which have still yet to be set
if (any_new_admin_settings($adminroot)) {
+16 -5
View File
@@ -38,11 +38,22 @@
}
if (!empty($show) and confirm_sesskey()) {
$class = \core_plugin_manager::resolve_plugininfo_class('mod');
$class::enable_plugin($show, true);
$canenablemodule = true;
$modulename = $show;
admin_get_root(true, false); // settings not required - only pages
redirect(new moodle_url('/admin/modules.php'));
// Invoking a callback function that enables plugins to force additional actions (e.g. displaying notifications,
// modals, etc.) and also specify through its returned value (bool) whether the process of enabling the plugin
// should continue after these actions or not.
if (component_callback_exists("mod_{$modulename}", 'pre_enable_plugin_actions')) {
$canenablemodule = component_callback("mod_{$modulename}", 'pre_enable_plugin_actions');
}
if ($canenablemodule) {
$class = \core_plugin_manager::resolve_plugininfo_class('mod');
$class::enable_plugin($show, true);
admin_get_root(true, false); // Settings not required - only pages.
redirect(new moodle_url('/admin/modules.php'));
}
}
echo $OUTPUT->header();
@@ -75,7 +86,7 @@
$missing = true;
} else {
// took out hspace="\10\", because it does not validate. don't know what to replace with.
$icon = "<img src=\"" . $OUTPUT->image_url('icon', $module->name) . "\" class=\"icon\" alt=\"\" />";
$icon = "<img src=\"" . $OUTPUT->image_url('monologo', $module->name) . "\" class=\"icon\" alt=\"\" />";
$strmodulename = $icon.' '.get_string('modulename', $module->name);
$missing = false;
}
+2
View File
@@ -52,6 +52,8 @@ $pageurl = new moodle_url('/admin/plugins.php', $pageparams);
$pluginman = core_plugin_manager::instance();
$PAGE->set_primary_active_tab('siteadminnode');
if ($uninstall) {
if (!$confirmed) {
+27 -15
View File
@@ -15,20 +15,13 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Renderer for core_admin subsystem
* Standard HTML output renderer for core_admin subsystem.
*
* @package core
* @subpackage admin
* @copyright 2011 David Mudrak <david@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Standard HTML output renderer for core_admin subsystem
*/
class core_admin_renderer extends plugin_renderer_base {
/**
@@ -301,6 +294,7 @@ class core_admin_renderer extends plugin_renderer_base {
$output = '';
$output .= $this->header();
$output .= $this->output->heading(get_string('notifications', 'admin'));
$output .= $this->maturity_info($maturity);
$output .= $this->legacy_log_store_writing_error();
$output .= empty($CFG->disableupdatenotifications) ? $this->available_updates($availableupdates, $availableupdatesfetch) : '';
@@ -1086,12 +1080,21 @@ class core_admin_renderer extends plugin_renderer_base {
$plugintyperows = array();
foreach ($plugins as $name => $plugin) {
$component = "{$plugin->type}_{$plugin->name}";
$sumtotal++;
$row = new html_table_row();
$row->attributes['class'] = 'type-' . $plugin->type . ' name-' . $plugin->type . '_' . $plugin->name;
$row->attributes['class'] = "type-{$plugin->type} name-{$component}";
if ($this->page->theme->resolve_image_location('icon', $plugin->type . '_' . $plugin->name, null)) {
$icon = $this->output->pix_icon('icon', '', $plugin->type . '_' . $plugin->name, array('class' => 'smallicon pluginicon'));
$iconidentifier = 'icon';
if ($plugin->type === 'mod') {
$iconidentifier = 'monologo';
}
if ($this->page->theme->resolve_image_location($iconidentifier, $component, null)) {
$icon = $this->output->pix_icon($iconidentifier, '', $component, [
'class' => 'smallicon pluginicon',
]);
} else {
$icon = '';
}
@@ -1804,11 +1807,20 @@ class core_admin_renderer extends plugin_renderer_base {
}
foreach ($plugins as $name => $plugin) {
$row = new html_table_row();
$row->attributes['class'] = 'type-' . $plugin->type . ' name-' . $plugin->type . '_' . $plugin->name;
$component = "{$plugin->type}_{$plugin->name}";
if ($this->page->theme->resolve_image_location('icon', $plugin->type . '_' . $plugin->name, null)) {
$icon = $this->output->pix_icon('icon', '', $plugin->type . '_' . $plugin->name, array('class' => 'icon pluginicon'));
$row = new html_table_row();
$row->attributes['class'] = "type-{$plugin->type} name-{$component}";
$iconidentifier = 'icon';
if ($plugin->type === 'mod') {
$iconidentifier = 'monologo';
}
if ($this->page->theme->resolve_image_location($iconidentifier, $component, null)) {
$icon = $this->output->pix_icon($iconidentifier, '', $component, [
'class' => 'icon pluginicon',
]);
} else {
$icon = $this->output->spacer();
}
+3
View File
@@ -49,6 +49,9 @@ if (optional_param('submit', false, PARAM_BOOL) && data_submitted() && confirm_s
redirect($baseurl);
}
$PAGE->set_secondary_active_tab('users');
$PAGE->set_primary_active_tab('siteadminnode');
$controller->load_current_settings();
// Display the editing form.
+4
View File
@@ -87,6 +87,10 @@ if ($action === 'add') {
$title = get_string('editingrolex', 'core_role', $rolenames[$roleid]->localname);
}
$PAGE->set_secondary_active_tab('users');
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->navbar->add($title, $baseurl);
// Decide how to create new role.
if ($action === 'add' and $resettype !== 'none') {
$mform = new core_role_preset_form(null, array('action'=>'add', 'roleid'=>0, 'resettype'=>'0', 'return'=>'manage'));
+3
View File
@@ -60,6 +60,9 @@ $undeletableroles[$CFG->notloggedinroleid] = 1;
$undeletableroles[$CFG->guestroleid] = 1;
$undeletableroles[$CFG->defaultuserroleid] = 1;
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->navbar->add(get_string('defineroles', 'role'), $PAGE->url);
// Process submitted data.
$confirmed = (optional_param('confirm', false, PARAM_BOOL) && data_submitted() && confirm_sesskey());
switch ($action) {
@@ -0,0 +1,32 @@
@core @core_admin @core_admin_roles @javascript
Feature: Verify the breadcrumbs in define roles site administration pages
Whenever I navigate to define roles page in site administration
As an admin
The breadcrumbs should be visible
Background:
Given I log in as "admin"
Scenario: Verify breadcrumbs in manage roles tab
Given I navigate to "Users > Permissions > Define roles" in site administration
When "Define roles" "text" should exist in the ".breadcrumb" "css_element"
Then "Permissions" "link" should exist in the ".breadcrumb" "css_element"
Scenario Outline: Verify breadcrumbs in allow role tabs
Given I navigate to "Users > Permissions > Define roles" in site administration
When I click on "<allowlink>" "link"
Then "Define roles" "text" should exist in the ".breadcrumb" "css_element"
And "Permissions" "link" should exist in the ".breadcrumb" "css_element"
Examples:
| allowlink |
| Allow role assignments |
| Allow role overrides |
| Allow role switches |
| Allow role to view |
Scenario: Verify breadcrumbs in new role page
Given I navigate to "Users > Permissions > Define roles" in site administration
And I click on "Add a new role" "button"
Then "Define roles" "text" should exist in the ".breadcrumb" "css_element"
And "Permissions" "link" should exist in the ".breadcrumb" "css_element"
+9 -14
View File
@@ -12,6 +12,10 @@ $query = trim(optional_param('query', '', PARAM_NOTAGS)); // Search string
$context = context_system::instance();
$PAGE->set_context($context);
// If we are performing a search we need to display the secondary navigation with links as opposed to just anchors.
// NOTE: hassecondarynavigation will be overridden in classic.
$PAGE->set_secondary_navigation(true, !$query);
$hassiteconfig = has_capability('moodle/site:config', $context);
if ($hassiteconfig && moodle_needs_upgrading()) {
@@ -24,18 +28,6 @@ if ($hassiteconfig && moodle_needs_upgrading()) {
admin_externalpage_setup('search', '', array('query' => $query)); // now hidden page
$PAGE->set_heading(get_string('administrationsite')); // Has to be after setup since it has its' own heading set_heading.
if ($hassiteconfig) {
$data = [
'action' => new moodle_url('/admin/search.php'),
'btnclass' => 'btn-primary',
'inputname' => 'query',
'searchstring' => get_string('search'),
'query' => $query,
'extraclasses' => 'd-flex justify-content-end'
];
$PAGE->add_header_action($OUTPUT->render_from_template('core/search_input', $data));
}
$adminroot = admin_get_root(); // need all settings here
$adminroot->search = $query; // So we can reference it in search boxes later in this invocation
$statusmsg = '';
@@ -89,8 +81,11 @@ if ($query && $hassiteconfig) {
if ($showsettingslinks) {
$node = $PAGE->settingsnav->find('root', navigation_node::TYPE_SITE_ADMIN);
if ($node) {
$moremenu = new \core\navigation\output\more_menu($PAGE->secondarynav, 'nav-tabs');
$secondarynavigation = $moremenu->export_for_template($OUTPUT);
$secondarynavigation = false;
if ($PAGE->has_secondary_navigation()) {
$moremenu = new \core\navigation\output\more_menu($PAGE->secondarynav, 'nav-tabs', true, true);
$secondarynavigation = $moremenu->export_for_template($OUTPUT);
}
echo $OUTPUT->render_from_template('core/settings_link_page',
['node' => $node, 'secondarynavigation' => $secondarynavigation]);
}
+3 -1
View File
@@ -26,7 +26,7 @@ require_once($CFG->libdir . '/adminlib.php');
admin_externalpage_setup('searchareas');
$areaid = optional_param('areaid', null, PARAM_ALPHAEXT);
$areaid = optional_param('areaid', null, PARAM_ALPHANUMEXT);
$action = optional_param('action', null, PARAM_ALPHA);
$indexingenabled = \core_search\manager::is_indexing_enabled(); // This restricts many of the actions on this page.
@@ -37,6 +37,8 @@ try {
// In action cases, we'll throw this exception below. In non-action cases, we produce a lang string error.
}
$PAGE->set_primary_active_tab('siteadminnode');
// Handle all the actions.
if ($action) {
// If dealing with an areaid, we need to check that the area exists.
+3
View File
@@ -39,6 +39,9 @@ if ($area === false) {
}
$areaname = $area->get_visible_name();
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->set_secondary_active_tab('modules');
// Start page output.
$heading = get_string('gradualreindex', 'search', '');
$PAGE->set_title($PAGE->title . ': ' . $heading);
+15
View File
@@ -33,6 +33,21 @@ if (!($settingspage->check_access())) {
die;
}
// If the context in the admin_settingpage object is explicitly defined and it is not system, reset the current
// page context and use that one instead. This ensures that the proper navigation is displayed and highlighted.
if ($settingspage->context && !$settingspage->context instanceof \context_system) {
$PAGE->set_context($settingspage->context);
}
$hassiteconfig = has_capability('moodle/site:config', context_system::instance());
// Display the admin search input element in the page header if the user has the capability to change the site
// configuration and the current page context is system.
if ($hassiteconfig && $PAGE->context instanceof \context_system) {
$PAGE->add_header_action($OUTPUT->render_from_template('core_admin/header_search_input', [
'action' => new moodle_url('/admin/search.php'),
]));
}
/// WRITING SUBMITTED DATA (IF ANY) -------------------------------------------------------------------------------
$statusmsg = '';
+29 -12
View File
@@ -40,7 +40,8 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { // sp
'profile,moodle|/user/profile.php
grades,grades|/grade/report/mygrades.php
calendar,core_calendar|/calendar/view.php?view=month
privatefiles,moodle|/user/files.php',
privatefiles,moodle|/user/files.php
reports,core_reportbuilder|/reportbuilder/index.php',
PARAM_RAW,
'50',
'10'
@@ -185,15 +186,29 @@ privatefiles,moodle|/user/files.php',
// Navigation settings
$temp = new admin_settingpage('navigation', new lang_string('navigation'));
$choices = array(
HOMEPAGE_SITE => new lang_string('site'),
HOMEPAGE_MY => new lang_string('mymoodle', 'admin'),
HOMEPAGE_MYCOURSES => new lang_string('mycourses', 'admin'),
HOMEPAGE_USER => new lang_string('userpreference', 'admin')
);
$temp->add(new admin_setting_configcheckbox(
'enabledashboard',
new lang_string('enabledashboard', 'admin'),
new lang_string('enabledashboard_help', 'admin'),
1
));
$choices = [HOMEPAGE_SITE => new lang_string('home')];
if (!empty($CFG->enabledashboard)) {
$choices[HOMEPAGE_MY] = new lang_string('mymoodle', 'admin');
}
$choices[HOMEPAGE_MYCOURSES] = new lang_string('mycourses', 'admin');
$choices[HOMEPAGE_USER] = new lang_string('userpreference', 'admin');
$temp->add(new admin_setting_configselect('defaulthomepage', new lang_string('defaulthomepage', 'admin'),
new lang_string('configdefaulthomepage', 'admin'), HOMEPAGE_MY, $choices));
$temp->add(new admin_setting_configcheckbox('allowguestmymoodle', new lang_string('allowguestmymoodle', 'admin'), new lang_string('configallowguestmymoodle', 'admin'), 1));
new lang_string('configdefaulthomepage', 'admin'), get_default_home_page(), $choices));
if (!empty($CFG->enabledashboard)) {
$temp->add(new admin_setting_configcheckbox(
'allowguestmymoodle',
new lang_string('allowguestmymoodle', 'admin'),
new lang_string('configallowguestmymoodle', 'admin'),
1
));
}
$temp->add(new admin_setting_configcheckbox('navshowfullcoursenames', new lang_string('navshowfullcoursenames', 'admin'), new lang_string('navshowfullcoursenames_help', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('navshowcategories', new lang_string('navshowcategories', 'admin'), new lang_string('confignavshowcategories', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('navshowmycoursecategories', new lang_string('navshowmycoursecategories', 'admin'), new lang_string('navshowmycoursecategories_help', 'admin'), 0));
@@ -236,9 +251,11 @@ privatefiles,moodle|/user/files.php',
$temp->add(new admin_setting_configcheckbox('doctonewwindow', new lang_string('doctonewwindow', 'admin'), new lang_string('configdoctonewwindow', 'admin'), 0));
$ADMIN->add('appearance', $temp);
$temp = new admin_externalpage('mypage', new lang_string('mypage', 'admin'), $CFG->wwwroot . '/my/indexsys.php',
'moodle/my:configsyspages');
$ADMIN->add('appearance', $temp);
if (!empty($CFG->enabledashboard)) {
$temp = new admin_externalpage('mypage', new lang_string('mypage', 'admin'), $CFG->wwwroot . '/my/indexsys.php',
'moodle/my:configsyspages');
$ADMIN->add('appearance', $temp);
}
$temp = new admin_externalpage('profilepage', new lang_string('myprofile', 'admin'), $CFG->wwwroot . '/user/profilesys.php',
'moodle/my:configsyspages');
+9
View File
@@ -88,6 +88,15 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
$downloadcontentsitedefault->add_dependent_on('downloadcoursecontentallowed');
$temp->add($downloadcontentsitedefault);
$temp->add(
new admin_setting_configtext(
'moodlecourse/participantsperpage',
new lang_string('participants:perpage', 'course'),
new lang_string('participants:perpage_help', 'course'),
20
)
);
// Course format.
$temp->add(new admin_setting_heading('courseformathdr', new lang_string('type_format', 'plugin'), ''));
+10
View File
@@ -251,6 +251,9 @@ if ($hassiteconfig) {
array('0' => new lang_string('none'), '1' => new lang_string('allfiles'), '2' => new lang_string('htmlfilesonly')));
$items[] = new admin_setting_configcheckbox('filtermatchoneperpage', new lang_string('filtermatchoneperpage', 'admin'), new lang_string('configfiltermatchoneperpage', 'admin'), 0);
$items[] = new admin_setting_configcheckbox('filtermatchonepertext', new lang_string('filtermatchonepertext', 'admin'), new lang_string('configfiltermatchonepertext', 'admin'), 0);
$items[] = new admin_setting_configcheckbox('filternavigationwithsystemcontext',
new lang_string('filternavigationwithsystemcontext', 'admin'),
new lang_string('configfilternavigationwithsystemcontext', 'admin'), 0);
foreach ($items as $item) {
$item->set_updatedcallback('reset_text_filters_cache');
$temp->add($item);
@@ -325,6 +328,13 @@ if ($hassiteconfig) {
$temp->add(new admin_setting_managedataformats());
$ADMIN->add('dataformatsettings', $temp);
$plugins = core_plugin_manager::instance()->get_plugins_of_type('dataformat');
core_collator::asort_objects_by_property($plugins, 'displayname');
foreach ($plugins as $plugin) {
/** @var \core\plugininfo\dataformat $plugin */
$plugin->load_settings($ADMIN, 'dataformatsettings', $hassiteconfig);
}
//== Portfolio settings ==
require_once($CFG->libdir. '/portfoliolib.php');
$catname = new lang_string('portfolios', 'portfolio');
+2 -1
View File
@@ -151,7 +151,8 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$sensiblesettingsdefault .= 'dbpass@@enrol_database, bind_pw@@enrol_ldap, ';
$sensiblesettingsdefault .= 'server_password@@search_solr, ssl_keypassword@@search_solr, ';
$sensiblesettingsdefault .= 'alternateserver_password@@search_solr, alternatessl_keypassword@@search_solr, ';
$sensiblesettingsdefault .= 'test_password@@cachestore_redis, password@@mlbackend_python';
$sensiblesettingsdefault .= 'test_password@@cachestore_redis, password@@mlbackend_python, ';
$sensiblesettingsdefault .= 'badges_badgesalt@@none, calendar_exportsalt@@none';
$temp->add(new admin_setting_configtextarea('adminpresets/sensiblesettings',
get_string('sensiblesettings', 'core_adminpresets'),
get_string('sensiblesettingstext', 'core_adminpresets'),
@@ -0,0 +1,52 @@
{{!
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/>.
}}
{{!
@template core_admin/header_search_input
Admin search input for page header.
Example context (json):
{
"action": "http://moodle.local/admin/search.php",
"query": "themedesigner"
}
}}
<div class="simplesearchform d-flex justify-content-end">
<form autocomplete="off" action="{{action}}" method="get" accept-charset="utf-8" class="mform form-inline simplesearchform">
<div class="input-group">
<label for="searchinput-{{uniqid}}">
<span class="sr-only">{{#str}} search, core {{/str}}</span>
</label>
<input type="text"
id="searchinput-{{uniqid}}"
class="form-control"
placeholder="{{#str}} search, core {{/str}}"
aria-label="{{#str}} search, core {{/str}}"
name="query"
data-region="input"
autocomplete="off"
{{#query}}value="{{.}}"{{/query}}
>
<div class="input-group-append">
<button type="submit" class="btn btn-primary search-icon">
{{#pix}} a/search, core {{/pix}}
<span class="sr-only">{{#str}} search, core {{/str}}</span>
</button>
</div>
</div>
</form>
</div>
+4 -2
View File
@@ -18,6 +18,10 @@ Feature: An administrator can filter user accounts by role, cohort and other pro
And the following "cohorts" exist:
| name | idnumber |
| Cohort 1 | CH1 |
And the following "cohort members" exist:
| user | cohort |
| user2 | CH1 |
| user3 | CH1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
@@ -27,8 +31,6 @@ Feature: An administrator can filter user accounts by role, cohort and other pro
| user2 | C1 | student |
| user3 | C1 | student |
And I log in as "admin"
And I add "User Two (two@example.com)" user to "CH1" cohort members
And I add "User Three (three@example.com)" user to "CH1" cohort members
And I navigate to "Users > Accounts > Browse list of users" in site administration
Scenario: Filter user accounts by role and cohort
@@ -0,0 +1,31 @@
@core @core_admin @javascript
Feature: Verify the breadcrumbs in external webservice site administration pages
Whenever I navigate to external webservice page in site administration
As an admin
The breadcrumbs should be visible
Background:
Given I log in as "admin"
Scenario: Verify the breadcrumbs in external services page
Given I navigate to "Server > Web services > External services" in site administration
And "External services" "text" should exist in the ".breadcrumb" "css_element"
And "Web services" "link" should exist in the ".breadcrumb" "css_element"
When I click on "Edit" "link"
Then "Edit external service" "text" should exist in the ".breadcrumb" "css_element"
And "External services" "link" should exist in the ".breadcrumb" "css_element"
And "Web services" "link" should exist in the ".breadcrumb" "css_element"
And I press "Cancel"
And I click on "Add" "link"
And I set the field "Name" to "function to test"
And "Add external service" "text" should exist in the ".breadcrumb" "css_element"
And "External services" "link" should exist in the ".breadcrumb" "css_element"
And "Web services" "link" should exist in the ".breadcrumb" "css_element"
And I press "Add service"
And "Functions" "text" should exist in the ".breadcrumb" "css_element"
And "External services" "link" should exist in the ".breadcrumb" "css_element"
And "Web services" "link" should exist in the ".breadcrumb" "css_element"
And I navigate to "Server > Web services > External services" in site administration
And I click on "Delete" "link"
And "External services" "text" should exist in the ".breadcrumb" "css_element"
And "Web services" "link" should exist in the ".breadcrumb" "css_element"
@@ -0,0 +1,25 @@
@core @core_admin @javascript
Feature: Verify the breadcrumbs in webservice tokens site administration pages
Whenever I navigate to manage tokens page in site administration
As an admin
The breadcrumbs should be visible
Background:
Given I log in as "admin"
Scenario: Verify the breadcrumbs in manage tokens page as an admin
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | John | Doe | s1@example.com |
And I log in as "admin"
And I navigate to "Server > Web services > Manage tokens" in site administration
And I click on "Create token" "button"
And "Create token" "text" should exist in the ".breadcrumb" "css_element"
And "Manage tokens" "link" should exist in the ".breadcrumb" "css_element"
And "Web services" "link" should exist in the ".breadcrumb" "css_element"
And I set the field "User" to "John Doe"
And I press "Save changes"
When I click on "Delete" "link"
Then "Delete token" "text" should exist in the ".breadcrumb" "css_element"
And "Manage tokens" "link" should exist in the ".breadcrumb" "css_element"
And "Web services" "link" should exist in the ".breadcrumb" "css_element"
+3 -3
View File
@@ -14,9 +14,9 @@ Feature: View task logs report and use its filters
And I change window size to "large"
And I navigate to "Server > Tasks > Task logs" in site administration
When I click on "Filters" "button"
And I set the following fields in the "Name" "core_reportbuilder > Filter" to these values:
| Name operator | Contains |
| Name value | <name> |
And I set the following fields in the "Class name" "core_reportbuilder > Filter" to these values:
| Class name operator | Contains |
| Class name value | <name> |
And I click on "Apply" "button" in the "[data-region='report-filters']" "css_element"
Then I should see "Filters applied"
And I should see "Filters (1)" in the "#dropdownFiltersButton" "css_element"
@@ -137,6 +137,10 @@ class base {
$PAGE->navbar->add($title);
}
if ($node = $PAGE->settingsnav->find('tool_admin_presets', \navigation_node::TYPE_SETTING)) {
$node->make_active();
}
echo $OUTPUT->header();
echo $OUTPUT->heading($title);
if ($text) {
+1
View File
@@ -52,6 +52,7 @@ $url->param('mode', $mode);
$PAGE->set_url($url);
$PAGE->set_pagelayout('admin');
$PAGE->set_context($context);
$PAGE->set_primary_active_tab('siteadminnode');
// Executes the required action.
$instance = new $classname();
@@ -14,8 +14,10 @@ Feature: Admin preset deletion
And I should see "Custom preset"
When I open the action menu in "Custom preset" "table_row"
And I should see "Delete"
And I press the escape key
And I open the action menu in "Full" "table_row"
Then I should not see "Delete"
And I press the escape key
And I open the action menu in "Starter" "table_row"
And I should not see "Delete"
+2 -2
View File
@@ -26,5 +26,5 @@
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'tool_admin_presets';
$plugin->version = 2021111100;
$plugin->requires = 2021080500;
$plugin->version = 2022041900;
$plugin->requires = 2022041200;
@@ -76,10 +76,14 @@ class helper {
$PAGE->set_context($context);
$PAGE->set_url($url);
$PAGE->set_secondary_active_tab('siteadminnode');
$PAGE->set_primary_active_tab('siteadminnode');
if ($siteadmin = $PAGE->settingsnav->find('root', \navigation_node::TYPE_SITE_ADMIN)) {
$PAGE->navbar->add($siteadmin->get_content(), $siteadmin->action());
$PAGE->navbar->add($siteadmin->get_content(), $siteadmin->action(),
\breadcrumb_navigation_node::TYPE_SITE_ADMIN, null, 'root');
}
if ($analytics = $PAGE->settingsnav->find('analytics', \navigation_node::TYPE_SETTING)) {
$PAGE->navbar->add($analytics->get_content(), $analytics->action());
}
@@ -0,0 +1,37 @@
@core @tool @tool_analytics @javascript
Feature: Verify the breadcrumbs in analytics site administration pages
Whenever I navigate to analytics page in site administration to create, import, edit or restore models
As an admin
The breadcrumbs should be visible
Background:
Given I log in as "admin"
Scenario: Verify the breadcrumbs in analytics models page by visiting the create model, import model, restore model and edit page
Given I navigate to "Analytics > Analytics models" in site administration
And I click on "New model" "link"
When I click on "Create model" "link"
Then "Create model" "text" should exist in the ".breadcrumb" "css_element"
And "Analytics model" "link" should exist in the ".breadcrumb" "css_element"
And "Analytics" "link" should exist in the ".breadcrumb" "css_element"
And I press "Cancel"
# Testing import model page
And I click on "New model" "link"
And I click on "Import model" "link"
And "Import model" "text" should exist in the ".breadcrumb" "css_element"
And "Analytics model" "link" should exist in the ".breadcrumb" "css_element"
And "Analytics" "link" should exist in the ".breadcrumb" "css_element"
And I press "Cancel"
# Testing restore defaults
And I click on "New model" "link"
And I click on "Restore default models" "link"
And "Restore default models" "text" should exist in the ".breadcrumb" "css_element"
And "Analytics model" "link" should exist in the ".breadcrumb" "css_element"
And "Analytics" "link" should exist in the ".breadcrumb" "css_element"
And I click on "Back" "link"
# Testing edit page
And I click on "Actions" "link"
And I click on "Edit" "link"
And "Edit \"Courses at risk of not starting\" model" "text" should exist in the ".breadcrumb" "css_element"
And "Analytics model" "link" should exist in the ".breadcrumb" "css_element"
And "Analytics" "link" should exist in the ".breadcrumb" "css_element"
+2 -2
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021052500; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2021052500; // Requires this Moodle version.
$plugin->version = 2022041900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2022041200; // Requires this Moodle version.
$plugin->component = 'tool_analytics'; // Full name of the plugin (used for diagnostics).
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021052500;
$plugin->requires = 2021052500;
$plugin->version = 2022041900;
$plugin->requires = 2022041200;
$plugin->component = 'tool_availabilityconditions';
@@ -0,0 +1,191 @@
<?php
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* Tests for behat_form_text class
*
* @copyright 2022 onwards Eloy Lafuente (stronk7) {@link https://stronk7.com}
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_behat;
use behat_form_text;
use Behat\Mink\Session;
use Behat\Mink\Element\NodeElement;
use core_string_manager_standard;
defined('MOODLE_INTERNAL') || die;
global $CFG;
require_once($CFG->libdir . '/behat/classes/behat_session_interface.php');
require_once($CFG->libdir . '/behat/classes/behat_session_trait.php');
require_once($CFG->libdir . '/behat/form_field/behat_form_text.php');
/**
* Tests for the behat_form_text class
*
* @package tool_behat
* @category test
* @copyright 2022 onwards Eloy Lafuente (stronk7) {@link https://stronk7.com}
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*
* @covers \behat_form_text
* @covers \behat_form_field
*/
class behat_form_text_test extends \basic_testcase {
/**
* Data provider for the test_set_get_value() method.
*
* @return array of value and expectation pairs to be tested.
*/
public function provider_test_set_get_value() {
return [
'null' => [null, null],
'int' => [3, 3],
'float' => [3.14, 3.14],
'string' => ['hello', 'hello'],
'utf8' => ['你好', '你好'],
];
}
/**
* Test the set_value() and get_value() methods.
*
* @param mixed $value value to be set.
* @param mixed $expectation value to be checked.
* @dataProvider provider_test_set_get_value()
*/
public function test_set_get_value($value, $expectation) {
$session = $this->createMock(Session::class);
$node = $this->createMock(NodeElement::class);
$node->method('getValue')->willReturn($value);
$field = new behat_form_text($session, $node);
$field->set_value($value);
$this->assertEquals($expectation, $field->get_value());
}
/**
* Data provider for the test_text_matches() method.
*
* @return array of decsep, value, match and result pairs to be tested.
*/
public function provider_test_matches() {
return [
'lazy true' => ['.', 'hello', 'hello', true],
'lazy false' => ['.', 'hello', 'bye', false],
'float true' => ['.', '3.14', '3.1400', true],
'float false' => ['.', '3.14', '3.1401', false],
'float and float string true' => ['.', 3.14, '3.1400', true],
'float and unrelated string false' => ['.', 3.14, 'hello', false],
'float hash decsep true' => ['#', '3#14', '3#1400', true],
'float hash decsep false' => ['#', '3#14', '3#1401', false],
'float and float string hash decsep true' => ['#', 3.14, '3.1400', true],
'float and unrelated string hash decsep false' => ['#', 3.14, 'hello', false],
'float custom-default decsep mix1 true' => ['#', '3#14', '3.1400', true],
'float custom-default decsep mix2 true' => ['#', '3.14', '3#1400', true],
'float 2-custom decsep mix1 false' => ['#', '3#14', '3,1400', false],
'float 2-custom decsep mix2 false' => [',', '3#14', '3,1400', false],
'float default-custom decsep mix1 false' => ['.', '3#14', '3.1400', false],
'float default-custom decsep mix2 false' => ['.', '3.14', '3#1400', false],
];
}
/**
* Test the matches() method.
*
* @param string $decsep decimal separator to use.
* @param mixed $value value to be set.
* @param mixed $match value to be matched.
* @param bool $result expected return status of the function.
* @dataProvider provider_test_matches()
*/
public function test_matches($decsep, $value, $match, $result) {
global $CFG;
// Switch of string manager to avoid having to (slow) customise the lang file.
$origcustom = $CFG->config_php_settings['customstringmanager'] ?? null;
$CFG->config_php_settings['customstringmanager'] = '\tool_behat\phpunit_string_manager';
$manager = get_string_manager(true);
$manager->set_string('decsep', 'langconfig', $decsep);
$session = $this->createMock(Session::class);
$node = $this->createMock(NodeElement::class);
$node->method('getValue')->willReturn($value);
$field = new behat_form_text($session, $node);
$field->set_value($value);
$this->assertSame($result, $field->matches($match));
// Switch back to the original string manager.
if (is_null($origcustom)) {
unset($CFG->config_php_settings['customstringmanager']);
} else {
$CFG->config_php_settings['customstringmanager'] = $origcustom;
}
$manager = get_string_manager(true);
}
}
/**
* Customised values that will be used instead of standard manager one.
*
* If an existing component/identifier is found, return it instead of the real
* one from language files. Note this doesn't support place holders or another niceties.
*
* @package tool_behat
* @category test
* @copyright 2022 onwards Eloy Lafuente (stronk7) {@link https://stronk7.com}
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class phpunit_string_manager extends core_string_manager_standard {
/** @var array language customisations provided by the manager without asking for real contents */
protected $customstrings = [];
/**
* Get String returns a requested string
*
* @param string $identifier The identifier of the string to search for
* @param string $component The module the string is associated with
* @param string|object|array $a An object, string or number that can be used
* within translation strings
* @param string $lang moodle translation language, null means use current
* @return string The String !
*/
public function get_string($identifier, $component = '', $a = null, $lang = null) {
$key = trim($component) . '/' . trim($identifier);
if (isset($this->customstrings[$key])) {
return $this->customstrings[$key];
}
return parent::get_string($identifier, $component, $a, $lang);
}
/**
* Sets a custom string to be returned by the string manager instead of the language file one.
*
* @param string $identifier The identifier of the string to search for
* @param string $component The module the string is associated with
* @param string $value the contents of the language string to be returned by get_string()
*/
public function set_string($identifier, $component, $value) {
$key = trim($component) . '/' . trim($identifier);
$this->customstrings[$key] = $value;
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
// @codingStandardsIgnoreFile
// phpcs:ignoreFile
// @codeCoverageIgnoreStart
// This file is part of Moodle - http://moodle.org/
+2 -2
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021052500; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2021052500; // Requires this Moodle version.
$plugin->version = 2022041900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2022041200; // Requires this Moodle version.
$plugin->component = 'tool_behat'; // Full name of the plugin (used for diagnostics)
+12 -12
View File
@@ -477,8 +477,6 @@ class accessibility {
public static function get_summary_data(int $id): \stdClass {
global $CFG, $DB;
$components = $DB->get_records(manager::DB_AREAS);
$summarydata = new \stdClass();
$summarydata->siteurl = (substr($CFG->wwwroot, -1) !== '/') ? $CFG->wwwroot . '/' : $CFG->wwwroot;
$summarydata->moodlerelease = (preg_match('/^(\d+\.\d.*?)[. ]/', $CFG->release, $matches)) ? $matches[1] : $CFG->release;
@@ -488,7 +486,7 @@ class accessibility {
$summarydata->numfactivities = $DB->count_records('course_modules');
$summarydata->mobileservice = (int)$CFG->enablemobilewebservice === 1 ? true : false;
$summarydata->usersmobileregistered = $DB->count_records('user_devices');
$summarydata->contenttyperesults = static::get_contenttyperesults($id, $components);
$summarydata->contenttyperesults = static::get_contenttyperesults($id);
$summarydata->contenttypeerrors = static::get_contenttypeerrors();
$summarydata->percheckerrors = static::get_percheckerrors();
return $summarydata;
@@ -497,22 +495,24 @@ class accessibility {
/**
* Get content type results.
* @param int $id
* @param array $components
* @return \stdClass
*/
private static function get_contenttyperesults(int $id, array $components): \stdClass {
private static function get_contenttyperesults(int $id): \stdClass {
global $DB;
$sql = 'SELECT component, COUNT(id) AS count
FROM {' . manager::DB_AREAS . '}
GROUP BY component';
$components = $DB->get_recordset_sql($sql);
$contenttyperesults = new \stdClass();
$contenttyperesults->id = $id;
$datacomponents = array();
foreach ($components as $component) {
$datacomponents[$component->component][] = $component;
}
$contenttyperesults->contenttype = new \stdClass();
foreach ($datacomponents as $key => $component) {
$contenttyperesults->contenttype->$key = count($component);
foreach ($components as $component) {
$componentname = $component->component;
$contenttyperesults->contenttype->$componentname = $component->count;
}
$components->close();
$contenttyperesults->summarydatastorage = static::get_summary_data_storage();
$contenttyperesults->datachecked = time(); // Correct??
$contenttyperesults->datachecked = time();
return $contenttyperesults;
}
@@ -25,7 +25,7 @@ namespace tool_brickfield\local\htmlchecker\common;
*/
class brickfield_accessibility_color_test extends brickfield_accessibility_test {
/** @var string[] Mapping of colours to hex codes. */
/** @var string[] Define colour codes. */
public $colornames = [
'aliceblue' => 'f0f8ff',
'antiquewhite' => 'faebd7',
@@ -183,6 +183,12 @@ class brickfield_accessibility_color_test extends brickfield_accessibility_test
}
$forergb = $this->get_rgb($foreground);
$backrgb = $this->get_rgb($background);
// If get_rgb returns null for either, return 0.
if ($forergb === null || $backrgb === null) {
return 0;
}
return $this->luminosity($forergb['r'], $backrgb['r'],
$forergb['g'], $backrgb['g'],
$forergb['b'], $backrgb['b']);
@@ -227,15 +233,15 @@ class brickfield_accessibility_color_test extends brickfield_accessibility_test
/**
* Returns the decimal equivalents for a HEX color
* Returns the decimal equivalents for a HEX color. Returns null if it cannot be determined.
* @param string $color The hex color value
* @return array An array where 'r' is the Red value, 'g' is Green, and 'b' is Blue
* @return array|null An array where 'r' is the Red value, 'g' is Green, and 'b' is Blue
*/
public function get_rgb(string $color) {
public function get_rgb(string $color): ?array {
$color = $this->convert_color($color);
$c = str_split($color, 2);
if (count($c) != 3) {
return false;
return null;
}
$results = ['r' => hexdec($c[0]), 'g' => hexdec($c[1]), 'b' => hexdec($c[2])];
return $results;
@@ -307,6 +313,12 @@ class brickfield_accessibility_color_test extends brickfield_accessibility_test
public function get_wai_ert_contrast(string $foreground, string $background): array {
$forergb = $this->get_rgb($foreground);
$backrgb = $this->get_rgb($background);
// If get_rgb returns null for either, return 0.
if ($forergb === null || $backrgb === null) {
return [];
}
$diffs = $this->get_wai_diffs($forergb, $backrgb);
return $diffs['red'] + $diffs['green'] + $diffs['blue'];
@@ -321,12 +333,18 @@ class brickfield_accessibility_color_test extends brickfield_accessibility_test
public function get_wai_ert_brightness(string $foreground, string $background): float {
$forergb = $this->get_rgb($foreground);
$backrgb = $this->get_rgb($background);
// If get_rgb returns null for either, return 0.
if ($forergb === null || $backrgb === null) {
return 0;
}
$color = $this->get_wai_diffs($forergb, $backrgb);
return (($color['red'] * 299) + ($color['green'] * 587) + ($color['blue'] * 114)) / 1000;
}
/**
* Get wai diffs.
* Get the wai differences.
* @param array $forergb
* @param array $backrgb
* @return array
@@ -248,7 +248,7 @@ $string['printable:toolname'] = 'Summary report';
$string['printable:toolshortname'] = 'Summary report';
$string['printable:downloadpdf'] = 'Download PDF';
$string['printable:printreport'] = 'Printable report';
$string['error:nocoursespecified'] = 'This summary report requires a valid course id. Please access the accessibility toolkit from within a course, via the actions menu, which will then supply this required course id.';
$string['error:nocoursespecified'] = 'The summary report requires a valid course ID. Please access the accessibility toolkit from within a course.';
$string['pdf:filename'] = 'Brickfield_Summaryreport_CourseID-{$a}';
// Advanced page.
@@ -15,7 +15,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* tool_brickfield check test.
* Class test_css_text_has_contrast test
*
* @package tool_brickfield
* @copyright 2020 onward: Brickfield Education Labs, https://www.brickfield.ie
@@ -29,14 +29,79 @@ defined('MOODLE_INTERNAL') || die();
require_once('all_checks.php');
/**
* Class test_css_text_has_contrast_testcase
* Class test_css_text_has_contrast_test
*/
class css_text_has_contrast_test extends all_checks {
/** @var string Check type */
/** @var string The check type. */
protected $checktype = 'css_text_has_contrast';
/** @var string Html fail */
private $htmlfail = <<<EOD
/** @var string HTML that should get flagged. */
private $htmlfail1 = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>OAC Testfile - Check #6 - Positive</title>
</head>
<body>
<p style="color:#333333; background-color:#000000; font-weight: bold;">This is not contrasty enough.</p>
</body>
</html>
EOD;
/** @var string HTML that should get flagged. */
private $htmlfail2 = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>OAC Testfile - Check #6 - Positive</title>
</head>
<body>
<p style="color:#333333; background-color:#000000; font-size: 18px;">This is not contrasty enough.</p>
</body>
</html>
EOD;
/** @var string HTML that should get flagged. */
private $htmlfail3 = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>OAC Testfile - Check #6 - Positive</title>
</head>
<body>
<p style="color:#333333; background-color:#000000; font-size: 18%;">This is not contrasty enough.</p>
</body>
</html>
EOD;
/** @var string HTML that should get flagged. */
private $htmlfail4 = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>OAC Testfile - Check #6 - Positive</title>
</head>
<body>
<p style="color:#333333; background-color:#000000; font-size: 18em;">This is not contrasty enough.</p>
</body>
</html>
EOD;
/** @var string HTML that should get flagged. */
private $htmlfail5 = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>OAC Testfile - Check #6 - Positive</title>
</head>
<body>
<p style="color:#333333; background-color:#000000; font-size: 18ex;">This is not contrasty enough.</p>
</body>
</html>
EOD;
/** @var string HTML that should get flagged. */
private $htmlfail6 = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
@@ -48,7 +113,7 @@ class css_text_has_contrast_test extends all_checks {
</html>
EOD;
/** @var string Html pass */
/** @var string HTML that should not get flagged. */
private $htmlpass = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
@@ -61,14 +126,113 @@ EOD;
</html>
EOD;
/** @var string HTML that should get flagged. */
private $namecolours = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>OAC Testfile - Check #6 - Positive</title>
</head>
<body>
<p style="color: red; background-color: blue;">This is not contrasty enough.</p>
</body>
</html>
EOD;
/** @var string HTML with invalid colour names. */
private $invalidcolours = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>OAC Testfile - Check #6 - Positive</title>
</head>
<body>
<p style="color: grog; background-color: numpi;">This is not contrasty enough.</p>
</body>
</html>
EOD;
/** @var string HTML with invalid colour numeric values. */
private $invalidvalue = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>OAC Testfile - Check #6 - Positive</title>
</head>
<body>
<p style="color: 10000500; background-color: -10234;">This is not contrasty enough.</p>
</body>
</html>
EOD;
/** @var string HTML with empty colour values. */
private $emptyvalue = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>OAC Testfile - Check #6 - Positive</title>
</head>
<body>
<p style="color:; background-color:;">This is not contrasty enough.</p>
</body>
</html>
EOD;
/**
* Test for the area assign intro
*/
public function test_check() {
$results = $this->get_checker_results($this->htmlfail);
$results = $this->get_checker_results($this->htmlfail1);
$this->assertTrue($results[0]->element->tagName == 'p');
$results = $this->get_checker_results($this->htmlfail2);
$this->assertTrue($results[0]->element->tagName == 'p');
$results = $this->get_checker_results($this->htmlfail3);
$this->assertTrue($results[0]->element->tagName == 'p');
$results = $this->get_checker_results($this->htmlfail4);
$this->assertTrue($results[0]->element->tagName == 'p');
$results = $this->get_checker_results($this->htmlfail5);
$this->assertTrue($results[0]->element->tagName == 'p');
$results = $this->get_checker_results($this->htmlfail6);
$this->assertTrue($results[0]->element->tagName == 'p');
$results = $this->get_checker_results($this->htmlpass);
$this->assertEmpty($results);
}
/**
* Test with valid colour names.
*/
public function test_check_for_namedcolours() {
$results = $this->get_checker_results($this->namecolours);
$this->assertTrue($results[0]->element->tagName == 'p');
}
/**
* Test with invalid colour names.
*/
public function test_check_for_invalidcolours() {
$results = $this->get_checker_results($this->invalidcolours);
$this->assertTrue($results[0]->element->tagName == 'p');
}
/**
* Test with invalid colour numeric values.
*/
public function test_check_for_invalidvalues() {
$results = $this->get_checker_results($this->invalidvalue);
$this->assertTrue($results[0]->element->tagName == 'p');
}
/**
* Test with empty colour values.
*/
public function test_check_for_emptyvalues() {
$results = $this->get_checker_results($this->emptyvalue);
$this->assertEmpty($results);
}
}
+6
View File
@@ -0,0 +1,6 @@
This files describes API changes in /admin/tool/brickfield/*.
=== 4.0 ===
* classes/local/htmlchecker/common/brickfield_accessibility_color_test::get_rgb() has been modified to return either an
array or null. Previously it returned either an array or false.
+2 -2
View File
@@ -25,5 +25,5 @@
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'tool_brickfield';
$plugin->version = 2021052500;
$plugin->requires = 2021042000;
$plugin->version = 2022041900;
$plugin->requires = 2022041200;
+2 -2
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021052500; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2021052500; // Requires this Moodle version.
$plugin->version = 2022041900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2022041200; // Requires this Moodle version.
$plugin->component = 'tool_capability'; // Full name of the plugin (used for diagnostics).
+3
View File
@@ -44,5 +44,8 @@ function xmldb_tool_cohortroles_upgrade($oldversion) {
// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v4.0.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+2 -2
View File
@@ -25,8 +25,8 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021052500; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2021052500; // Requires this Moodle version.
$plugin->version = 2022041900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2022041200; // Requires this Moodle version.
$plugin->component = 'tool_cohortroles'; // Full name of the plugin (used for diagnostics).
$plugin->dependencies = array(
@@ -45,9 +45,9 @@ To use images use this syntax:
Syntax for markdown (.md) files:
```
{{</* image "wildebeest-1200.jpg" "Image of a Wildebeest" */>}}
{{</* image "wildebeest-1200.jpg" "Image of a Wildebeest" "img-fluid" */>}}
```
Rendered result on this page:
{{< image "wildebeest-1200.jpg" "Image of a Wildebeest">}}
{{< image "wildebeest-1200.jpg" "Image of a Wildebeest" "img-fluid">}}
@@ -13,7 +13,7 @@ weight: 1
</style>
<div class="d-flex">
<div class="w-50 ml-auto mr-auto">
{{< image "logo.png" "The Moodle logo">}}
{{< image "logo.png" "The Moodle logo" "img-fluid">}}
</div>
</div>
@@ -0,0 +1,138 @@
---
layout: docs
title: "Activity icons"
description: "Activity icons are used to quickly identify the activty types"
date: 2020-01-14T16:32:24+01:00
draft: false
weight: 5
toc: true
tags:
- Available
- '4.0'
---
## Activity icon types
Moodle activity icons are single black svg icons that is stored in mod/PLUGINNAME/pix/icon.svg.
### Minimal activity icons
When rendered in a page with limited space the icons will be shown in their original design, for example on the course gradebook where activity show in the grade table header. Note: the icon is using the ```.icon``` css class for sizing.
<div class="d-flex mb-3">
<div class="d-flex border align-items-center p-1">
{{< image "quiz/icon.svg" "Quiz icon" "icon">}} Multiple choice quiz 1
</div>
</div>
### Coloured activity icons
In places like the course page and the activity chooser icons have a more prominent role and they should be rendered on a coloured background in white.
The CSS classes for these icons are ```activityiconcontainer``` wrapper class with the added activity name. And the ```activityicon``` class for the image. See the template ```course/format/templates/local/content/cm/title.mustache``` for more info.
{{< example >}}
<div class="media mb-3">
<div class="activityiconcontainer assessment mr-3">
{{< image "quiz/icon.svg" "Quiz icon" "activityicon">}} </div>
<div class="media-body align-self-center">
<div class="text-uppercase small">quiz</div>
<div class="activityname"><a href="#">Multiple choice quiz 1</a></div>
</div>
</div>
{{< /example >}}
### Activity purposes
In the HTML for the example above you might notice the ```assessment``` css class after ```.activityiconcontainer```. This class is the result of assigning a *purpose* to the quiz activity in ```/mod/quiz/lib.php```.
{{< php >}}
function quiz_supports($feature) {
switch($feature) {
..
case FEATURE_PLAGIARISM: return true;
case FEATURE_MOD_PURPOSE: return MOD_PURPOSE_ASSESSMENT;
..
}
}
{{< /php >}}
The available activity purposes are:
* Administration
* Assessment
* Collaboration
* Communication
* Content
* Interface
* Other
each defined as 'MOD_PURPOSE_X', so Assessment is MOD_PURPOSE_ASSESSMENT.
### Purpose colours
The activity icon colours can be customised using the theme Boost 'Raw initial SCSS' feature. Simply copy this array of scss colours, customise the colours and done! There is no background colour for the 'Other' type purpose, it defaults to ```light-grey: #f8f9fa```.
{{< highlight scss >}}
$activity-icon-colors: (
"administration": #5d63f6,
"assessment": #eb00a2,
"collaboration": #f7634d,
"communication": #11a676,
"content": #399be2,
"interface": #a378ff
);
{{</ highlight >}}
## Examples
<div class="media mb-3">
<div class="activityiconcontainer administration mr-3">
{{< image "quiz/icon.svg" "Admin icon" "activityicon">}} </div>
<div class="media-body align-self-center">
<div class="text-uppercase small">admin</div>
<div class="activityname"><a href="#">Administration module</a></div>
</div>
</div>
<div class="media mb-3">
<div class="activityiconcontainer assessment mr-3">
{{< image "quiz/icon.svg" "Quiz icon" "activityicon">}} </div>
<div class="media-body align-self-center">
<div class="text-uppercase small">quiz</div>
<div class="activityname"><a href="#">Assessment module</a></div>
</div>
</div>
<div class="media mb-3">
<div class="activityiconcontainer collaboration mr-3">
{{< image "wiki/icon.svg" "Wiki icon" "activityicon">}} </div>
<div class="media-body align-self-center">
<div class="text-uppercase small">wiki</div>
<div class="activityname"><a href="#">Collaboration module</a></div>
</div>
</div>
<div class="media mb-3">
<div class="activityiconcontainer collaboration mr-3">
{{< image "choice/icon.svg" "Choice icon" "activityicon">}} </div>
<div class="media-body align-self-center">
<div class="text-uppercase small">choice</div>
<div class="activityname"><a href="#">Learner type</a></div>
</div>
</div>
<div class="media mb-3">
<div class="activityiconcontainer content mr-3">
{{< image "lesson/icon.svg" "Choice icon" "activityicon">}} </div>
<div class="media-body align-self-center">
<div class="text-uppercase small">lesson</div>
<div class="activityname"><a href="#">Content module</a></div>
</div>
</div>
<div class="media mb-3">
<div class="activityiconcontainer interface mr-3">
{{< image "quiz/icon.svg" "Interface icon" "activityicon">}} </div>
<div class="media-body align-self-center">
<div class="text-uppercase small">interface</div>
<div class="activityname"><a href="#">Interface module</a></div>
</div>
</div>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg width="74.4px" height="74.4px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
<svg width="24px" height="24px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 74.4 74.4" style="enable-background:new 0 0 74.4 74.4;" xml:space="preserve" preserveAspectRatio="xMinYMid meet">
<path d="M71.6,6.9L57,0.5c-3.8-1.8-7.7,2.3-6.1,6.1l1.4,3.4c-6.4,2.3-11.5,4.4-15.1,7.6c-3.7-3.2-8.8-5.1-15.1-7.3l1.4-3.7
c1.6-3.8-2.3-7.9-6.1-6.1L2.8,6.9C0.5,8-0.6,10.7,0.4,13.1l6.2,15.1c0.9,2.3,3.6,3.6,5.9,2.7c1.3-0.5,2.2-1.4,2.7-2.7l1.4-3.6

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg width="74.4px" height="74.4px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
<svg width="24px" height="24px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 74.4 74.4" style="enable-background:new 0 0 74.4 74.4;" xml:space="preserve" preserveAspectRatio="xMinYMid meet">
<path d="M68.2,26.6v-5.1l0,0c3.4,0,6.2-2.8,6.2-6.2V7.6c0-3.4-2.8-6.2-6.2-6.2h-7.7c-3.4,0-6.2,2.8-6.2,6.2v1.9H22.9
C22.1,3.2,16.3-0.7,10,0.1C4.2,0.8,0,5.6,0,11.4l0,0c0,6.4,5.2,11.4,11.6,11.4l0,0l0,0c5.3,0,9.8-3.1,11.1-8.1h31.8v0.5

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg width="74.4px" height="74.4px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
<svg width="24px" height="24px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 74.4 74.4" style="enable-background:new 0 0 74.4 74.4;" xml:space="preserve" preserveAspectRatio="xMinYMid meet">
<g>
<path d="M62.1,32.3c-1.7,0-2.6,1.4-2.6,3.1v22.8h-45V13.3h27.8c4.1,0.1,4.1-5.2,0-5.1H12.6c-1.7,0-3.1,1.4-3.1,3.1l0,0

Before

Width:  |  Height:  |  Size: 873 B

After

Width:  |  Height:  |  Size: 869 B

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg width="74.4px" height="74.4px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
<svg width="24px" height="24px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 74.4 74.4" style="enable-background:new 0 0 74.4 74.4;" xml:space="preserve" preserveAspectRatio="xMinYMid meet">
<path d="M74.5,35.8c-0.4-1.8-1.4-3.4-2.8-4.5l0,0L71.3,31c-1-0.5-2-0.9-3.2-0.9c-0.5,0-1.1,0.1-1.5,0.2c-1.8,0.4-3.4,1.4-4.5,2.9
c-0.4,0.5-0.7,0.9-0.9,1.5l-10.7,0.1c-0.2-1.1-0.5-1.9-1.1-2.9c-0.7-1.5-1.4-2.5-2.6-3.6l2.8-5c0.4,0.1,0.7,0.1,1.1,0.1

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

+1 -1
View File
@@ -76,7 +76,7 @@ $PAGE->set_title($title);
$PAGE->requires->css($cssfile);
$jsonfile = new moodle_url('/admin/tool/componentlibrary/hugo/site/data/my-index.json');
$PAGE->requires->js_call_amd('tool_componentlibrary/loader', 'init', ['jsonfile' => $jsonfile->out()]);
$PAGE->has_secondary_navigation_setter(false);
$PAGE->set_secondary_navigation(false);
if (get_config('core', 'allowthemechangeonurl')) {
$themes = core_component::get_plugin_list('theme');
+15
View File
@@ -1088,6 +1088,21 @@
text-decoration: none;
}
.path-admin-tool-componentlibrary #page.drawers {
padding-left: 0;
padding-right: 0;
}
.path-admin-tool-componentlibrary #page.drawers .main-inner {
margin: 0;
padding: 0;
border-radius: 0;
}
.path-admin-tool-componentlibrary #page.drawers div[role="main"] {
padding: 0;
}
.path-admin-tool-componentlibrary #page-header,
.path-admin-tool-componentlibrary #maincontent,
.path-admin-tool-componentlibrary .secondarynavigation {
File diff suppressed because one or more lines are too long
@@ -1,4 +1,16 @@
.path-admin-tool-componentlibrary {
#page.drawers {
padding-left: 0;
padding-right: 0;
.main-inner {
margin: 0;
padding: 0;
border-radius: 0;
}
div[role="main"] {
padding: 0;
}
}
#page-header,
#maincontent,
.secondarynavigation {
@@ -1,2 +1,2 @@
<img src="MOODLEIMAGEDIR{{ .Page.RelPermalink }}{{ .Get 0 }}" class="img-fluid" alt="{{ .Get 1 }}">
<img src="MOODLEIMAGEDIR{{ .Page.RelPermalink }}{{ .Get 0 }}" class="{{ .Get 2 }}" alt="{{ .Get 1 }}">
+2 -2
View File
@@ -21,6 +21,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021052501; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2021052500; // Requires this Moodle version.
$plugin->version = 2022041900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2022041200; // Requires this Moodle version.
$plugin->component = 'tool_componentlibrary';
+3
View File
@@ -41,5 +41,8 @@ function xmldb_tool_customlang_upgrade($oldversion) {
// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v4.0.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+5
View File
@@ -38,6 +38,11 @@ admin_externalpage_setup('toolcustomlang', '', null,
array('pagelayout' => 'report')); // Hack: allows for wide page contents.
$PAGE->requires->js_init_call('M.tool_customlang.init_editor', array(), true);
$PAGE->set_context(context_system::instance());
$PAGE->set_secondary_active_tab('siteadminnode');
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->navbar->add(get_string('editlangpack', 'tool_customlang'), $PAGE->url);
if (empty($lng)) {
// PARAM_LANG validation failed
+6
View File
@@ -38,6 +38,12 @@ $lng = required_param('lng', PARAM_LANG);
admin_externalpage_setup('toolcustomlang', '', null,
new moodle_url('/admin/tool/customlang/import.php', ['lng' => $lng]));
$PAGE->set_context(context_system::instance());
$PAGE->set_secondary_active_tab('siteadminnode');
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->navbar->add(get_string('import', 'tool_customlang'), $PAGE->url);
$output = $PAGE->get_renderer('tool_customlang');
$form = new import(null, ['lng' => $lng]);
+2
View File
@@ -40,6 +40,8 @@ $next = optional_param('next', 'edit', PARAM_ALPHA);
admin_externalpage_setup('toolcustomlang');
$langs = get_string_manager()->get_list_of_translations();
$PAGE->set_primary_active_tab('siteadminnode');
// pre-output actions
if ($action === 'checkout') {
require_sesskey();
@@ -50,6 +50,7 @@ $string['customlang:export'] = 'Export local translation';
$string['customlang:view'] = 'View local translation';
$string['export'] = 'Export custom strings';
$string['exportfilter'] = 'Select component(s) to export';
$string['editlangpack'] = 'Edit language pack';
$string['filter'] = 'Filter strings';
$string['filtercomponent'] = 'Show strings of these components';
$string['filtercustomized'] = 'Customised only';
+15 -2
View File
@@ -36,7 +36,7 @@ class tool_customlang_utils {
* Rough number of strings that are being processed during a full checkout.
* This is used to estimate the progress of the checkout.
*/
const ROUGH_NUMBER_OF_STRINGS = 16500;
const ROUGH_NUMBER_OF_STRINGS = 32000;
/** @var array cache of {@link self::list_components()} results */
private static $components = null;
@@ -91,9 +91,22 @@ class tool_customlang_utils {
public static function checkout($lang, progress_bar $progressbar = null) {
global $DB;
// For behat executions we are going to load only a few components in the
// language customisation structures. Using the whole "en" langpack is
// too much slow (leads to Selenium 30s timeouts, especially on slow
// environments) and we don't really need the whole thing for tests. So,
// apart from escaping from the timeouts, we are also saving some good minutes
// in tests. See MDL-70014 and linked issues for more info.
$behatneeded = ['core', 'core_langconfig', 'tool_customlang'];
// make sure that all components are registered
$current = $DB->get_records('tool_customlang_components', null, 'name', 'name,version,id');
foreach (self::list_components() as $component) {
// Filter out unwanted components when running behat.
if (defined('BEHAT_SITE_RUNNING') && !in_array($component, $behatneeded)) {
continue;
}
if (empty($current[$component])) {
$record = new stdclass();
$record->name = $component;
@@ -103,7 +116,7 @@ class tool_customlang_utils {
$record->version = $version;
}
$DB->insert_record('tool_customlang_components', $record);
} elseif ($version = get_component_version($component)) {
} else if ($version = get_component_version($component)) {
if (is_null($current[$component]->version) or ($version > $current[$component]->version)) {
$DB->set_field('tool_customlang_components', 'version', $version, array('id' => $current[$component]->id));
}
@@ -0,0 +1,21 @@
@tool @tool_customlang @javascript
Feature: Verify the breadcrumbs in language customisation site administration pages
Whenever I navigate to language customisation page in site administration
As an admin
The breadcrumbs should be visible
Background:
Given I log in as "admin"
Scenario: Verify the breadcrumbs in language customisation page by visiting open language pack for editing and import custom strings pages
Given I navigate to "Language > Language customisation" in site administration
And I set the field "lng" to "en"
When I click on "Open language pack for editing" "button"
And I wait until the page is ready
And "Language customisation" "text" should exist in the ".breadcrumb" "css_element"
And "Language" "link" should exist in the ".breadcrumb" "css_element"
And I press the "back" button in the browser
And I click on "Import custom strings" "button"
And I wait until the page is ready
And "Language customisation" "text" should exist in the ".breadcrumb" "css_element"
And "Language" "link" should exist in the ".breadcrumb" "css_element"
+2 -2
View File
@@ -25,6 +25,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021052502;
$plugin->requires = 2021052500;
$plugin->version = 2022041900;
$plugin->requires = 2022041200;
$plugin->component = 'tool_customlang'; // Full name of the plugin (used for diagnostics)
@@ -66,6 +66,8 @@ class page_helper {
$PAGE->set_pagelayout('admin');
$PAGE->set_title($title);
$PAGE->set_heading($SITE->fullname);
$PAGE->set_secondary_active_tab('users');
$PAGE->set_primary_active_tab('siteadminnode');
// If necessary, override the settings navigation to add this page into the breadcrumb navigation.
if ($attachtoparentnode) {
+3
View File
@@ -78,5 +78,8 @@ function xmldb_tool_dataprivacy_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2020061501, 'tool', 'dataprivacy');
}
// Automatically generated Moodle v4.0.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -0,0 +1,29 @@
@core @tool @tool_dataprivacy @javascript
Feature: Verify the breadcrumbs in different privacy site administration pages
Whenever I navigate to data registry page in site administration
As an admin
The breadcrumbs should be visible
Background:
Given I log in as "admin"
Scenario: Verify the breadcrumbs in data registry page as an admin
Given I navigate to "Users > Privacy and policies > Data registry" in site administration
And "Data registry" "text" should exist in the ".breadcrumb" "css_element"
And "Privacy and policies" "link" should exist in the ".breadcrumb" "css_element"
When I click on "Set defaults" "link"
Then "Set defaults" "text" should exist in the ".breadcrumb" "css_element"
And "Data registry" "link" should exist in the ".breadcrumb" "css_element"
And "Privacy and policies" "link" should exist in the ".breadcrumb" "css_element"
And I navigate to "Users > Privacy and policies > Data registry" in site administration
And I click on "Edit" "link"
And I choose "Categories" in the open action menu
And "Edit categories" "text" should exist in the ".breadcrumb" "css_element"
And "Data registry" "link" should exist in the ".breadcrumb" "css_element"
And "Privacy and policies" "link" should exist in the ".breadcrumb" "css_element"
And I click on "Back" "link"
And I click on "Edit" "link"
And I choose "Purposes" in the open action menu
And "Edit purposes" "text" should exist in the ".breadcrumb" "css_element"
And "Data registry" "link" should exist in the ".breadcrumb" "css_element"
And "Privacy and policies" "link" should exist in the ".breadcrumb" "css_element"
@@ -14,19 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Tests for scheduled tasks.
*
* @package tool_dataprivacy
* @copyright 2018 Mihail Geshoski <mihail@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once('data_privacy_testcase.php');
namespace tool_dataprivacy\task;
use tool_dataprivacy\api;
defined('MOODLE_INTERNAL') || die();
require_once(__DIR__ . '/../data_privacy_testcase.php');
/**
* Tests for scheduled tasks.
*
@@ -34,7 +28,7 @@ use tool_dataprivacy\api;
* @copyright 2018 Mihail Geshoski <mihail@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_dataprivacy_task_testcase extends data_privacy_testcase {
class task_test extends \data_privacy_testcase {
/**
* Test tearDown.
+2 -2
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die;
$plugin->version = 2021052500;
$plugin->requires = 2021052500;
$plugin->version = 2022041900;
$plugin->requires = 2022041200;
$plugin->component = 'tool_dataprivacy';
+2 -2
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021052500; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2021052500; // Requires this Moodle version.
$plugin->version = 2022041900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2022041200; // Requires this Moodle version.
$plugin->component = 'tool_dbtransfer'; // Full name of the plugin (used for diagnostics).
+2
View File
@@ -47,6 +47,8 @@ $PAGE->navbar->add($title);
$PAGE->set_context($context);
$PAGE->set_pagelayout('admin');
$PAGE->set_title($SITE->fullname. ': ' . $title);
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->set_secondary_active_tab('server');
// Display the page.
echo $OUTPUT->header();
+4
View File
@@ -100,6 +100,10 @@ if ($mform->is_cancelled()) {
// Page settings.
$context = context_system::instance();
$PAGE->set_url(new \moodle_url('/admin/tool/filetypes/edit.php', array('oldextension' => $oldextension)));
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->set_secondary_active_tab('server');
$PAGE->navbar->add($oldextension ? s($oldextension) : $title);
$PAGE->set_context($context);
$PAGE->set_pagelayout('admin');
@@ -0,0 +1,19 @@
@tool @tool_filetypes @javascript
Feature: Verify the breadcrumbs in server filetypes site administration pages
Whenever I navigate to file types page in site administration
As an admin
The breadcrumbs should be visible
Background:
Given I log in as "admin"
@tool @tool_filetypes
Scenario: Verify the breadcrumbs in file types page by visiting edit page and delete page of a file type as an admin
Given I navigate to "Server > File types" in site administration
And I click on "Edit 3gp" "link"
And "3gp" "text" should exist in the ".breadcrumb" "css_element"
And "File types" "link" should exist in the ".breadcrumb" "css_element"
And I press "Cancel"
When I click on "Delete 3gp" "link"
Then "Delete a file type" "text" should exist in the ".breadcrumb" "css_element"
And "File types" "link" should exist in the ".breadcrumb" "css_element"
+2 -2
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021052500;
$plugin->requires = 2021052500;
$plugin->version = 2022041900;
$plugin->requires = 2022041200;
$plugin->component = 'tool_filetypes';
+2 -2
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021052500;
$plugin->requires = 2021052500;
$plugin->version = 2022041900;
$plugin->requires = 2022041200;
$plugin->component = 'tool_generator';
+2 -2
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021052500; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2021052500; // Requires this Moodle version.
$plugin->version = 2022041900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2022041200; // Requires this Moodle version.
$plugin->component = 'tool_httpsreplace'; // Full name of the plugin (used for diagnostics).
+2 -2
View File
@@ -25,6 +25,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021052500; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2021052500; // Requires this Moodle version.
$plugin->version = 2022041900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2022041200; // Requires this Moodle version.
$plugin->component = 'tool_innodb'; // Full name of the plugin (used for diagnostics)
+2 -2
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'tool_installaddon';
$plugin->version = 2021052500;
$plugin->requires = 2021052500;
$plugin->version = 2022041900;
$plugin->requires = 2022041200;
$plugin->maturity = MATURITY_STABLE;
+2
View File
@@ -112,6 +112,8 @@ if ($mode == UPDATE_ALL_LANG) {
}
get_string_manager()->reset_caches();
$PAGE->set_primary_active_tab('siteadminnode');
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('langimport', 'tool_langimport'));
+2 -2
View File
@@ -25,6 +25,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021052500; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2021052500; // Requires this Moodle version.
$plugin->version = 2022041900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2022041200; // Requires this Moodle version.
$plugin->component = 'tool_langimport'; // Full name of the plugin (used for diagnostics)
+2 -2
View File
@@ -24,8 +24,8 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021052500;
$plugin->requires = 2021052500; // Requires this Moodle version.
$plugin->version = 2022041900;
$plugin->requires = 2022041200; // Requires this Moodle version.
$plugin->component = 'tool_licensemanager';
$plugin->maturity = MATURITY_STABLE;
+3
View File
@@ -45,5 +45,8 @@ function xmldb_tool_log_upgrade($oldversion) {
// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v4.0.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -46,5 +46,8 @@ function xmldb_logstore_database_upgrade($oldversion) {
// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v4.0.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -14,6 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace logstore_database;
defined('MOODLE_INTERNAL') || die();
require_once(__DIR__ . '/fixtures/event.php');
require_once(__DIR__ . '/fixtures/store.php');
/**
* External database log store tests.
*
@@ -21,13 +28,7 @@
* @copyright 2014 Petr Skoda {@link http://skodak.org/}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once(__DIR__ . '/fixtures/event.php');
require_once(__DIR__ . '/fixtures/store.php');
class logstore_database_store_testcase extends advanced_testcase {
class store_test extends \advanced_testcase {
/**
* Tests log writing.
*
@@ -120,7 +121,7 @@ class logstore_database_store_testcase extends advanced_testcase {
$this->setUser(0);
$event1 = \logstore_database\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)));
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)));
$event1->trigger();
$logs = $DB->get_records('logstore_standard_log', array(), 'id ASC');
@@ -141,11 +142,11 @@ class logstore_database_store_testcase extends advanced_testcase {
$this->assertEquals($data, $log1);
$this->setAdminUser();
\core\session\manager::loginas($user1->id, context_system::instance());
\core\session\manager::loginas($user1->id, \context_system::instance());
$this->assertEquals(2, $DB->count_records('logstore_standard_log'));
$event2 = \logstore_database\event\unittest_executed::create(
array('context' => context_module::instance($module2->cmid), 'other' => array('sample' => 6, 'xx' => 9)));
array('context' => \context_module::instance($module2->cmid), 'other' => array('sample' => 6, 'xx' => 9)));
$event2->trigger();
\core\session\manager::init_empty_session();
@@ -190,30 +191,30 @@ class logstore_database_store_testcase extends advanced_testcase {
$DB->delete_records('logstore_standard_log');
\logstore_database\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(0, $DB->count_records('logstore_standard_log'));
\logstore_database\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(0, $DB->count_records('logstore_standard_log'));
$store->flush();
$this->assertEquals(2, $DB->count_records('logstore_standard_log'));
\logstore_database\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(2, $DB->count_records('logstore_standard_log'));
\logstore_database\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(2, $DB->count_records('logstore_standard_log'));
\logstore_database\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(5, $DB->count_records('logstore_standard_log'));
\logstore_database\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(5, $DB->count_records('logstore_standard_log'));
\logstore_database\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(5, $DB->count_records('logstore_standard_log'));
\logstore_database\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(8, $DB->count_records('logstore_standard_log'));
// Test guest logging setting.
@@ -225,22 +226,22 @@ class logstore_database_store_testcase extends advanced_testcase {
$this->setUser(null);
\logstore_database\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(0, $DB->count_records('logstore_standard_log'));
$this->setGuestUser();
\logstore_database\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(0, $DB->count_records('logstore_standard_log'));
$this->setUser($user1);
\logstore_database\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(1, $DB->count_records('logstore_standard_log'));
$this->setUser($user2);
\logstore_database\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(2, $DB->count_records('logstore_standard_log'));
set_config('enabled_stores', '', 'tool_log');
@@ -270,7 +271,7 @@ class logstore_database_store_testcase extends advanced_testcase {
set_config('logguests', 0, 'logstore_database');
$this->setGuestUser();
$event = \logstore_database\event\unittest_executed::create(
array('context' => context_system::instance(), 'other' => array('sample' => 5, 'xx' => 10)));
array('context' => \context_system::instance(), 'other' => array('sample' => 5, 'xx' => 10)));
$logmanager = get_log_manager();
$store = new \logstore_database\test\store($logmanager);
$this->assertTrue($store->is_event_ignored($event));
+2 -2
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021052500; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2021052500; // Requires this Moodle version.
$plugin->version = 2022041900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2022041200; // Requires this Moodle version.
$plugin->component = 'logstore_database'; // Full name of the plugin (used for diagnostics).
@@ -14,6 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace logstore_legacy;
defined('MOODLE_INTERNAL') || die();
require_once(__DIR__ . '/fixtures/event.php');
require_once(__DIR__ . '/fixtures/store.php');
/**
* Legacy log store tests.
*
@@ -21,13 +28,7 @@
* @copyright 2014 Petr Skoda {@link http://skodak.org/}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once(__DIR__ . '/fixtures/event.php');
require_once(__DIR__ . '/fixtures/store.php');
class logstore_legacy_store_testcase extends advanced_testcase {
class store_test extends \advanced_testcase {
public function test_log_writing() {
global $DB;
$this->resetAfterTest();
@@ -58,12 +59,12 @@ class logstore_legacy_store_testcase extends advanced_testcase {
$this->setUser(0);
$event1 = \logstore_legacy\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)));
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)));
$event1->trigger();
$this->setUser($user1);
$event2 = \logstore_legacy\event\unittest_executed::create(
array('context' => context_course::instance($course2->id), 'other' => array('sample' => 6, 'xx' => 11)));
array('context' => \context_course::instance($course2->id), 'other' => array('sample' => 6, 'xx' => 11)));
$event2->trigger();
$logs = $DB->get_records('log', array(), 'id ASC');
+2 -2
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021052500; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2021052500; // Requires this Moodle version.
$plugin->version = 2022041900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2022041200; // Requires this Moodle version.
$plugin->component = 'logstore_legacy'; // Full name of the plugin (used for diagnostics).
@@ -46,5 +46,8 @@ function xmldb_logstore_standard_upgrade($oldversion) {
// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v4.0.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -14,6 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace logstore_standard;
defined('MOODLE_INTERNAL') || die();
require_once(__DIR__ . '/fixtures/event.php');
require_once(__DIR__ . '/fixtures/restore_hack.php');
/**
* Standard log store tests.
*
@@ -21,13 +28,7 @@
* @copyright 2014 Petr Skoda {@link http://skodak.org/}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once(__DIR__ . '/fixtures/event.php');
require_once(__DIR__ . '/fixtures/restore_hack.php');
class logstore_standard_store_testcase extends advanced_testcase {
class store_test extends \advanced_testcase {
/**
* @var bool Determine if we disabled the GC, so it can be re-enabled in tearDown.
*/
@@ -84,7 +85,7 @@ class logstore_standard_store_testcase extends advanced_testcase {
$this->setUser(0);
$event1 = \logstore_standard\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)));
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)));
$event1->trigger();
$logs = $DB->get_records('logstore_standard_log', array(), 'id ASC');
@@ -105,14 +106,14 @@ class logstore_standard_store_testcase extends advanced_testcase {
$this->assertEquals($data, $log1);
$this->setAdminUser();
\core\session\manager::loginas($user1->id, context_system::instance());
\core\session\manager::loginas($user1->id, \context_system::instance());
$this->assertEquals(2, $DB->count_records('logstore_standard_log'));
logstore_standard_restore::hack_executing(1);
\logstore_standard_restore::hack_executing(1);
$event2 = \logstore_standard\event\unittest_executed::create(
array('context' => context_module::instance($module2->cmid), 'other' => array('sample' => 6, 'xx' => 9)));
array('context' => \context_module::instance($module2->cmid), 'other' => array('sample' => 6, 'xx' => 9)));
$event2->trigger();
logstore_standard_restore::hack_executing(0);
\logstore_standard_restore::hack_executing(0);
\core\session\manager::init_empty_session();
$this->assertFalse(\core\session\manager::is_loggedinas());
@@ -161,30 +162,30 @@ class logstore_standard_store_testcase extends advanced_testcase {
$DB->delete_records('logstore_standard_log');
\logstore_standard\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(0, $DB->count_records('logstore_standard_log'));
\logstore_standard\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(0, $DB->count_records('logstore_standard_log'));
$store->flush();
$this->assertEquals(2, $DB->count_records('logstore_standard_log'));
\logstore_standard\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(2, $DB->count_records('logstore_standard_log'));
\logstore_standard\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(2, $DB->count_records('logstore_standard_log'));
\logstore_standard\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(5, $DB->count_records('logstore_standard_log'));
\logstore_standard\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(5, $DB->count_records('logstore_standard_log'));
\logstore_standard\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(5, $DB->count_records('logstore_standard_log'));
\logstore_standard\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(8, $DB->count_records('logstore_standard_log'));
// Test guest logging setting.
@@ -196,22 +197,22 @@ class logstore_standard_store_testcase extends advanced_testcase {
$this->setUser(null);
\logstore_standard\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(0, $DB->count_records('logstore_standard_log'));
$this->setGuestUser();
\logstore_standard\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(0, $DB->count_records('logstore_standard_log'));
$this->setUser($user1);
\logstore_standard\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(1, $DB->count_records('logstore_standard_log'));
$this->setUser($user2);
\logstore_standard\event\unittest_executed::create(
array('context' => context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
array('context' => \context_module::instance($module1->cmid), 'other' => array('sample' => 5, 'xx' => 10)))->trigger();
$this->assertEquals(2, $DB->count_records('logstore_standard_log'));
set_config('enabled_stores', '', 'tool_log');
@@ -335,7 +336,7 @@ class logstore_standard_store_testcase extends advanced_testcase {
$this->resetAfterTest();
// Create some records spread over various days; test multiple iterations in cleanup.
$ctx = context_course::instance(1);
$ctx = \context_course::instance(1);
$record = (object) array(
'edulevel' => 0,
'contextid' => $ctx->id,
@@ -424,11 +425,11 @@ class logstore_standard_store_testcase extends advanced_testcase {
// Create some log data in a course - one with other data, one without.
\logstore_standard\event\unittest_executed::create([
'context' => context_course::instance($course->id),
'context' => \context_course::instance($course->id),
'other' => ['sample' => 5, 'xx' => 10]])->trigger();
$this->waitForSecond();
\logstore_standard\event\unittest_executed::create([
'context' => context_course::instance($course->id)])->trigger();
'context' => \context_course::instance($course->id)])->trigger();
$records = array_values($DB->get_records('logstore_standard_log',
['courseid' => $course->id, 'target' => 'unittest'], 'timecreated'));
@@ -473,7 +474,7 @@ class logstore_standard_store_testcase extends advanced_testcase {
/**
* Backs a course up to temp directory.
*
* @param stdClass $course Course object to backup
* @param \stdClass $course Course object to backup
* @return string ID of backup
*/
protected function backup($course): string {
@@ -481,14 +482,14 @@ class logstore_standard_store_testcase extends advanced_testcase {
require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
// Turn off file logging, otherwise it can't delete the file (Windows).
$CFG->backup_file_logger_level = backup::LOG_NONE;
$CFG->backup_file_logger_level = \backup::LOG_NONE;
// Do backup with default settings. MODE_IMPORT means it will just
// create the directory and not zip it.
$bc = new backup_controller(backup::TYPE_1COURSE, $course->id,
backup::FORMAT_MOODLE, backup::INTERACTIVE_NO, backup::MODE_IMPORT,
$bc = new \backup_controller(\backup::TYPE_1COURSE, $course->id,
\backup::FORMAT_MOODLE, \backup::INTERACTIVE_NO, \backup::MODE_IMPORT,
$USER->id);
$bc->get_plan()->get_setting('users')->set_status(backup_setting::NOT_LOCKED);
$bc->get_plan()->get_setting('users')->set_status(\backup_setting::NOT_LOCKED);
$bc->get_plan()->get_setting('users')->set_value(true);
$bc->get_plan()->get_setting('logs')->set_value(true);
$backupid = $bc->get_backupid();
@@ -505,18 +506,18 @@ class logstore_standard_store_testcase extends advanced_testcase {
* @param \stdClass $course Original course object
* @param string $suffix Suffix to add after original course shortname and fullname
* @return int New course id
* @throws restore_controller_exception
* @throws \restore_controller_exception
*/
protected function restore(string $backupid, $course, string $suffix): int {
global $USER, $CFG;
require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
// Do restore to new course with default settings.
$newcourseid = restore_dbops::create_new_course(
$newcourseid = \restore_dbops::create_new_course(
$course->fullname . $suffix, $course->shortname . $suffix, $course->category);
$rc = new restore_controller($backupid, $newcourseid,
backup::INTERACTIVE_NO, backup::MODE_GENERAL, $USER->id,
backup::TARGET_NEW_COURSE);
$rc = new \restore_controller($backupid, $newcourseid,
\backup::INTERACTIVE_NO, \backup::MODE_GENERAL, $USER->id,
\backup::TARGET_NEW_COURSE);
$rc->get_plan()->get_setting('logs')->set_value(true);
$rc->get_plan()->get_setting('users')->set_value(true);
+2 -2
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021052500; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2021052500; // Requires this Moodle version.
$plugin->version = 2022041900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2022041200; // Requires this Moodle version.
$plugin->component = 'logstore_standard'; // Full name of the plugin (used for diagnostics).
+2 -2
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021052500; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2021052500; // Requires this Moodle version.
$plugin->version = 2022041900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2022041200; // Requires this Moodle version.
$plugin->component = 'tool_log'; // Full name of the plugin (used for diagnostics).
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -6,6 +6,6 @@
* @copyright 2015 Damyon Wiese <damyon@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_lp/dialogue",["core/yui"],(function(Y){var dialogue=function(title,content,afterShow,afterHide,wide){M.util.js_pending("tool_lp/dialogue:dialogue"),this.yuiDialogue=null;var parent=this;void 0===wide&&(wide=!1),Y.use("moodle-core-notification","timers",(function(){var width="480px";wide&&(width="800px"),parent.yuiDialogue=new M.core.dialogue({headerContent:title,bodyContent:content,draggable:!0,visible:!1,center:!0,modal:!0,width:width}),parent.yuiDialogue.before("visibleChange",(function(){M.util.js_pending("tool_lp/dialogue:before:visibleChange")})),parent.yuiDialogue.after("visibleChange",(function(e){e.newVal?void 0!==afterShow?Y.soon((function(){afterShow(parent),parent.yuiDialogue.centerDialogue(),M.util.js_complete("tool_lp/dialogue:before:visibleChange")})):M.util.js_complete("tool_lp/dialogue:before:visibleChange"):void 0!==afterHide?Y.soon((function(){afterHide(parent),M.util.js_complete("tool_lp/dialogue:before:visibleChange")})):M.util.js_complete("tool_lp/dialogue:before:visibleChange")})),parent.yuiDialogue.show(),M.util.js_complete("tool_lp/dialogue:dialogue")}))};return dialogue.prototype.close=function(){this.yuiDialogue.hide(),this.yuiDialogue.destroy()},dialogue.prototype.getContent=function(){return this.yuiDialogue.bodyNode.getDOMNode()},dialogue}));
define("tool_lp/dialogue",["core/yui"],(function(Y){var dialogue=function(title,content,afterShow,afterHide,wide,height){M.util.js_pending("tool_lp/dialogue:dialogue"),this.yuiDialogue=null;var parent=this;void 0===wide&&(wide=!1),Y.use("moodle-core-notification","timers",(function(){var width="480px";wide&&(width="800px"),height||(height="auto"),parent.yuiDialogue=new M.core.dialogue({headerContent:title,bodyContent:content,draggable:!0,visible:!1,center:!0,modal:!0,width:width,height:height}),parent.yuiDialogue.before("visibleChange",(function(){M.util.js_pending("tool_lp/dialogue:before:visibleChange")})),parent.yuiDialogue.after("visibleChange",(function(e){e.newVal?void 0!==afterShow?Y.soon((function(){afterShow(parent),parent.yuiDialogue.centerDialogue(),M.util.js_complete("tool_lp/dialogue:before:visibleChange")})):M.util.js_complete("tool_lp/dialogue:before:visibleChange"):void 0!==afterHide?Y.soon((function(){afterHide(parent),M.util.js_complete("tool_lp/dialogue:before:visibleChange")})):M.util.js_complete("tool_lp/dialogue:before:visibleChange")})),parent.yuiDialogue.show(),M.util.js_complete("tool_lp/dialogue:dialogue")}))};return dialogue.prototype.close=function(){this.yuiDialogue.hide(),this.yuiDialogue.destroy()},dialogue.prototype.getContent=function(){return this.yuiDialogue.bodyNode.getDOMNode()},dialogue}));
//# sourceMappingURL=dialogue.min.js.map

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