3132 Commits

Author SHA1 Message Date
Paul Holden
ddd99c03d2
MDL-82220 group: check valid mapping when restoring custom fields. 2024-08-16 10:09:04 +01:00
Paul Holden
8aa860d7b7
MDL-82220 backup: ensure correct group/ing custom fields are included.
We should include only the custom field values that belong to those
groups and/or groupings that are being backed up.
2024-08-16 10:09:04 +01:00
Paul Holden
ee502bf6b5 MDL-81394 restore: format backup file metadata details safely. 2024-08-07 14:04:30 +08:00
Paul Holden
23a61db0f0 MDL-82392 blocks: consistent cleaning of block instance names. 2024-08-07 04:13:49 +00:00
Huong Nguyen
23ba4d1792
Merge branch 'MDL-82245-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-11 11:14:07 +07:00
Huong Nguyen
799e5c9ecc
Merge branch 'MDL-79717-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-11 09:35:15 +07:00
Paul Holden
2196813e1e
MDL-79717 phpunit: ensure unique data provider keys in tests.
Duplicate data provider keys were overwriting and/or duplicating
one another, leading to some cases being skipped.

Other "duplicate array key" errors were picked up by `phpcs` in
this dragnet across all tests, which have also been fixed.
2024-07-10 14:08:52 +01:00
Sara Arjona
d6fbf5661a
Merge branch 'MDL-82310-404' of https://github.com/ferranrecio/moodle into MOODLE_404_STABLE 2024-07-09 08:54:54 +02:00
ferranrecio
c35610502f MDL-82310 backup: fix delegated section restore 2024-07-03 18:26:01 +02:00
Paul Holden
75791eabea
MDL-82245 restore: use translated lang string in page heading. 2024-06-28 10:03:09 +01:00
Paul Holden
6b01e331e6
MDL-82315 backup: account for null course section sequence value. 2024-06-27 23:34:48 +01:00
Luca Bösch
18bf9704e7 MDL-82008 backup: Format 'Continue' and 'Cancel' button to have a margin 2024-06-21 09:37:02 +02:00
Eloy Lafuente (stronk7)
1093256560
MDL-81522 phpunit: Add missing void return type to all tests
While this change is not 100% required now, it's good habit
and we are checking for it since Moodle 4.4.

All the changes in this commit have been applied automatically
using the moodle.PHPUnit.TestReturnType sniff and are, exclusively
adding the ": void" return types when missing.
2024-06-11 12:18:04 +02:00
Jun Pataleta
2630591338
MDL-81631 backup: Simplify logic using null coalescing operator 2024-06-06 22:06:27 +08:00
Jun Pataleta
e00e4487a4
Merge branch 'MDL-81631_404' of https://github.com/santoshndev/moodle into MOODLE_404_STABLE 2024-06-06 22:06:27 +08:00
Eloy Lafuente (stronk7)
b2a485e244
MDL-81698 phpunit: Apply various fixes towards 1by1 execution
The changes here are heterogeneous:
- Include stuff that is not available (other test has included it).
  Sometimes local to a unit test, others in setupBeforeClass() or
  globally, ... depends on every case.
- Rename some tests (namespaces, test name, ...) towards getting it
  running.
- Amend small bits here and there.

Important note: I've left any "cosmetic" warning out from the
changes, only a few errors (like long array syntax) have been fixed.
2024-05-25 17:19:52 +02:00
Santosh Nagargoje
2fcd7f93b9 MDL-81631 backup: Added null parameter fix 2024-05-21 17:06:21 +05:30
Eloy Lafuente (stronk7)
1dbc78253c
MDL-81581 phpunit: Apply the new method to all remaining cases
After discussing it in the issue, we have agreed to apply
the new phpunit_util::normalise_line_endings() method to
all the remaining cases (within tests!) where the manual
replacement was being done. This commits achieves that.

Note that I've looked for both str_replace() and preg_replace()
cases, but only the former had cases worth converting. All the
later ones are different and cannot be replaced by the new
utility method.
2024-04-25 18:52:25 +02:00
Huong Nguyen
56ea31a508
Merge branch 'MDL-81553' of https://github.com/aolley/moodle 2024-04-18 22:36:20 +07:00
Jun Pataleta
a180dba314
MDL-81549 versions: bump all versions and requires near release 2024-04-17 00:03:29 +08:00
Adam Olley
4fa4bb7f72 MDL-81553 phpunit: Move controller->destroy() to after its needed
We need to cleanup the controller _after_ we're using the step related
to it. Destroying it before reintroduces the original issue from
MDL-80553.
2024-04-16 11:50:14 +09:30
Jun Pataleta
3856addfdd
Merge branch 'MDL-67667-main' of https://github.com/andrewnicols/moodle 2024-04-12 12:41:39 +08:00
Andrew Nicols
6f1df841f7
MDL-67667 core: Deprecate and removal task blocking
There are inherent issues with task blocking which mean that it has
never worked properly. It is also very buggy and can lead to massive
performance issues with task processing.

It is almost impossible to deprecate this in a staged fashion because
various APIs use the methods and it is not possible to determine which
are API uses and which are other valid uses.

In reality there has been little-to-no uptake on the use of this feature
and it should just be removed.
2024-04-12 12:34:20 +08:00
Tomo Tsuyuki
f119c5a3fe MDL-78902 quiz restore: fix restore of 3.x backups with random questions
... where the random questions come from the quiz module context.

Co-authored-by: Tim Hunt <T.J.Hunt@open.ac.uk>
2024-04-11 22:09:28 +01:00
Sara Arjona
099ceb42a0
Merge branch 'MDL-81456-main' of https://github.com/andrewnicols/moodle 2024-04-08 16:11:26 +02:00
Eloy Lafuente (stronk7)
ed84111010
MDL-81462 phpunit: Add missing controller->destroy()
So we ensure that all file descriptors and backup temp structures
are properly closed and cleaned up.
2024-04-08 08:57:31 +02:00
Andrew Nicols
2b49ad42f5
MDL-81456 core: Use DI for all hook access
Using DI for all hook access means that it becomes significantly easier
to mock hooks and callbacks for unit testing without fundamentally
altering the structure of the code purely for the purposes of unit
testing.
2024-04-08 09:35:41 +08:00
Huong Nguyen
db360850b9
Merge branch 'MDL-77779-main' of https://github.com/ilyatregubov/moodle 2024-04-03 09:12:13 +07: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
Ilya Tregubov
e21f08abcf MDL-77779 competency: Fix course restore from older backups.
overridegrade might be not set if Moodle < 4.1
2024-03-14 09:28:29 +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
Sara Arjona
c799ea5e21
MDL-69656 backup: Remove illegal whitespaces 2024-03-07 12:01:35 +01:00
Jun Pataleta
f364dd5e40
Merge branch 'MDL-81044-main' of https://github.com/andrewnicols/moodle 2024-03-07 11:02:05 +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
Stefan Hanauska
a0d501463a MDL-69656 backup: Replace urlencoded pluginfile urls 2024-03-06 07:37:17 +01:00
Sara Arjona
b25d295d3a
Merge branch 'MDL-80553-main' of https://github.com/ferranrecio/moodle 2024-03-04 16:13:11 +01: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
Eloy Lafuente (stronk7)
29a541724f
MDL-65292 style: Fix all the function declaration ordering
This has been generated running the following Sniff,
part of the Moodle's CodeSniffer standard:
- PSR2.Methods.MethodDeclaration

It just ensures all the function declarations have
the correct order for:
- abstract and final.
- visibility (public, protected, private).
- static.

So, all the lines modified by this commit are function declarations
and the only changes are in the positions of those keywords.
2024-02-28 23:47:47 +01: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
Andrew Nicols
62ae5b6175
MDL-81044 backup: Use varidic to exclude events instead of an array 2024-02-27 11:40:56 +08:00
Andrew Nicols
275e5f9412
MDL-81044 backup: Coding style fixes 2024-02-27 11:40:55 +08:00
Andrew Nicols
7b63a6864a
MDL-81044 backup: Prevent parameter bleed between readers
These parameters were re-used between array iterations, but some of the
values were modified during the iteration.
2024-02-27 11:40:55 +08:00
Andrew Nicols
5109761162
MDL-81044 backup: Rename excluded events hook to meet style 2024-02-27 11:40:55 +08:00
Paul Holden
bb6652699e
Merge branch 'MDL-75794-main' of https://github.com/aanabit/moodle into main 2024-02-23 12:54:00 +00:00
Amaia Anabitarte
0c081f004a MDL-75794 mod_data: deprecate behat steps to generate entries and fields 2024-02-22 17:37:54 +01:00
Alexander Van der Bellen
0aea55c3e6 MDL-79151 backup: Add custom field backup and restore API 2024-02-20 15:28:28 +08:00