3211 Commits

Author SHA1 Message Date
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
7066c7618c MDL-74216 navigation: Do not show 'My courses' in primary nav to guests 2022-03-16 18:16:58 +08:00
Ilya Tregubov
a5ef320720 Merge branch 'MDL-74071' of https://github.com/paulholden/moodle 2022-03-16 13:57:59 +06:00
Jun Pataleta
8c07f33d80 Merge branch 'MDL-72481-master' of https://github.com/rezaies/moodle 2022-03-16 11:45:40 +08: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
Víctor Déniz
e95d99ebf1 Merge branch 'MDL-74030' of https://github.com/roland04/moodle 2022-03-14 21:39:40 +00: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
Ilya Tregubov
441ed4c180 Merge branch 'MDL-67428-filter-context' of https://github.com/Peterburnett/moodle 2022-03-10 09:04:05 +06: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
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
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
Paul Holden
7f3d270a37 MDL-74071 output: code docs for activity header API to aid IDE hints. 2022-03-03 09:59:57 +00:00
Jun Pataleta
0f35a9b7f9 Merge branch 'MDL-72737-master-2' of https://github.com/bmbrands/moodle 2022-03-01 19:06:52 +08:00
Bas Brands
2faf5e8e48 MDL-72737 theme_boost: update for section header styles 2022-03-01 12:01:59 +01:00
Ilya Tregubov
127655326e Merge branch 'MDL-73978-master' of https://github.com/peterRd/moodle 2022-02-28 09:18:27 +02:00
Andrew Nicols
641240ce63 Merge branch 'MDL-72837-master' of https://github.com/sammarshallou/moodle 2022-02-25 10:59:54 +08:00
sam marshall
02bb326314 MDL-72837 core_cache: Use versioned cache for modinfo
Uses the new versioned cache feature for modinfo, which should make it
safe as a localisable cache.
2022-02-24 13:51:07 +00:00
sam marshall
691c5b8326 MDL-72837 core_cache: Rename unit test classes to new standard
For the three unit tests that are going to be modified in future
commit, I first changed them to use a namespace and class name
matching filename, as per current standard.
2022-02-23 16:36:40 +00:00
Mihail Geshoski
f0dffddaac MDL-73355 navigation: Add new methods in navigation_node
Adds new methods is_action_link() and action_link_actions() in the
navigation_node class. The is_action_link() method can be used to
check whether the node's action is of type action_link. The
action_link_actions() method returns the formatted data required
for the core/actions template if the navigation node has an action
link.
2022-02-23 21:44:08 +08:00
Peter Dias
109c5f70a1 MDL-73978 navigation: Update the scoping when adding nodes
Make sure to use the rootnode variable that is being passed specifically for single activity course formats
2022-02-23 13:35:52 +08:00
Ilya Tregubov
4f4bb7303a Merge branch 'MDL-73273-master' of https://github.com/peterRd/moodle 2022-02-21 11:15:33 +02:00
Peter Dias
4071bf3fb2 fixup! MDL-73273 navigation: Add checks to enforce action param types 2022-02-18 09:11:57 +08:00
Ilya Tregubov
dfa0681c53 Merge branch 'MDL-69764-master' of https://github.com/jpahullo/moodle 2022-02-17 15:02:01 +02:00
Jordi Pujol Ahulló
21f73b29c1 MDL-69764 tool_task: unify crontab verification
Use scheduled_task crontab field verification in
admin/tool/task to unify how Moodle deals with
crontab definition and its verification.
This helps remove duplicated code and fix
crontab definition not allowed in the web form,
but actually was valid.

Updated crontab fields precision on task_scheduled
table to have enough room for the worst case:
all possible different values separated by comma.
2022-02-17 13:24:31 +01:00
Jun Pataleta
6b65550240 Merge branch 'MDL-73373-master' of https://github.com/peterRd/moodle 2022-02-16 21:14:26 +08:00
Peter Dias
bdf4f8a651 MDL-73273 navigation: Add checks to enforce action param types
* Added checks in navigationlib to enforce the data type of the passed in action
* Add nodes with non moodleurls to the end of the secondary nav
2022-02-15 11:30:07 +08:00
Mihail Geshoski
bf27303955 MDL-73532 navigation: Update unit tests
Updates the existing unit tests related to the secondary navigation
class and includes cases where the given course uses single activity
format.
2022-02-14 09:35:04 +08:00
Eloy Lafuente (stronk7)
83497580cb Merge branch 'MDL-73669-master' of https://github.com/marinaglancy/moodle 2022-02-10 16:39:06 +01:00
Shamim Rezaie
e30493108d Merge branch 'MDL-73722' of https://github.com/paulholden/moodle 2022-02-10 17:21:10 +11:00
Ilya Tregubov
7e34d42298 Merge branch 'MDL-73773' of https://github.com/paulholden/moodle 2022-02-09 13:28:43 +02:00
Andrew Nicols
5d66721655 MDL-73183 js: Stop supporting debug mode for amd
This option was used to return the source files, but we do not support
this any more because we use source maps instead and require babel
transformation to support ES2015.

It does not make sense to support this code path any longer.
2022-02-08 12:05:31 +08:00
Jun Pataleta
939cb7a90f Merge branch 'MDL-72246-master-2' of https://github.com/andrewnicols/moodle 2022-02-08 11:36:59 +08:00
Andrew Nicols
70cc41eec8 MDL-72246 core_completion: Only fetch other completion data on requested
Prior to this patch, the code was fetching all completion data for all
activities in a course, even when the activity was not requested. This
leads to recursion issues as the data has not been added to the cache
before this operation occurs.

To handle this situation, only the requested CM is fetched in full, and
a boolean flag is used to store whether the full data has been fetched.

When returning a partially fetched value from the cache, the flag is
used to determine whether more data must be fetched, and the cache
updated.

The flag is filtered out before the value is returned.

Note: Many of the tests were updated as these were inspecting private
features of the API which should not really be tested.
2022-02-08 11:35:23 +08:00
Andrew Nicols
adc61dddc3 MDL-72246 core_completion: Test coverage improvements for completion 2022-02-08 11:22:14 +08:00
Andrew Nicols
a999b12e02 MDL-72246 core_completion: Stop testing the inner workings of get_data() 2022-02-08 11:22:14 +08:00
Peter Dias
81492f900f MDL-73373 roles: Enable tertiary navigation in module context 2022-02-08 09:04:04 +08:00
Eloy Lafuente (stronk7)
43280530b6 MDL-73716 phpunit: remove old simpletest static members
And replace them by phpunit @covers annotations including
all the classes declared or extended in the removed members.

It's not awesome coverage, but better than nothing.
2022-02-07 10:42:17 +01:00
Paul Holden
b8f9f6635c MDL-73669 behat: correctly deprecate step for using flat navigation. 2022-02-04 17:18:43 +01:00
Marina Glancy
15eb402228 MDL-73669 core_enrol: move deprecated behat steps to own file
Steps were initially deprecated in MDL-72090
2022-02-04 17:17:08 +01:00
Marina Glancy
c5c33d8eba MDL-73669 core_calendar: move deprecated behat steps to own file
Steps were initially deprecated in  MDL-72810
2022-02-04 17:17:08 +01:00
Marina Glancy
31751c2f32 MDL-73669 behat: allow multiple files with deprecated steps 2022-02-04 17:17:08 +01:00
Paul Holden
2e8a9623e5 MDL-73773 behat: correctly deprecate step for using flat navigation. 2022-02-04 11:59:36 +00:00
Sara Arjona
b841a811be Merge branch 'master_MDL-71696-versioning-integration' of https://github.com/catalyst/moodle-MDL-70329 2022-02-03 13:25:27 +01:00
Safat Shahin
3008edd366 MDL-71696 core_question: Implement question status change
This commit implements the status change pop up for a question
in the base view. This feature update will allow the change of
status of a question without creating a new version.
This commit also implements the status as a char rather than
an int value.
2022-02-03 22:22:50 +11:00
Safat Shahin
111951d861 MDL-71696 mod_quiz: quiz updates and behat coverage
The versioning changes will require some major changes
in the backup and restore of question bank and its
elements. This change introduces those changes to make
it compatible with the new world of versioning in question
bank. This commit also removes quiz_slots fields and
quiz_slot_tags table.
This commit will also introduce the versioning db
structure and some major changes to the quiz
and quiz attempts for the question, random
question and the view.
This commit implements the behat changes for versioning
in core question and associated locations.
2022-02-03 22:22:44 +11:00
Guillermo Gomez
c6cfca2a08 MDL-71696 core_question: Changes for versioning
This commit adds the changes in questiontype base
to work with new question tables and the new structure in the
databse. Also needed for versioning.
This implementation will also introduct the question status
which allows a question to be in draft and ready status.
I also introduces changes to the base view where it shows
the latest version of the questions. The view of versions
for a question is not implemented in this commit.
This implementation will also introduce changes in the core
qtype plugins to support versioning and the changed
db schema.
2022-02-03 22:22:44 +11:00
Amaia Anabitarte
2cd5c61049 MDL-73310 course: Add course index to all non-site course pages 2022-02-02 09:22:42 +01:00
Marina Glancy
5ddae1a189 MDL-73722 course: behat test for other users page 2022-02-01 12:23:05 +00:00