3635 Commits

Author SHA1 Message Date
Huong Nguyen
bc6795074d
Merge branch 'MDL-81000-main2' of https://github.com/raortegar/moodle 2024-03-28 08:53:50 +07:00
Sara Arjona
e47b78e870
Merge branch 'MDL-80612-posix-auth' of https://github.com/brendanheywood/moodle 2024-03-27 15:58:48 +01:00
raortegar
8698a9a229 MDL-81000 core: Update "attemptsavailable" value and remove "MAX_RETRY" 2024-03-27 14:00:52 +01:00
Brendan Heywood
2d286ef8f8 MDL-80612 auth: Allow plugins to identify Moodle users on the CLI 2024-03-27 21:58:04 +11:00
Ilya Tregubov
24347e3309 Merge branch 'MDL-80828-main' of https://github.com/roland04/moodle 2024-03-27 11:14:02 +08:00
Andrew Nicols
c9030a8243
Merge branch 'MDL-80332-master' of https://github.com/jleyva/moodle 2024-03-26 22:10:29 +08:00
Jun Pataleta
556347c4f1
Merge branch 'MDL-81266' of https://github.com/stronk7/moodle 2024-03-26 10:34:47 +08:00
Eloy Lafuente (stronk7)
4c2f8b3a91
MDL-81266 phpunit: Remove expect(Deprecation|Notice|Warning|Error)
PHPUnit 9.6 has deprecated all the expect(Deprecation|Notice|Warning|Error)
assertions, so we have to move away from them.

In core, we only had 2 cases, one easily fixed by getting rid of it,
because, for php >= 80 it's an assert-able exception.

And the other replaced with code that, temporarily, sets a custom
error handler that converts any specified E_ to an asset-able
exception.

Note that tests playing with error handlers should, always, be
run in separate process, to avoid problems or conflicts with
PHPUnit / Moodle own error handlers.
2024-03-25 16:21:53 +01: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
Juan Leyva
8b30632b31 MDL-80332 tool_mobile: Fallback por app launches 2024-03-25 15:48:40 +01:00
Mikel Martín
cd8a089d7a MDL-80828 core_courseformat: Modify availability subpanel visibility
In the activity action menu, show only the subpanel when the options are different
than show or hide. In those cases the show/hide option will be directly displayed
in the menu instead of a subpanel.

Co-authored-by: ferran@moodle.com
2024-03-25 13:54:42 +01:00
Ilya Tregubov
d1a34c7d23 Merge branch 'MDL-63128-main' of https://github.com/meirzamoodle/moodle 2024-03-25 14:23:53 +08:00
meirzamoodle
b7452d44de MDL-63128 core: Add support for use redis cluster as session handler
Co-authored-by: Avi Levy <avi@sysbind.co.il>
2024-03-25 12:47:40 +07:00
Andrew Nicols
f1718680ce
MDL-81074 core: Simplify strftime tests 2024-03-25 09:51:25 +08:00
Luca Bösch
b2af5134b8
MDL-81074 core: align core_date::strftime results for numeric and string 2024-03-25 09:51:25 +08:00
Jun Pataleta
b690ef2429
Merge branch 'MDL-81313-main' of https://github.com/snake/moodle 2024-03-22 11:47:56 +08:00
Ilya Tregubov
9f10899178 Merge branch 'MDL-80099_main' of https://github.com/marxjohnson/moodle 2024-03-22 11:07:55 +08:00
Ilya Tregubov
df7167a57a Merge branch 'MDL-81023-main' of https://github.com/aanabit/moodle 2024-03-22 09:22:19 +08:00
Ilya Tregubov
59d44c30a5 Merge branch 'MDL-80715-main' of https://github.com/ferranrecio/moodle 2024-03-22 09:17:55 +08:00
Sara Arjona
1e1d6d8be8
Merge branch 'MDL-71734' of https://github.com/paulholden/moodle 2024-03-21 16:11:40 +01:00
Sara Arjona
f54c1b9293
Merge branch 'MDL-69688' of https://github.com/stronk7/moodle 2024-03-21 15:29:47 +01:00
Amaia Anabitarte
e0a482e3b3 MDL-81023 core_course: Move deprecated behat steps to course directory 2024-03-21 12:47:58 +01:00
Paul Holden
011619dbd3
MDL-71734 lang: final removal of deprecated 400 strings. 2024-03-21 09:44:15 +00:00
Eloy Lafuente (stronk7)
0f3775088f
MDL-69688 phpunit: Improve test_context_not_used
This adds a few changes to the old test_context_not_used test:

- Move it to become an advanced_test, because its mission
  is to verify that the assertEventContextNotUsed() assertion
  works as expected.
- For consistency, also move the fixtures to own phpunit fixtures.
- Add proper coverage tags, to verify that the assertion is being
  covered.
- Add a data provider to provide all the current cases and ease
  any future case that may be needed in the future. One by one
  because previously there was code never executed with the
  warning expectation causing the test to stop.
- Run them in isolation, while this is not strictly required, it's
  including external fixtures and, we'll need that isolation soon
  (for changes coming when moving the test to PHPUnit 9.6 in MDL-81266).
2024-03-21 08:31:08 +01:00
Jake Dallimore
0255500247
MDL-81313 core: Revert "Merge branch 'MDL-80338'
This reverts commit 40f501fb4e8ccad7eaacde873bf8fa809df192c5, reversing
changes made to 3061024726abdd5581d90e3a589c38b01eb533a2.
2024-03-21 11:03:25 +08:00
Ilya Tregubov
45750b413e Merge branch 'MDL-81050-main' of https://github.com/roland04/moodle 2024-03-21 10:52:39 +08:00
Ferran Recio
fbbb86a2a6 MDL-80715 core_courseformat: delegate section and cm rename 2024-03-20 16:51:12 +01:00
Mark Johnson
788556f652
MDL-80099 hooks: Add mechanism to deprecate class callbacks 2024-03-20 14:58:16 +00:00
Mikel Martín
dba1efa28e MDL-81050 navigation: Add data attributes to sections in breadcrumbs
- Add a new method 'add_attribute' to navigation nodes to add HTML attributes to nodes.
- Add data-attribute to section nodes and include them in breadcrumb mustache to automatically update section titles
 when sections are renamed.
2024-03-19 08:53:49 +01:00
Jun Pataleta
b7cf80a244
Merge branch 'MDL-80279' of https://github.com/pedrojordao/moodle 2024-03-18 11:22:57 +08:00
Pedro Jordao
da16de2496 MDL-80279 core: Set new attributes for user profile initials
When the user does not have a profile photo and initials are displayed,
there is no alt text for the initials which causes accessibility
issues, so with this change I added the user's full name to the title
and aria-label attributes and I set a role='img' when the element span
is rendered.
2024-03-15 07:31:56 -03:00
Jake Dallimore
e97ce38e18
Merge branch 'MDL-80167-main-int' of https://github.com/HuongNV13/moodle 2024-03-15 12:54:24 +08:00
Jake Dallimore
93aa177f11
Merge branch 'MDL-81180-main' of https://github.com/andrewnicols/moodle 2024-03-15 10:27:51 +08:00
Huong Nguyen
699a0e9328 MDL-80167 core: Skip Oracle for Oracle environment in unit tests 2024-03-15 08:45:42 +07:00
Huong Nguyen
6a19d3289b MDL-80167 admin: Add environment check for Oracle database 2024-03-14 17:41:56 +07:00
Jun Pataleta
a0e333fb7c
Merge branch 'MDL-80896-main' of https://github.com/andrewnicols/moodle 2024-03-12 11:38:26 +08:00
Andrew Nicols
9cdc5850c5
Merge branch 'MDL-75952' of https://github.com/stronk7/moodle 2024-03-12 10:45:02 +08:00
Andrew Nicols
ad9322aba2
MDL-80677 core: Deprecation attribute can apply to interfaces and traits 2024-03-12 09:49:02 +08:00
Andrew Nicols
f09d886f11
MDL-80677 core: deprecation::from should always return 2024-03-11 21:48:32 +08:00
Andrew Nicols
57ec38d136
MDL-80677 core: Move deprecated attributes to \core\attribute NS
Note: Removing the manual require for the attribute from moodlelib
because the class does not have to exist at time of definition, only
when the Reflection API instantiates an instance in \core\deprecation,
by which point the autoloader is available.
2024-03-11 21:48:32 +08:00
Andrew Nicols
807da4963b
MDL-80677 core: Any feature of a deprecated class should emit 2024-03-11 21:28:50 +08:00
Andrew Nicols
d6112c0bfb
MDL-80677 core: Get deprecated item description automatically 2024-03-11 21:28:48 +08:00
Andrew Nicols
bbc98c82c0
MDL-81180 core: Add support for array notation in hook callback 2024-03-11 16:49:54 +08:00
Andrew Nicols
6231d9119d
MDL-81180 core: Fix coding violations in hook manager tests 2024-03-11 16:49:54 +08: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
Sara Arjona
6f81ace5a8
Merge branch 'MDL-81011-main' of https://github.com/andrewnicols/moodle 2024-03-07 12:20:01 +01:00
Andrew Nicols
2b7754ccc2
MDL-81011 core: Add attribute alternative to hooks interfaces
This change replaces the requirement for:
- \core\hook\deprecated_callback_replacement
- \core\hook\described_hook

These are replaced by appropriate Attributes.
2024-03-07 18:56:05 +08:00
Andrew Nicols
94177ec2da
MDL-80749 core: Tidy up task tests 2024-03-05 21:18:54 +08:00