2549 Commits

Author SHA1 Message Date
Jake Dallimore
86f08a393f MDL-74221 enrol_lti: db changes supporting draft registrations
Summary:
- Allows nulls for a number of fields meaning largely empty drafts can
be stored.
- Adds 'uniqueid', an id unique to each issuer which is intended
to be used as a parameter in both the initiate login and dynamic
registration urls provided to platforms, as a means to identify specific
registrations for the issuer, in the absense of client_id (optional in
the 1.3 spec).
- Add 'status', used to denote draft or active registrations.
2022-03-24 14:12:24 +08:00
Víctor Déniz
7a65b2a3c7 Merge branch 'MDL-74288-master' of https://github.com/snake/moodle 2022-03-23 15:25:38 +00:00
Jake Dallimore
afbf15cd97 MDL-74288 enrol_lti: fix cross-origin postMessage call in registration
This isn't using the targetOrigin, which should be passed as 2nd param.
2022-03-22 11:06:23 +08:00
Sara Arjona
375cdaa6a5 Merge branch 'MDL-73950-master' of https://github.com/snake/moodle 2022-03-21 15:38:21 +01:00
Jun Pataleta
d93739be3f Merge branch 'MDL-73520_replace-deprecated-php_errormsg-with-error_get_last' of https://github.com/ziegenberg/moodle 2022-03-10 12:28:28 +08:00
Eloy Lafuente (stronk7)
a5c91474ee MDL-71807 cleanup: Replace deprecated codingStandardsIgnore annotations
The PHP_CodeSniffer @codingStandardsIgnore annotations are deprecated
and, since version 3.x, the new // phpcs:ignore comments should be used
instead.

This commits just reviews all the uses in core, replacing them for
the better new candidate, or removing when no longer needed.
2022-03-08 10:48:53 +01:00
Daniel Ziegenberg
f60f6dfade
MDL-73520 general: replace deprecated php_errormsg with error_get_last()
For a better PHP8 compatibility this commit replaces the deprecated $php_errormsg
with error_get_last().

The PHP 8.0 migration guide (https://www.php.net/manual/de/migration80.incompatible.php) says:
    The track_errors ini directive has been removed.
    This means that php_errormsg is no longer available.
    The error_get_last() function may be used instead.
Also the documentation on $php_errormsg (https://www.php.net/manual/en/reserved.variables.phperrormsg.php) says:
    This feature has been DEPRECATED as of PHP 7.2.0.
    Relying on this feature is highly discouraged.
    Use error_get_last() instead.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2022-03-05 14:19:48 +01: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
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