3143 Commits

Author SHA1 Message Date
Andrew Nicols
2f27619ffe
Merge branch 'MDL-83226-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-11-21 11:45:11 +08:00
Andrew Nicols
c6942c9bb7
MDL-81521 core: Update all possibly data providers to be static
Note: Some data providers could not be automatically be converted to
being static. These will be handled in a separate issue.
2024-11-18 10:24:55 +08:00
Paul Holden
ad201ba85a
MDL-83226 customfield: set backup/restore configuration defaults. 2024-11-04 15:29:17 +00:00
Jun Pataleta
7b007b32af
Merge branch 'MDL-83463-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-10-23 14:35:39 +08:00
Paul Holden
34495e01fc
MDL-83463 backup: ensure defaults for course file inclusion are read. 2024-10-15 12:27:17 +01:00
Tim Hunt
a9d4d93b74 MDL-83070 question restore: recode links in hints 2024-10-07 08:53:58 +01:00
Jun Pataleta
c187fde227
Merge branch 'MDL-80929-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-09-27 12:40:18 +08:00
Tim Hunt
26af25312c MDL-77625 question restore: fix restore of existing questions
Continuing from the last commit, the code to restore question
bank entries, versions and questions, was not taking note of
whether the first stage had indentified questions that did not
need to be restored. This is tricky, but the mapping can only be
worked out for questions, but in the backup file, the questions are
inside the question_bank_entries, and versions, so we encounter
those first.

Now, the code just saves the QBE and QV when it encounters them,
and then does all the processing when it gets to the question,
correctly taking note of whether each question should be restored or not.
In cases where a particular question does not need to be restored,
we still set up the corresponding mappings.
2024-09-17 16:17:35 +01:00
Tim Hunt
64c54d9510 MDL-77625 question restore: fix pre-parsing of questions
Restore of categories and questions happens in several phases.
First, the file is scanned for which questions and categories
it contains, to work out if these are new questions which need
to be restored, or if they already exist in the database in a
place that can be used.

That code had not been updated to cope with the Moodle 4.0
versioning changes, so it is updated here (while still keeping
the code to cope with the old backup format.)
2024-09-17 16:17:34 +01:00
Paul Holden
89506cd08d
MDL-80929 customfield: observe backup/restore settings to include. 2024-09-03 13:56:27 +01:00
Paul Holden
e8c5f37306
MDL-80929 restore: consistent settings definition for custom fields. 2024-09-03 13:49:56 +01:00
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