2696 Commits

Author SHA1 Message Date
Sara Arjona
4dbeaddc5f
Merge branch 'MDL-81457-main' of https://github.com/andrewnicols/moodle 2024-04-23 14:56:31 +02:00
Jun Pataleta
78e5814a0f
MDL-81616 upgrade: add the 4.4.0 separation line to all upgrade scripts 2024-04-20 21:01:04 +08:00
Jun Pataleta
9966241efb
Merge branch 'MDL-81525-main' of https://github.com/andrewnicols/moodle 2024-04-17 23:42:22 +08:00
Jun Pataleta
a180dba314
MDL-81549 versions: bump all versions and requires near release 2024-04-17 00:03:29 +08:00
Andrew Nicols
27a6eb0126
MDL-81525 coer_enrol: Use stoppable trait for consistency 2024-04-15 13:05:10 +08:00
Andrew Nicols
d602b7d3e3
MDL-81525 core_enrol: Add missing docs 2024-04-15 13:05:10 +08:00
Andrew Nicols
a3036b79e1
MDL-81525 core_enrol: Add missing user tag to hook 2024-04-15 13:05:10 +08:00
Andrew Nicols
a7aedc7c2f
MDL-81525 core_enrol: Correct hook name tense 2024-04-15 13:05:09 +08:00
Andrew Nicols
8acda4e048
Merge branch 'MDL-70829-main' of https://github.com/junpataleta/moodle 2024-04-12 11:58:32 +08:00
Jun Pataleta
0234499035
MDL-70829 enrol_manual: Mark up decorative image properly
* An empty alt text is enough for decorative images. There's no need
  to set a presentation role.
2024-04-12 10:42:11 +08:00
Huong Nguyen
c9a26138a2
Merge branch 'MDL-81420-main' of https://github.com/sarjona/moodle 2024-04-12 08:33:47 +07:00
Ilya Tregubov
160277d17c Merge branch 'MDL-81491-main' of https://github.com/snake/moodle 2024-04-11 09:52:04 +08:00
Jake Dallimore
1826c5e1d4
MDL-81491 enrol_lti: fix incorrect login_hint parameter type validation
This was always bad, but since we only used it to verify the existence
of the param, and let library code take $_REQUEST for the real
validation, it was ok. Now, since we're redirecting to self during
necessary cookie checks added by MDL-80835, we lose the real value
originally stored in $_REQUEST. This patch just fixes the param type,
setting it to raw, which is what it should have used originally. The
raw value won't be cast from a string to an int as part of the
require_param call, so the value won't be lost any more.
2024-04-10 17:41:50 +08:00
Huong Nguyen
ca449af186
Merge branch 'MDL-81351-main-enfix' of https://github.com/mudrd8mz/moodle 2024-04-10 13:54:56 +07:00
Sara Arjona
e42e16d8ba
MDL-81420 enrol: Remove duplicated header in editing form 2024-04-09 15:27:51 +02:00
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
Andrew Nicols
5b9fdc0e9a
MDL-81457 core: Do not mark tests as Incomplete when they are wrong
This check was marking a test as Incomplete if there was a bug in any
part of the test, rather than failing the test in such a way that the
test bug may be found.

https://docs.phpunit.de/en/9.6/incomplete-and-skipped-tests.html
2024-04-08 08:45:27 +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
David Mudrák
eecbf7b18b MDL-81351 lang: Use the fixed strings in the tests, too 2024-03-28 10:19:40 +01: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
Helen Foster
dccc91f4bc MDL-81351 lang: Import fixed English strings (en_fix) 2024-03-26 23:13:15 +01: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