2641 Commits

Author SHA1 Message Date
Mihail Geshoski
8968b51c6b MDL-73645 core_enrol: Update breadcrumb nodes 2022-03-02 13:00:25 +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
Jake Dallimore
ae5aaf9b82 MDL-73950 enrol_lti: fix icon spacing in dynamic registration URL 2022-02-21 16:02:12 +08:00
Sara Arjona
18631ff886 Merge branch 'MDL-73873-master' of https://github.com/aanabit/moodle 2022-02-17 10:44:10 +01:00
Amaia Anabitarte
760747b5dc MDL-73873 enrol_cohort: Fix warning when editing cohort enrolment 2022-02-14 17:59:28 +01:00
Sara Arjona
ef8015baca MDL-69542 enrol_lti: Add missing index to install
A foreign-key from enrol_lti_users->ltideploymentid to
enrol_lti_deployment->id was defined in upgrade but missing in
install.xml.
2022-02-11 17:56:15 +01:00
Sara Arjona
ee289b4286 Merge branch 'MDL-69542-master-fixes-historyfix' of https://github.com/snake/moodle 2022-02-11 17:07:43 +01:00
Jake Dallimore
e399b3995e MDL-69542 enrol_lti: behat feature covering tool registration 2022-02-11 11:07:26 +08:00
Jake Dallimore
66b76c4545 MDL-69542 enrol_lti: remaining changes for dynamic registration support
- Allow the tool to generate secure, one time, dynamic registration
URLs for use in supporting platforms.
- Registration endpoint, which validates the one time URL, makes
the registration requqest to the platform and adds the approriate
tool registration changes in the tool on success.
- Admin settings pages make use of the 'copy to clipboard' module
which is now in core.
2022-02-11 11:06:05 +08:00
Jake Dallimore
d5ed4a3184 MDL-69542 enrol_lti: add LTI Advantage grade sync task
This change adds a new grade sync task for LTI Advantage and updates
the legacy task such that it only operates on legacy tools. This uses
the assignment and grades service 2.0.
2022-02-11 11:03:32 +08:00
Jake Dallimore
1f27bad809 MDL-69542 enrol_lti: add LTI Advantage member sync task
This change adds a new member sync task for LTI Advantage and updates
the legacy task such that it only operates on legacy tools. This uses
the names and roles provisioning service 2.0.
2022-02-11 11:03:00 +08:00
Jake Dallimore
4d8a078154 MDL-69542 enrol_lti: backup changes for LTI Advantage 2022-02-11 10:52:40 +08:00
Jake Dallimore
6fbd30e15d MDL-69542 enrol_lti: add deep linking support 2022-02-11 10:52:31 +08:00
Jake Dallimore
2516938537 MDL-69542 enrol_lti: add version based resource publication
Adds tabs and a new table allowing LTI Advantage published resources
to be viewed.
2022-02-11 10:51:59 +08:00
Jake Dallimore
c6c7b1dadc MDL-69542 enrol_lti: add generators for use in LTI Advantage behat 2022-02-11 10:50:06 +08:00
Jake Dallimore
f0092f94d8 MDL-69542 enrol_lti: add OIDC endpoints for resource link launch 2022-02-11 10:49:40 +08:00
Jake Dallimore
983038161a MDL-69542 enrol_lti: add message_helper utility class 2022-02-11 10:49:30 +08:00
Jake Dallimore
9d5264d500 MDL-69542 enrol_lti: add tool launch service 2022-02-11 10:47:12 +08:00
Jake Dallimore
92195d97c0 MDL-69542 enrol_lti: add admin page for deployment management 2022-02-11 10:43:00 +08:00
Jake Dallimore
c41ff5161d MDL-69542 enrol_lti: add tool deployments service 2022-02-11 10:38:41 +08:00
Jake Dallimore
8c62efe74e MDL-69542 enrol_lti: admin page providing platform registration 2022-02-11 10:36:01 +08:00
Jake Dallimore
1f3d37390d MDL-69542 enrol_lti: add tool endpoint page to admin settings 2022-02-11 10:35:51 +08:00
Jake Dallimore
0f6239a054 MDL-69542 enrol_lti: add application registration service 2022-02-11 10:32:49 +08:00
Jake Dallimore
948746eae7 MDL-69542 enrol_lti: make lib changes supporting LTI Advantage
This change includes:
- LTI Advantage specific code in delete_instance().
- LTI version field added to publish as lti tool form.
- LTI Advantage specific uuid added to add_instance().
- Moved secret validation (LTI1.1/2.0) to server side, allowing
the element to be hidden in LTI Advantage cases.
2022-02-11 10:24:49 +08:00
Jake Dallimore
dad46e813b MDL-69542 enrol_lti: implement classes required by the lti13 library 2022-02-11 10:23:31 +08:00
Jake Dallimore
5649c72d43 MDL-69542 enrol_lti: add published resource view object support
The view objects introduced here will be used as a representation of
data during the content selection process.
2022-02-11 10:22:24 +08:00
Jake Dallimore
4049c08998 MDL-69542 enrol_lti: add entity repositories 2022-02-11 10:20:21 +08:00
Jake Dallimore
a7d864a609 MDL-69542 enrol_lti: add base test class for lti advantage
Contains a collection of useful LTI Advantage specific methods.
2022-02-11 10:18:34 +08:00
Jake Dallimore
7a1f433043 MDL-69542 enrol_lti: add new entity classes for storing launch data 2022-02-11 10:12:57 +08:00
Jake Dallimore
23894ddd98 MDL-69542 enrol_lti: add upgrade and install code updating tables 2022-02-11 10:10:05 +08:00
Jake Dallimore
42078d4eec MDL-69542 enrol_lti: all lang string changes 2022-02-11 10:09:25 +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
Ilya Tregubov
8685968870 Merge branch 'MDL-73764' of https://github.com/stronk7/moodle 2022-02-10 14:18:34 +02:00
Shamim Rezaie
e30493108d Merge branch 'MDL-73722' of https://github.com/paulholden/moodle 2022-02-10 17:21:10 +11:00
Eloy Lafuente (stronk7)
3bb4a4009c MDL-73764 tool_xmldb: Regenerate all the files detected by the report
Note that, instead of going one by one to them from the XMLDB Editor
(load, makes some tiny change, save, revert the change, save), the
report includes a commented line that, once uncommented, does regenerate
the file while reporting.

I've left it there as a commodity for the developer.
2022-02-08 19:25:03 +01:00
Eloy Lafuente (stronk7)
c5e2a4ded0 Merge branch 'MDL-73601-master' of https://github.com/aanabit/moodle 2022-02-07 12:01:19 +01:00
Eloy Lafuente (stronk7)
7a0d024e60 MDL-73659 phpunit: restore_date, api, rule, plugin, manager & helper
All restore_date_test, api_test, rule_test, plugin_test,
manager_test, helper_test 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:

- All restore_date_test cases have been put under xxx\backup
  level 2 (valid API) namespace.
2022-02-05 00:03:32 +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
Amaia Anabitarte
d9967a5763 MDL-73601 lib: Normalize readme_moodle.txt file name 2022-02-01 18:10:36 +01:00
Paul Holden
91683bf803 MDL-73722 enrol: verify we have a search button to render. 2022-01-31 18:11:07 +00:00
Shamim Rezaie
01e21818fb Merge branch 'MDL-73500' of https://github.com/stronk7/moodle 2022-01-27 11:37:47 +11: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)
5300351831 MDL-73500 general: Remove php < 73 conditional code
This commit removes code that only was being executed by php < 73
and it's 100% safe to do so because Moodle 3.11 and up require
php 73, hence it was not executed ever.

Removed code includes:
- ldap_control_paged_result and ldap_control_paged_result_response
  (that were deprecated in php 73 and have been removed in php 80).
- conditional code in the session manager, where some hacks were
  needed for php < 73. Note that this removes the private function
  append_samesite_cookie_attribute() completely because it was
  doinf nothing (first line was returning for php < 73).
- Also removed the old session.hash_function ini setting because
  it was removed in php 71.

Kept code includes:
- The environmental check_igbinary322_version test has not been
  removed because it doesn't hurt (always returns "ok" for php 73
  sites) and doing it would involve to backport the environment.xml
  file to 39 and 310. Instead, a note has been added to MDL-71747
  in order to get rid of that check for 4.1 and up.
2022-01-21 19:47:55 +01:00
Eloy Lafuente (stronk7)
d2ad5e8461 MDL-73523 libraries: openssl_free_xxx() methods are deprecated in php80
So we are putting them under a standard PHP_MAJOR_VERSION < 8 condition.

Also, added TODO comments to remember to delete that block of code when
php80 becomes the minimum required versions in the future (Moodle 4.3?).

When possible, an issue has been created upstream, else a comment in
readme_moodle files has been added.

Finally, when the keys being freed were class or object attributes, also
nullify them (but when the calls were part of destructor methods).
2022-01-20 14:48:22 +01:00
Eloy Lafuente (stronk7)
0c53a3dec8 MDL-73476 phpunit: events, external and search tescase names
All events_test, external_test and search_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 lib/external/tests/external_test.php:
- external is not a valid component
- hence, its only valid namespace is "core"
- also, it's testing lib/external/externallib.php
- hence, the file (and class) have been renamed to external_externallib_test.php
  (to avoid conflicts with other external_test that may exist in core)
2022-01-14 16:18:39 +01:00
Eloy Lafuente (stronk7)
0098ebccbf MDL-73502 libraries: Avoid uses of get_magic_quotes_xxx() functions
They were deprecated in PHP 7.4 (warning) and have been removed in
PHP 8.0 (error). Plus they were returning false since ages ago (PHP
5.x).

Hence, adding conditional check to see if they are available (h5p
editor) or removing the unreachable code-block when they evaluated
to true.

Also, modified the corresponding moodle_readme files to document
the change.
2022-01-07 00:40:46 +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
Jun Pataleta
80c17cd2a0 Merge branch 'MDL-72701-master' of https://github.com/andrewnicols/moodle 2021-12-23 12:10:46 +08:00