2298 Commits

Author SHA1 Message Date
Shamim Rezaie
8ef156b7dc MDL-69166 core_payment: post to process payment 2020-10-27 08:37:08 +11:00
Shamim Rezaie
e9de430907 MDL-69166 core_payment: display the gateways modal 2020-10-27 08:37:08 +11:00
Shamim Rezaie
a580b33738 MDL-69166 enrol_fee: An enrolment plugin that supports payments 2020-10-27 08:37:08 +11:00
Eloy Lafuente (stronk7)
3a5641cb74 MDL-67673 phpunit: Remove deprecated assertEquals() params
The optional parameters of assertEquals() and assertNotEquals()
are deprecated in PHPUnit 8 (to be removed in PHPUnit 9):

- delta => use assertEqualsWithDelta()
- canonicalize => use assertEqualsCanonicalizing()
- ignoreCase => use assertEqualsIgnoringCase
- maxDepth => removed without replacement.

More info @ https://github.com/sebastianbergmann/phpunit/issues/3341

Initial search done with:

ag 'assert(Not)?Equals\(.*,.*,' --php

Then, running tests and fixing remaining cases.
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
40de097e65 MDL-67673 phpunit: Remove deprecated assertContains() uses on strings
Both assertContains() and assertNotContains() are deprecated in PHPUnit 8
for operations on strings. Also the optional case parameter is. All uses
must be changed to one of:

- assertStringContainsString()
- assertStringContainsStringIgnoringCase()
- assertStringNotContainsString()
- assertStringNotContainsStringIgnoringCase()

More info: https://github.com/sebastianbergmann/phpunit/issues/3422

Regexp to find all uses:

ag 'assert(Not)?Contains\('
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
d95c378771 MDL-67673 phpunit: Remove expectedException annotations
While this is not strictly required, because removal will
happen in PHPUnit 9.0, we are already getting rid of all
uses in core.

From release notes:https://phpunit.de/announcements/phpunit-8.html

The annotations `@expectedException`, `@expectedExceptionCode`,
`@expectedExceptionMessage`, and `@expectedExceptionMessageRegExp`
are now deprecated.
Using these annotations will trigger a deprecation warning
in PHPUnit 8 and in PHPUnit 9 these annotations will be removed.

Also, all uses of expectExceptionMessageRegExp() has been moved
to expectExceptionMessageMatches(). See https://github.com/sebastianbergmann/phpunit/issues/3957

TODO: Various weirdness found while doing the changes with these tests:
- vendor/bin/phpunit lib/tests/exporter_test.php (created MDL-69700)
- vendor/bin/phpunit competency/tests/external_test.php (same issue than prev one)
- vendor/bin/phpunit question/engine/tests/questionengine_test.php (created MDL-69624)
- vendor/bin/phpunit lib/tests/event_test.php (created MDL-69688)
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
f6711bb394 MDL-67673 phpunit: Fix the return type of template methods
All the setup/teardown/pre/post/conditions template methods
now are required to return void. This was warned with phpunit 7
and now is enforced.

At the same time, fix a few wrong function names,
provider data and param types, return statements...
2020-10-21 12:45:59 +02:00
Dani Palou
25bc7a3d6b MDL-68098 ws: Add unit tests to test mathjax in WS 2020-09-23 11:18:41 +02:00
Dani Palou
8c84eeeeac MDL-68098 ws: Fix WebServices broken by filters HTML 2020-09-22 09:43:03 +02:00
Sara Arjona
7c99f40d61 Merge branch 'MDL-69521' of https://github.com/stronk7/moodle into master 2020-09-09 08:08:06 +02:00
Eloy Lafuente (stronk7)
74ee34fd87 MDL-69521 core: Move all comments in code from 4.1 to 3.11 2020-09-08 18:59:30 +02:00
Eloy Lafuente (stronk7)
fd0b332db3 Merge branch 'MDL-69510-master' of https://github.com/snake/moodle into master 2020-09-08 15:27:29 +02:00
Jake Dallimore
0d6e5f2bc2 MDL-69510 admin: make ldap configuration warnings clear 2020-09-03 10:21:07 +08:00
Paul Holden
25ef8d4926 MDL-63387 enrol_cohort: show both roles names in instance config form. 2020-09-01 12:05:20 +01:00
Paul Holden
ee640d868a MDL-63387 enrol_manual: show both role names in enrol users dialog. 2020-09-01 12:05:20 +01:00
Eloy Lafuente (stronk7)
fbb0767536 MDL-69475 versions: bump all versions and requires in master
version = 2021052500 release version
requires= 2021052500 same than version

Why 20210525? (25th May 2021) ?

Because master is going to be Moodle 4.0, to be released
on November 2021. And, until then, we are going to have
a couple of "intermediate" releases:

- Moodle 3.10 to be released 9th November 2020. (2020110900)

  This version will be using versions from today to 2020110900
  (once it's released the YYYYMMDD part stops advancing).

- Moodle 3.11 to be released 10th May 2021. (2021051000)

  This version will be using versions from 3.10 release to 2021051000
  (once it's released the YYYYMMDD part stops advancing).

That means that all versions from today to 2021051000 are going
to be used by those 2 "intermediate" releases (3.10 and 3.11).

And we cannot use them in master, because it's forbidden to have
any overlapping of versions between branches (or different upgrade
paths will fail).

So, get that 2021051000, let's add it a couple of weeks to cover
the on-sync period (or a 2 weeks delay max!) and, the first version
that master can "own" in exclusive (without any overlap) is, exactly,
25th May 2021, hence our 20210525.
2020-08-18 00:47:15 +02:00
Jake Dallimore
af331f08d4 Merge branch 'MDL-45849-selfenrol' of https://github.com/Peterburnett/moodle 2020-07-16 16:27:01 +02:00
Jun Pataleta
c5438f982c MDL-57678 enrol_ldap: Replace usage of make_categories_options()
Replace with core_course_category::make_categories_list() instead.
2020-07-15 18:26:03 +08:00
Peter Burnett
37c99bd07e MDL-45849 enrol_self: Added self enrol capability 2020-07-10 11:52:10 +10:00
Víctor Déniz Falcón
d07fb8b9e8 MDL-69093 enrol_manual: added check for allowed roles a user can assign 2020-07-07 08:32:39 +02:00
Helen Foster
38d5e3db1b MDL-69130 lang: Import fixed English strings (en_fix)
Significant string change:

- presentationoraltrequired,atto_image - wording changed to mention
  'decorative only' checkbox
2020-06-25 21:54:13 +02:00
Eloy Lafuente (stronk7)
b764343e5a MDL-69044 upgrade: add 3.9.0 separation line to all upgrade scripts 2020-06-14 13:08:09 +02:00
Jake Dallimore
337e2e2b23 Merge branch 'MDL-68973' of https://github.com/stronk7/moodle 2020-06-10 16:13:57 +08:00
Andrew Nicols
a9075379d8 MDL-68977 enrol_manual: Add pending promises to enrol modal 2020-06-10 08:16:03 +08:00
Eloy Lafuente (stronk7)
115cc0214f MDL-68973 versions: bump all versions and requires near release
version = 2020061500 release version
requires= 2020060900 current rc1 (week7roll1) version
2020-06-09 16:23:09 +02:00
Andrew Nicols
eb087fc5de MDL-68951 user: Add appropriate exceptions for table/participants 2020-06-08 09:35:39 +08:00
Bas Brands
6a4ce7b0a3 MDL-67386 theme_boost: upgrade bootstrap to version 4.5.0 2020-05-25 15:48:17 +02:00
Adrian Greeve
1c1fd15b18 Merge branch 'MDL-68333-master' of git://github.com/marinaglancy/moodle 2020-05-20 13:17:58 +08:00
Marina Glancy
5b529aca15 MDL-68333 testing: trigger user_created event in user generator 2020-05-19 19:11:54 +02:00
Andrew Nicols
abc83c40b5 MDL-68464 enrol_manual: Comment out buggy behat line
This is commented out because auto-hidden toasts currently call `hide()`
and trigger the `bs.toast.hide` event immediately, and _then_ apply the
autohide delay.

Since we automatically add M.util.pending_js calls when we _start_ to
hide, and resolve them when the hide _finishes_, this means that we do:
- addToast called
- trigger `bs.toast.show` event
- add to pending_js
- [pending_js queue not empty - behat waits]
- message is shown in UI
- `hide()` called
- trigger `bs.toast.hide` event
- add to pending_js
- [pending_js queue not empty - behat waits]
- start autohide delay
- [pending_js queue not empty - behat waits]
- [pending_js queue not empty - behat waits]
- [pending_js queue not empty - behat waits]
- [pending_js queue not empty - behat waits]
- end autohide delay
- remove message (no longer present in DOM)
- trigger `bs.toast.hidden` event
- resolve pending_js
- [pending_js queue empty - behat stops waiting]
- Behat runs next step: And I should see "1 enrolled users"
-- Step fails beacuse the message has been shown, and has then been removed

The conversation should have been:
- addToast called
- trigger `bs.toast.show` event
- add to pending_js
- [pending_js queue not empty - behat waits]
- message is shown in UI
- start autohide delay
- trigger `bs.toast.shown` event
- resolve pending_js
- [pending_js queue empty - behat stops waiting]
- Behat runs next step: And I should see "1 enrolled users"
-- Step passes
- autohide delay ends and calls `hide()`
- trigger bs.toast.hide event
- add to pending_js
- [behat waits]
- end autohide delay
- remove message (no longer present in DOM)
- trigger `bs.toast.hidden` event
- resolve pending_js
- [pending_js queue empty - behat stops waiting]
- Behat run continues

See MDL-67386 for futher information.
2020-05-19 12:37:21 +08:00
Andrew Nicols
e0e7b19f9c MDL-68464 enrol_manual: Reload participants table after enroling 2020-05-19 12:37:21 +08:00
Andrew Nicols
c50f5af248 MDL-68464 enrol_manual: Rewrite quickenrolment to use ES6 2020-05-19 12:33:40 +08:00
Andrew Nicols
7afd16ad84 MDL-66109 behat: Require newline at EOF
This change enables the gherkinlint rule to require a new line at the
end of the file. This change is in keeping with existing Moodle coding
style guidelines.
2020-05-11 11:07:49 +08:00
Mihail Geshoski
9fa46e8a8c MDL-67845 enrol_database: Remove enrol_database_admin_setting_category
This class was only used by the database enrolment plugin settings and
was replaced by admin_settings_coursecat_select. Also, this class is in
a plugin which we do not expect to be extended and therefore it can be
simply removed without going through the deprecation process.
2020-05-06 10:50:05 +08:00
Mihail Geshoski
b16f5398a5 MDL-67845 enrol_database: Use course category selection setting
We should use admin_settings_coursecat_select instead of
enrol_database_admin_setting_category as the second class is only
being used by the database enrolment plugin settings and can be
removed after this change.
2020-05-06 10:50:05 +08:00
Shamim Rezaie
3dec4c6ce3 MDL-68148 core_user: avoid multiple enrol buttons with the same id 2020-04-08 11:22:34 +10:00
Eloy Lafuente (stronk7)
9dc5d5ce0b Merge branch 'MDL-67827-master' of git://github.com/andrewnicols/moodle 2020-03-09 20:36:09 +01:00
Sara Arjona
6185f1ce24 Merge branch 'MDL-66671-master' of https://github.com/dthies/moodle 2020-03-09 18:49:02 +01:00
Andrew Nicols
604887ce8f MDL-67827 behat: Pending JS improvements for dialogues 2020-03-06 12:59:38 +08:00
Daniel Thies
158898254c MDL-66671 enrol_lti: Skip grade sync when cm deleted 2020-02-28 09:32:24 -06:00
Anthony Forth
bcc3a463f6 MDL-67945 enrol: missing $DB in edit_instance_form 2020-02-26 16:22:36 +01:00
Jun Pataleta
a762f048b8 Merge branch 'MDL-67118' of https://github.com/stronk7/moodle 2020-01-23 15:12:58 +08:00
Eloy Lafuente (stronk7)
011d55dd62 MDL-67118 enrol_ldap: add pagesize/subcontexts provider
With that provider we'll be explicitly checking that any
pagesize and subcontexts search is returning results consistently
so the internal paging/servercontrols work as expected.
2020-01-16 19:16:14 +01:00
Eloy Lafuente (stronk7)
ba62f54ef2 MDL-67118 enrol_ldap: paged results functions deprecated php74 and up
Starting with php74 the following functions are deprecated:
- ldap_control_paged_result()
- ldap_control_paged_result_response()

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

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

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

With a TODO about removing 1) in Moodle 4.1, once php73 becomes required.
2020-01-16 19:16:14 +01:00
David Mudrák
0845825659 MDL-66712 enrol: Fix the reported days of inactivity on unenrolment
There were two problems here. Firstly, the $days was not correctly
calculated due to missing parentheses. Secondly, the sentence had
grammar issues.
2020-01-16 13:35:01 +01:00
Eloy Lafuente (stronk7)
4621917c62 MDL-67114 core: php74 fix. Fix use of scalar as array in core
There are various places where it's not guaranteed that the
variable being used is array, and instead, can be null, bool, int...

We need to check that because php74 warns about it.

Where possible we have used the coalesce operator as
replacement for isset() ternary operations.
2020-01-03 11:33:15 +01:00
Adrian Greeve
42d7f7f9e4 Merge branch 'MDL-65809-master' of git://github.com/sarjona/moodle 2019-12-24 14:53:03 +08:00
Adrian Greeve
f00542c485 Merge branch 'MDL-66999-master' of git://github.com/bmbrands/moodle 2019-12-23 14:26:39 +08:00
Sara Arjona
a26cfe71d3 MDL-65809 upgrade: clean < 3.5.0 upgrade steps
This just deletes all the upgrade steps previous to 3.5.0. Some
small adjustments, like tweaking globals can also be applied
when needed.

Also includes an upgrade step to prevent upgrading from any
version < 2018051700 (v3.5.0) as anti-cheating measure.

Previous commits have removed/deprecated all the upgradelib functions
not used anymore in codebase. Deletion has been documented in corresponding
upgrade.txt files:

- upgrade_fix_block_instance_configuration()
- upgrade_theme_is_from_family(), upgrade_find_theme_location()
and linkcoursesectionsupgradescriptwasrun setting
- upgrade_block_positions
- upgrade_fix_config_auth_plugin_names()
 and upgrade_fix_config_auth_plugin_defaults()
- format_xxx_upgrade_remove_numsections(), format_xxx_upgrade_hide_extra_sections()
and format_xxx_upgrade_add_empty_sections()
- filter_mathjaxloader_upgrade_cdn_cloudflare()
and filter_mathjaxloader_upgrade_mathjaxconfig_equal()
- get_assignments_with_rescaled_null_grades()

These have been kept because continue being used by restore:

- \core\task\refresh_mod_calendar_events_task
2019-12-20 12:20:43 +01:00
Felice Candilio
4a4a73467c MDL-67410 Enrolments: Casting the perpage parameter to INT
On the course's Participants page, when manually enrolling users
the AJAX call might get excesively slow, due to the treatment
of the perpage parameter as a string, which gets concatenated with the
number 1 (perpage: parseInt(perpage) + 1) instead of performing a
numerical addition.

If there are for example 1500+ users on the site, the method
core_enrol_get_potential_users will be executed with a value of 15001
for the perpage parameter, rendering painfully slow.
2019-12-12 22:21:58 +01:00