384 Commits

Author SHA1 Message Date
Andrew Nicols
cd48ae56c7 MDL-77559 js: Rebuild all JS with Node 16 2023-03-09 09:53:19 +08:00
Andrew Nicols
288620b0b4 MDL-75012 js: Full build of all grunt things 2023-03-02 12:15:25 +08:00
Jun Pataleta
d9cd25c2fb MDL-76497 upgrade: add the 4.1.0 separation line to all upgrade scripts 2022-12-01 08:59:07 +03:00
Jun Pataleta
00bae8b8a4 MDL-76403 versions: bump all versions and requires near release 2022-11-23 09:45:23 +08:00
Mihail Geshoski
1057a1a625 MDL-76069 enrol_manual: Fix missing breadcrumbs 2022-10-27 21:56:18 +08:00
Eloy Lafuente (stronk7)
58b56e2395 MDL-71747 upgrade: remove all the < 3.9.0 upgrade steps
This just deletes all the upgrade steps previous to 3.9.0. Some
small adjustments, like tweaking globals can also be applied
when needed.

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

The next commits will proceed to deprecate / remove functions
that were exclusively (usually belonging to upgradelib) being
used by those, now removed, upgrade steps. This is the list
of code to remove and document in upgrade.txt files:

  - upgrade_analytics_fix_contextids_defaults()
  - upgrade_convert_hub_config_site_param_names()
  - upgrade_rename_prediction_actions_useful_incorrectly_flagged()
  - \mod_forum\task\refresh_forum_post_counts adhoc task.

And these is the code that has NOT been removed
because it may be needed later (no matter there aren't uses now):

  - \core_search\manager::clean_up_non_existing_area(), used by
  - \core\task\clean_up_deleted_search_area_task adhoc task
2022-07-07 19:16:37 +02:00
Jun Pataleta
545d848064 Merge branch 'MDL-72193' of https://github.com/paulholden/moodle 2022-06-10 13:11:25 +02:00
Paul Holden
14422572b9 MDL-72193 enrol_manual: support custom user profile fields. 2022-04-25 18:18:00 +01:00
Eloy Lafuente (stronk7)
76f5445451 MDL-74510 upgrade: add the 4.0.0 separation line to all upgrade scripts 2022-04-22 18:45:10 +02:00
Jun Pataleta
70f6b1605b MDL-74471 versions: bump all versions and requires near release 2022-04-13 10:37:36 +08:00
Andrew Nicols
e1b9d5f3cd MDL-73915 js: Drop support for IE and android
Moodle announced that support for IE would be dropped back in August
2020 with Moodle 3.9 but not active steps were taken at that time. That
decision was made in MDLSITE-6109 and this particular step was meant to
be taken in Moodle 3.10.

This is the first step taken to actively drop support for IE.

This commit also bumps the browser support pattern from 0.25% to 0.3%.
The percentage here includes any browser where at least this percentage
of users worldwide may be using a browser. In this case it causes
support for Android 4.3-4.4 to be dropped, which relate to Android
KitKat (released 2013).

This combination of changes means that all of the supported browsers in
our compatibility list support modern features including async,
for...of, classes, native Promises, and more which has a huge impact on
the ease of debugging code, and drastically reduces the minified file
size because a number of native Polyfills included by Babel are no
longer included.
2022-02-23 08:55:20 +08:00
Andrew Nicols
0a4047ab31 MDL-73915 js: Switch amd minification to terser
Unfortunately the babel minify-mangle plugin seems to be abandoned and
in certain circumstances can be very buggy. The only safe options are to
disable it, or to switch to a different minification library.

Not minifying our javascript is not ideal, so this commit updates the
javascript tasks to use a rollup, combined with babel, and terser.

Babel still converts code from ES/UMD/AMD to AMD modules with the
relevant browser support, whilst terser minifies the code.

The rollup bundler handles tracking and creation of sourcemaps, and
supports better parallelisation of the tasks.

Since the upgrade to Node LTS/Gallium requires an upgrade to @babel/core
and eslint, which change the built files anyway, this seems like the
ideal time to make this change.
2022-02-23 08:55:09 +08:00
Andrew Nicols
aa7f7957ea MDL-73915 js: Upgrade babel and eslint 2022-02-23 08:53:54 +08:00
Eloy Lafuente (stronk7)
100bc51f1d MDL-73485 phpunit: externallib, generator and filter tescase names
All externallib_test, generator_test and filter_test classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- 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 tests under testing/tests:

1) The core_testing component doesn't exist.
2) But testing/tests are allowed because there is a suite pointing to it (phpunit.xml).
3) So, the only possible namespace for them is "core".
4) And to avoid problems with other core testcases (under lib/tests)
   they have been renamed to have testing_xxxx as prefix.

Finally, also modified calendar/tests/events/events_test.php because it uses
some renamed (core_calendar_externallib_testcase => \core_calendar\externallib_test)
classes.
2022-01-21 19:48:23 +01:00
Eloy Lafuente (stronk7)
511801cb46 MDL-73352 phpunit: lib_test and locallib_test testcase names
All lib_test and locallib_test classes:

- Namespaced with component (and API whenever makes sense).
- Fixed incorrect use statements with leading backslash.
- Changed code to point to global scope when needed or add new uses.
- All them passing individually.
- Complete runs passing too.

Special mention to tests under login/tests:

1) The core_login component doesn't exist.
2) But login/tests are allowed because there is a suite pointing to it (phpunit.xml).
3) So, the only possible namespace for them is "core".
4) And to avoid problems with other core testcases (under lib/tests)
   they have been renamed to have login_xxxx as prefix.
2021-12-30 16:21:42 +01:00
abgreeve
fcd4de8639 MDL-72090 navigation: Update to behat feature files for navigation.
This updates feature files to use the new steps to navigate to certain
pages.
2021-12-09 11:13:35 +08:00
Peter Dias
e0d7dbd022 MDL-72875 course: Introduce tertiary nav in participants
- Introduce tertiary nav in the participants page
2021-12-02 13:09:12 +08:00
Andrew Nicols
98421046dc MDL-69364 enrol: Improve setting of save button 2021-09-20 12:07:30 +08:00
Paul Holden
492b19db2c MDL-72192 user: observe fullname capability in selector context. 2021-08-31 12:17:28 +01:00
Andrew Nicols
4f422785c6 MDL-71113 javascript: Improve basic JS Documentation 2021-06-18 09:38:05 +08:00
Andrew Nicols
92179b7057 MDL-71113 js: Fix all jsdoc warnings 2021-06-18 09:38:05 +08:00
Eloy Lafuente (stronk7)
9d6aa39985 MDL-71583 versions: Add all the missing full-stops to version/requires
It seems that the new phpcs3 checker is now controlling those
line comments that previously were ignored.

This commit just looks for all the cases and bulk-add
them when needed. The bash script (mac) used to add all them is:

while read -r line; do
    arr=(${line//:/ })
    if [[ -n ${arr[0]} ]] && [[ -n ${arr[1]} ]]; then
        echo "  file ${arr[0]}, line ${arr[1]}"
        sed -i "${arr[1]}s/\$/\./" ${arr[0]}
    fi
done < <(find . -name version.php | xargs ag --nomultiline '>(version|requires) *=.*//.*[^;\.]$')
2021-05-11 20:11:07 +02:00
Luca Bösch
6ab749558e MDL-71244 enrol_manual: Add bootstrap classes to buttons 2021-04-27 17:29:20 +02:00
sam marshall
5e72715e4f MDL-71099 Lib: Move new user_fields class from core to core_user
This class would belong more appropriately within the 'user' API
(core_user) instead of within the 'core' API, since it is
directly related to user data.

Since the class has only just been added to Moodle, now is a good
time to move it.
2021-03-25 13:47:23 +00:00
sam marshall
987e55452f MDL-45242 Course: Enrol feature supports custom profile fields 2021-03-10 10:57:11 +00:00
sam marshall
558cc1b85e 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:57:10 +00:00
Eloy Lafuente (stronk7)
77342b96fc MDL-69308 upgrade: remove all the < 3.6.0 upgrade steps
This just deletes all the upgrade steps previous to 3.6.0. Some
small adjustments, like tweaking globals can also be applied
when needed.

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

Note that in this case, there wasn't any case of upgradelib
functions being used, hence we haven't to deprecate/remove
anything in codebase. When there is such a need, that is done
in separate commits (one for each function) and documented here.

See MDL-65809 commits for an example removing/deprecating a
good number of functions.
2021-01-13 19:11:19 +01:00
Andrew Nicols
31402aa406 MDL-69107 user: Fix autocomplete usages 2020-12-16 07:50:56 +08:00
David Matamoros
9b5eb38f55 MDL-63683 enrol: Fix plugin settings when no role has student archetype 2020-12-04 09:09:37 +01:00
Helen Foster
dd7a1d60e2 MDL-69998 lang: Import fixed English strings (en_fix) 2020-10-27 11:32:10 +01: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
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
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
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
Shamim Rezaie
3dec4c6ce3 MDL-68148 core_user: avoid multiple enrol buttons with the same id 2020-04-08 11:22:34 +10:00
Andrew Nicols
604887ce8f MDL-67827 behat: Pending JS improvements for dialogues 2020-03-06 12:59:38 +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
Eloy Lafuente (stronk7)
492d047d11 MDL-67284 upgrade: add 3.8.0 separation line to all upgrade scripts 2019-11-17 11:40:19 +01:00