2678 Commits

Author SHA1 Message Date
Jake Dallimore
4c2b9f55f0
Merge branch 'MDL-81405-master' of https://github.com/jleyva/moodle 2024-04-08 15:35:00 +08:00
Ilya Tregubov
84b1cbd474 Merge branch 'MDL-81409-main' of https://github.com/snake/moodle 2024-04-08 12:44:45 +08:00
Juan Leyva
e09930bab6 MDL-81405 session: New core cookie helper utility class 2024-04-06 12:20:59 +02:00
Huong Nguyen
097a6d46e0
MDL-4188 enrol_self: Send course welcome message on enrolment
Including in this commit:
 - Use language strings from core_enrol to match with enrol_manual
 - Minor update for UI so Custom welcome message text area
   will not be shown if the Send course welcome message is
   set to No
 - enrol_self now using Hook API to send the welcome message
 - enrol_self_plugin::email_welcome_message() has been deprecated
 - Added Behat test to test the welcome message
2024-04-04 20:13:46 +07:00
Huong Nguyen
b6af21bec0
MDL-4188 enrol_manual: Send course welcome message on enrolment
AMOS BEGIN
  CPY [customwelcomemessage,enrol_self],[customwelcomemessage,core_enrol]
  CPY [customwelcomemessage_help,enrol_self],[customwelcomemessage_help,core_enrol]
AMOS END
2024-04-04 20:13:46 +07:00
Huong Nguyen
f53b0b84d2
MDL-4188 core_enrol: Added enrol_plugin::get_welcome_message_contact()
Including in this commit
 - enrol_self_plugin::get_welcome_email_contact() has been deprecated
2024-04-04 19:45:17 +07:00
Jake Dallimore
334ec98980
MDL-81409 enrol_lti: fixes to dynamic registration to support Blackboard
The following fixes resolve issues when used with Blackboard Learn:
- Set registration request Content-Type header to application/json
- Make registration_token optional, per the spec:
https://www.imsglobal.org/node/200666#step-1-registration-initiation-request
- Conditionally create the deployment since it's optional in
lti-tool-configuration:
https://www.imsglobal.org/node/200666#lti-configuration-0
- Remove empty custom_parameters property, since that's optional too:
https://www.imsglobal.org/node/200666#lti-configuration-0
- Remove overly-strict validation on registration_token. This was
validating the param as a JWT, but since the spec has stabilised, this
is not always the case. It's a Bearer token that's opaque to the tool
(i.e. it's just passed back unmodified), so while it could be validated
against RFC6750, it's simplest to just remove the validation entirely.
- change targetOrigin of the postMessage to '*' as per the spec:
https://www.imsglobal.org/node/200666#step-4-registration-completed-and-activation
2024-04-03 15:27:24 +08:00
Huong Nguyen
61c8cdaf11
Merge branch 'MDL-81365-main' of https://github.com/ilyatregubov/moodle 2024-03-28 14:31:16 +07:00
Huong Nguyen
1320a2a397
Merge branch 'main_MDL-81172' of https://github.com/mattporritt/moodle 2024-03-28 11:46:51 +07:00
Ilya Tregubov
6f41a2fbfd MDL-81365 enrol: Fix wrong validation. 2024-03-27 15:42:20 +08:00
Jun Pataleta
35dcf18395
Merge branch 'MDL-80875-main' of https://github.com/sarjona/moodle 2024-03-26 12:05:40 +08:00
Huong Nguyen
b283ca354e
Merge branch 'MDL-78551-main' of https://github.com/safatshahin/moodle 2024-03-26 10:08:06 +07:00
Safat
968897b653 MDL-78551 core_enrol: Add support for hooks api 2024-03-26 13:53:39 +11:00
Daniel Ziegenberg
08027e408c
MDL-81281 phpunit: assertObjectHasAttribute is deprecated
To be integrated as part of MDL-81266

When running PHPUnit 9.6 we get the following deprecation warnings:
"assertObjectHasAttribute() is deprecated and will be removed in PHPUnit
10. Refactor your test to use assertObjectHasProperty() instead."

So we replace all instances of assertObjectHasAttribute with
assertObjectHasProperty.

PHPUnit justifies the change with:
> PHPUnit currently refers to "fields" (see above) as "attributes". This
> is (or will become) confusing considering the introduction of
> attributes in PHP 8 and their support in PHPUnit.  PHPUnit will be
> changed to use the term "property" instead of "attribute" where "field"
> is meant.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2024-03-25 16:21:45 +01:00
Daniel Ziegenberg
87267da39d
MDL-81281 phpunit: assertObjectNotHasAttribute is deprecated
To be integrated as part of MDL-81266

When running PHPUnit 9.6 we get the following deprecation warnings:
"assertObjectNotHasAttribute() is deprecated and will be removed in PHPUnit
10. Refactor your test to use assertObjectNotHasProperty() instead."

So we replace all instances of assertObjectNotHasAttribute with
assertObjectNotHasProperty.

PHPUnit justifies the change with:
> PHPUnit currently refers to "fields" (see above) as "attributes". This
> is (or will become) confusing considering the introduction of
> attributes in PHP 8 and their support in PHPUnit.  PHPUnit will be
> changed to use the term "property" instead of "attribute" where "field"
> is meant.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2024-03-25 16:21:07 +01:00
Sara Arjona
2fecfa597b
MDL-80875 uploadcourse: Fix params validation 2024-03-25 08:09:19 +01:00
Jake Dallimore
35e82b9fad
MDL-80835 enrol_lti: add partitioning support for OIDC state cookie
Adds the property that is required by Chrome to opt-in to its 3rd party
cookie partitioning solution, CHIPS. This specific change ensures the
'state' cookie, used in the OIDC handshake, has partitioning support.
This cookie can be partitioned unconditionally, since it's a cookie
controlled by the library and one we don't expect to be set without
partitioning elsewhere.
2024-03-21 15:35:48 +08:00
Jake Dallimore
aea624fcb0
MDL-80835 enrol_lti: add cookies required notice to auth login endpoint
This will be displayed if the cookie checks fail, which currently occurs
in Safari only.
2024-03-21 15:35:48 +08:00
Jake Dallimore
b293cb5da6
MDL-80835 enrol_lti: add partitioning support to MoodleSession cookie
Adds the property that is required by Chrome to opt-in to its 3rd party
cookie partitioning solution, CHIPS. This specific change deals with the
cookie that is set when the user is not yet auth'd with the site and is
necessary to facilitate OIDC nonce retrieval and validation.
2024-03-21 15:35:48 +08:00
Matt Porritt
5d74f366a0 MDL-81172 Backup: Async Backup on by default from install
Enable asynchronous backup and restore on new site install.
Existing behaviour is not changed for sites being upgraded.
Behat tests have been set to use synchronous mode.
2024-03-18 12:01:50 +11:00
Eloy Lafuente (stronk7)
361dfe8145
MDL-75952 general: Since php81, refection->setAccessible() is no-op
Refereces:
- https://wiki.php.net/rfc/make-reflection-setaccessible-no-op
- https://www.php.net/manual/en/reflectionproperty.setaccessible.php
- https://www.php.net/manual/en/reflectionmethod.setaccessible.php

As of PHP 8.1.0, calling this method has no effect; all methods are
invokable by default. So, let's remove all uses from core, they are
no-op.
2024-03-10 21:15:00 +01:00
Jun Pataleta
3278ce7aba
Merge branch 'MDL-65292' of https://github.com/stronk7/moodle 2024-03-08 08:00:41 +08:00
Ilya Tregubov
cd85552e38 Merge branch 'MDL-80460-main' of https://github.com/sarjona/moodle 2024-03-07 08:41:42 +08:00
Sara Arjona
fed26847b4
MDL-80460 behat: Fix tests to replace Topic with Section
The behat tests using the course format topics have been reviewed to:
- Add the 'inisections' parameter where necessary, facilitating automatic
renaming of section names.
- Evaluate failing tests due to slight changes in ordering. Notably, in
the topics format, sections are now uniformly named 'New section' without
any numbering.
2024-03-06 15:25:22 +01:00
Andrew Nicols
928344403d
Merge branch 'MDL-79675-main-v6' of https://github.com/snake/moodle 2024-03-06 13:00:00 +08:00
Jake Dallimore
c043c180de
MDL-79675 enrol_lti: fix mocks depending on previously untyped props
When $launch_id wasn't typed, it was ok to call the getter, but now
that it is, php throws an error. Replaced with stub method.
2024-03-06 08:44:14 +08:00
Jake Dallimore
4fda419e88
MDL-79675 enrol_lti: fix class instantiation after library upgrade 2024-03-06 08:44:14 +08:00
Jake Dallimore
7c9fb5d89b
MDL-79675 enrol_lti: fix client implementation signatures after upgrade
Not strictly required due to contravariance, but nice for readability.
2024-03-06 08:44:14 +08:00
Jake Dallimore
73ce114066
MDL-79675 enrol_lti: fix deep linking return after library removals 2024-03-06 08:44:14 +08:00
Jake Dallimore
2a783ec964
MDL-79675 enrol_lti: fix JWKS generation after library removals 2024-03-06 08:44:14 +08:00
Jake Dallimore
eb94b5677c
MDL-79675 enrol_lti: fix login redirection after library deprecations
v5.7.0 changed this process. Now, we just fetch the URL and do our own
redirect.
https://github.com/packbackbooks/lti-1-3-php-library/releases/tag/v5.7.0
2024-03-06 08:44:14 +08:00
Jake Dallimore
f7c12a372d
MDL-79675 enrol_lti: migrate validate() calls to initialize() per v6.0.0
Calls to validate() have been replaced in v6.0.0.
https://github.com/packbackbooks/lti-1-3-php-library/releases/tag/v6.0.0
2024-03-06 08:44:14 +08:00
Jake Dallimore
7560375ad6
MDL-79675 enrol_lti: replace ImsCookie use with local implementation
The default implementation, previously included with the library, is no
longer shipped there. Clients must provide their own implementation of
the ICookie interface instead.
2024-03-06 08:44:14 +08:00
Sara Arjona
e1034deb8b
Merge branch 'MDL-75670-main' of https://github.com/roland04/moodle 2024-03-04 16:05:18 +01:00
Mikel Martín
d0d62fd06c MDL-75670 theme: Refactor form-inline helper class dropped in BS5
- Replace .form-inline Bootstrap helper class with .d-flex.flex-wrap.align-items-center
- Refactor .form-inline occurrences in SCSS files or remove when unneeded
2024-02-29 13:56:46 +01:00
Mikel Martín
4ce883ae21 MDL-75670 theme: Refactor form-group helper class dropped in BS5
- Replace .form-group Boostrap helper class with .mb-3. The .form-group class was only
adding margin bottom styles, so it is an straightforward change.
- Replace .form-group references in SCSS files with .fitem now .form-group has been removed.
- There were some other .form-group occurrences in the code that were using it not for styling
but incorrectly for managing some logic. These have been also replaced with .fitem or removed.
2024-02-29 13:55:37 +01:00
Víctor Déniz Falcón
14cd15dfab MDL-46886 core_enrol: unenrolment due to inactivity notification 2024-02-29 10:11:35 +07:00
Eloy Lafuente (stronk7)
ba1f804ffa
MDL-65292 style: Fix all function declarations white space
This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing

All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.

Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
2024-02-28 23:33:26 +01:00
Jun Pataleta
457274ab03
Merge branch 'MDL-79003-main' of https://github.com/andrewnicols/moodle 2024-02-21 10:36:21 +08:00
Ilya Tregubov
1c059cb3fe
MDL-80504 forum: Fix seperate group mode 2024-02-08 15:32:31 +08:00
Jun Pataleta
326c5ab3b1
Merge branch 'MDL-80060' of https://github.com/paulholden/moodle 2024-02-05 16:07:03 +08:00
David Woloszyn
4807a4dd5f MDL-43056 tool_uploadcourse: Add capability to upload courses from file
An entrypoint capability has been added that allows accessing the
upload tool. Further relevant capability checks are then performed
depending on the action being taken during the upload process.

Co-authored-by: Marina Glancy <marina@moodle.com>
2024-01-31 11:29:33 +11:00
Andrew Nicols
484da7c0e8
MDL-79003 js: Bump stylelint and components
Stylelint 15 deprecates a heap of rules which will be removed in 16.

We can't use 16 because it's ESM and requires a big restructure of our
build process.

We can temporarily silence the deprecations and then when we update our
build tooling we can make use of @stylistic/stylelint-plugin to add the
rules back.

This commit:
- bumps stylelint and related dependencies accordingly
- fixes issues identified with newer sniffs
- temporarily silences deprecation warnings
2024-01-30 12:19:53 +08:00
Sara Arjona
8b36abdb9d
Merge branch 'MDL-80259-main' of https://github.com/roland04/moodle 2024-01-24 09:16:12 +01:00
Mikel Martín
a198884333 MDL-80259 theme_boost: Refactor badge helper classes for Bootstrap 5 2024-01-23 08:27:23 +01:00
Jun Pataleta
8811491238
Merge branch 'MDL-78219-main' of https://github.com/snake/moodle 2024-01-23 11:59:36 +08:00
Paul Holden
ae4a5864ad
MDL-80060 enrol_manual: correct exception constructor arguments. 2024-01-17 08:57:38 +00:00
Andrew Nicols
b05fc42db9
MDL-80005 core: Emit deprecation notices for params
Most params are formally deprecated here. This was originally planned
for MDL-80042, but I realised that having an emit, and final param is a
very useful option going forward.

This patch also moves the is_deprecated(), and related methods to the
\core\deprecated attribute.
2024-01-17 12:19:45 +08:00
Jake Dallimore
0e74284dfc
MDL-78219 enrol_lti: fix auth method usage in base testcase 2024-01-15 15:41:52 +08:00
Paul Holden
b98fd96084
MDL-71733 behat: final removal of deprecated 400 step definitions. 2024-01-04 12:43:52 +00:00