Commit graph

28528 commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
23f09c8c1a MDL-71036 phpunit: Fix param check, must be array
With stricter typed param checks in php73, the 7th param of the
getMockForAbstractClass() must be array, so previous code defaulting
to null now throws a TypeError.
2021-03-11 23:07:30 +01:00
Eloy Lafuente (stronk7)
3b37f318d4 MDL-71036 phpunit: Deprecated expectException for notice/warning/error
In PHP 9.1, the use of expectException(PHPUnit\Framework\Error\*) has
been deprecated, that is, when a Notice/Warning/Error/Deprecated
problem is reported. Instead, these new assertions must be used:

- expectDeprecation() for E_DEPRECATED and E_USER_DEPRECATED
- expectNotice() for E_NOTICE, E_USER_NOTICE, and E_STRICT
- expectWarning() for E_WARNING and E_USER_WARNING
- expectError() for everything else

More info:

https://github.com/sebastianbergmann/phpunit/blob/9.0.0/ChangeLog-9.0.md
https://github.com/sebastianbergmann/phpunit/issues/3775

Regexp to find all them:

ag 'expectException.*(Notice|Warning|Error|Deprecated)
2021-03-11 23:07:30 +01:00
Eloy Lafuente (stronk7)
c989d6ec61 MDL-71036 phpunit: Renamed various regexp-related assertions
In PHPUnit 9.1, the following regexp-related assertions
have been deprecated and there are new alternatives for
all them:
    - assertRegExp()     -> assertMatchesRegularExpression()
    - assertNotRegExp()  -> assertDoesNotMatchRegularExpression()

This is about to, simply, move all cases to the new alternatives.

Source: https://github.com/sebastianbergmann/phpunit/blob/9.1.0/ChangeLog-9.1.md

Regexp to find all them:

    ag 'assertRegExp|assertNotRegExp' -li
2021-03-11 23:07:30 +01:00
Eloy Lafuente (stronk7)
cbf01aa79a MDL-71036 phpunit: Renamed various file-related assertions
In PHPUnit 9.1, the following file-related assertions
have been deprecated and there are new alternatives for
all them:
- assertNotIsReadable()         -> assertIsNotReadable()
- assertNotIsWritable()         -> assertIsNotWritable()
- assertDirectoryNotExists()    -> assertDirectoryDoesNotExist()
- assertDirectoryNotIsReadable()-> assertDirectoryIsNotReadable()
- assertDirectoryNotIsWritable()-> assertDirectoryIsNotWritable()
- assertFileNotExists()         -> assertFileDoesNotExist()
- assertFileNotIsReadable()     -> assertFileIsNotReadable()
- assertFileNotIsWritable()     -> assertFileIsNotWritable()

This is about to, simply, move all cases to the new alternatives.

Source: https://github.com/sebastianbergmann/phpunit/blob/9.1.0/ChangeLog-9.1.md

Regexp to find all them:

ag 'assertNotIsReadable|assertNotIsWritable|assertDirectoryNotExists|\
assertDirectoryNotIsReadable|assertDirectoryNotIsWritable|\
assertFileNotExists|assertFileNotIsReadable|assertFileNotIsWritable'
2021-03-11 23:07:30 +01:00
Eloy Lafuente (stronk7)
87680e8b2b MDL-71036 phpunit: Stricter signature matching 2021-03-11 23:07:30 +01:00
hiendinh
c06b63113a MDL-69474 Accessibility: Profile image changes 2021-03-11 16:42:05 +07:00
Eloy Lafuente (stronk7)
bb4d5dbc25 Merge branch 'MDL-70726-3.11' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_311_STABLE 2021-03-11 00:11:44 +01:00
Eloy Lafuente (stronk7)
3841ce68cf Merge branch 'MDL-70891-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-03-10 23:40:07 +01:00
Jun Pataleta
ad583bba25 MDL-70815 completion: Cast custom data to array
Since cm_info::customdata can be of any type, we need to cast it to an
array first before checking for custom completion rules. Otherwise,
an exception can be thrown (e.g. customdata has been set as an stdClass)
2021-03-10 19:23:04 +01:00
Jun Pataleta
b535cf958a Merge branch 'MDL-45242-m311' of https://github.com/sammarshallou/moodle into MOODLE_311_STABLE 2021-03-10 23:38:42 +08:00
sam marshall
3cc4d3d2e2 MDL-45242 Course: Enrol feature supports custom profile fields 2021-03-10 10:58:09 +00:00
sam marshall
1d7d3c984d MDL-45242 Admin: User list supports custom profile fields 2021-03-10 10:58:09 +00:00
sam marshall
0919a04311 MDL-45242 Lib: Replace calls to deprecated functions
In all cases changes have been kept to a minimum while not making
the code completely horrible. For example, there are many instances
where it would probably be better to rewrite a query entirely, but
I have not done that (in order to reduce the risk of changes).
2021-03-10 10:58:09 +00:00
Jun Pataleta
5e7aeb7841 Merge branch 'MDL-70911-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-03-10 16:15:36 +08:00
Sara Arjona
52fd43f54d MDL-70911 core_badges: Remove $CFG->badges_site_backpack
The $CFG->badges_site_backpack setting has been completely removed
because it's not required anymore. From now, the primary site
backpack will be the first one in the "Manage backpacks" list (so,
the one with lower sortorder value).
2021-03-10 09:10:32 +01:00
Sara Arjona
3de96274ff MDL-70911 core_badges: Add support to backpacks sortorder
Before removing $CFG->badges_site_backpack setting, admins should be
able to re-order the existing site-backpacks (because then, the first
one will be treated as the default one).
This patch adds the sort order feature to the backpack list.
2021-03-10 08:31:22 +01:00
Sara Arjona
b8f38fc98b Merge branch 'MDL-70815-311-6' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-03-09 15:18:33 +01:00
Jun Pataleta
1292b31ac5 MDL-70815 completion: Test internal_get_state() with custom completion
Use the custom completion implementation for mod_choice to test
completion_info::get_state() to cover the case where the completion
state is being determined from the custom completion condition.
2021-03-09 20:19:00 +08:00
Jun Pataleta
ad5b613c86 MDL-70815 core_completion: Update completion_info
* Update completion_info::get_data() to add other completion
information from a new method called get_other_cm_completion_data().
This allows the storage of the completion statuses of the following
completion rules to completion_info objects:
  - 'Students must receive a grade' completion rule.
  - Any custom completion rule defined by an activity.
This allows detailed completion information to be fetched for course
modules.
It also allows custom completion statuses to be cached which will help
reduce DB queries when fetching completion statuses.
* Update update_state() to fetch overall completion state from the
module's activity_custom_completion implementation. Falls back to the
*_get_completion_state() callback function.
* Update internal_set_data() to include the other cm completion data
in the updated cache data for the module instance.
2021-03-09 20:18:59 +08:00
Jun Pataleta
31fcbfc2e2 MDL-70815 core_completion: completion_info::get_grade_completion()
Move the current logic for determining the completion status for the
"Student must receive grade" completion rule to a function so it cann
be reused.
Unit test included.
2021-03-09 20:18:59 +08:00
Jun Pataleta
baa0001037 MDL-70815 core_completion: Fix unit tests
* Unit tests for completion_info::get_data() and
completion_info::internal_get_state are mocked which causes failures
with the new implementation. It's more straightforward and realistic
to generate real course and modules to test these methods.
2021-03-09 20:18:59 +08:00
Jun Pataleta
6d2e36aa37 MDL-70815 core_completion: Activity custom completion details base class
* Base class for defining an activity module's custom completion details
2021-03-09 20:18:59 +08:00
Sara Arjona
217377d30f Merge branch 'MDL-70766-auth-config-log-MOODLE_311_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_311_STABLE 2021-03-08 11:39:19 +01:00
sam marshall
5b7b1b9a06 MDL-45242 Lib: Replace direct references to ->showuseridentity 2021-03-08 09:17:04 +00:00
sam marshall
947d8c7806 MDL-45242 Lib: Deprecate field-related library functions 2021-03-08 09:17:04 +00:00
sam marshall
68e576b0ed MDL-45242 Lib: Allow custom profile fields in showuseridentity 2021-03-08 09:17:03 +00:00
sam marshall
f21cf5bc86 MDL-45242 Testing: Generators for user profile fields 2021-03-08 09:17:03 +00:00
sam marshall
23c20dc23f MDL-45242 Admin: Added lazy-loading callback to multicheckbox
Currently admin_setting_configselect has lazy-loading support via a
callback function (so you don't have to make pointless single-use
classes for each unusual setting), but this is not present in other
similar types.

This commit adds identical support to
admin_setting_configmulticheckbox.
2021-03-08 09:17:03 +00:00
Mikhail Golenkov
68588a8f47 MDL-71044 backup: backup_cleanup_task task to remove old files 2021-03-07 21:48:47 +11:00
Paul Holden
99e1de9756 MDL-71048 lang: fix null equality check of lang string args. 2021-03-04 19:43:44 +00:00
Marina Glancy
8274935cb1 MDL-71039 core_form: support valuehtmlcallback in autocomplete inline 2021-03-04 13:39:45 +01:00
Thinh Pham
99a0d0e411 MDL-70727 Behat: function scrollIntoView not working in the app 2021-03-04 13:35:46 +07:00
Ilya Tregubov
4bc3faf193 MDL-69680 lib: Replace deprecated jQuery functions 2021-03-04 12:48:06 +08:00
Ilya Tregubov
f2e6985049 MDL-69680 lib: Update jQuery version in Moodle files 2021-03-04 12:48:06 +08:00
Ilya Tregubov
a5712a54fa MDL-69680 lib: Upgrade jQuery lib to 3.5.1 2021-03-04 12:48:06 +08:00
Eloy Lafuente (stronk7)
67c851ff81 Merge branch 'MDL-70424-auth-avoid-changes-MOODLE_311_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_311_STABLE 2021-03-04 00:29:07 +01:00
Marina Glancy
7ab4eafc02 MDL-65552 user: escape idnumber and email in table_sql 2021-03-03 23:14:54 +08:00
Paul Holden
2474bc765f MDL-65552 user: escape idnumber field on output.
This commit also corrects parameter definition of the field to
match core_user.
2021-03-03 23:14:54 +08:00
Sara Arjona
3fa69248c0 Merge branch 'MDL-70125_311-3' of git://github.com/mdjnelson/moodle into MOODLE_311_STABLE 2021-03-03 15:47:30 +01:00
Sara Arjona
9f5794834e Merge branch 'MDL-67494-311' of git://github.com/lameze/moodle into MOODLE_311_STABLE 2021-03-03 11:47:00 +01:00
Sara Arjona
d30b045210 Merge branch 'MDL-67119-311' of git://github.com/aanabit/moodle into MOODLE_311_STABLE 2021-03-03 11:11:35 +01:00
Jun Pataleta
39627013bf Merge branch 'MDL-70987-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-03-03 16:42:11 +08:00
Sara Arjona
8110f4a2eb Merge branch 'MDL-70966-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-03-03 09:30:47 +01:00
Simey Lameze
fe0a2248f1 MDL-67494 calendar: user_delete_user should delete all user events 2021-03-03 16:29:20 +08:00
Simey Lameze
25f0a459c1 MDL-67494 calendar: set userid to zero for shared events 2021-03-03 16:29:19 +08:00
Simey Lameze
05540f0eef MDL-67494 calendar: step to set userid 0 to all shared events 2021-03-03 16:29:18 +08:00
Andrew Nicols
13bda0057c Merge branch 'MDL-70268-311-2' of git://github.com/peterRd/moodle into MOODLE_311_STABLE 2021-03-03 12:22:52 +08:00
Peter Dias
ff411bebe1 MDL-70268 core: Update the oauthlib to exclude scope if none provided 2021-03-03 12:06:10 +08:00
Sander Wind
616070614e MDL-70668 auth: Fix secret validation during user confirmation
Co-authored-by: Michael Hawkins <michaelh@moodle.com>
2021-03-02 23:44:43 +01:00
Jun Pataleta
4fe87411db Merge branch 'MDL-70457_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-03-02 17:39:29 +08:00