3102 Commits

Author SHA1 Message Date
Marina Glancy
b88f1a84bf MDL-70901 core: @ no longer masks errors in PHP 8.0 2021-02-22 16:18:46 +01:00
Marina Glancy
3e076d8cff MDL-70901 backup: check handle before calling fclose()
@fclose no longer catches error in PHP 8.0 when handle is null
2021-02-22 16:17:49 +01:00
Marina Glancy
7b003c04a8 MDL-70920 backup: call_user_func_array can accept named arguments
Because arguments names do not match in associative array, we change it to regular array or arguments
2021-02-21 22:19:52 +01:00
Daniel Kristian Steffensen
50b313fc56 MDL-43697 backup: Archived badges are restored during course restore 2021-02-19 15:47:39 +01:00
Víctor Déniz
8a4ce781b9 Merge branch 'master-MDL-70752' of https://github.com/golenkovm/moodle 2021-02-17 16:56:48 +00:00
Jun Pataleta
c8f5e8c7f3 MDL-48269 core_backup: Prevent unwanted group icons from being restored
* Old backups might have hidepicture defined and set to 1 in which case
we must make sure to exclude the group picture for these groups from
being restored.
2021-02-16 22:26:13 +08:00
Frederic Massart
3aed37ee4d MDL-48269 group: Remove the option to hide the picture of a group
Plus additional amendments to Fred's original commit:
1. Updating the version numbers
2. Merging the original two-step upgrade below into one for simplicity:
   1. Deleting the pictures for groups with hidepicture set to 1; and
   2. Dropping the hidepicture field itself.
3. Converted array() usages to the short syntax [].
2021-02-16 12:46:58 +08:00
Marina Glancy
0af0a96bb1 MDL-70898 various: private functions can not be declared final 2021-02-15 16:20:06 +01:00
Mikhail Golenkov
ad9598c758 MDL-70752 restore: Fix remote file recovery 2021-02-04 17:27:54 +11:00
Adrian Perez
9e15569d48 MDL-69202 Restore backup: add getter method for oldmoduleid 2021-01-16 10:25:05 +01:00
Paul Holden
509a0f4d00 MDL-70422 restore: fix for undefined question answer ordering in test. 2020-12-07 10:13:22 +00:00
Mihail Geshoski
c8ac07fb50 MDL-67837 backup: Verify caps before unenrolling users on course restore 2020-11-03 12:34:28 +01:00
Peter Dias
828caaac70 MDL-56310 restore: Confirm user has permission to change capabilities 2020-11-03 12:34:28 +01:00
Paul Holden
eec03671f8 MDL-69156 backup: correct behaviour of course copy idnumber field.
When a given user doesn't have the capability to change the idnumber
field during course copy, freeze the field value.
2020-10-29 14:14:13 +01:00
Adrian Perez
d5ec9d66a4 MDL-69156 course_copy: set defaults for idnumber when not permitted 2020-10-29 14:14:08 +01:00
Luca Bösch
16d5028567 MDL-69995 backup: padding before activity icons. 2020-10-25 02:08:38 +02:00
Eloy Lafuente (stronk7)
3a5641cb74 MDL-67673 phpunit: Remove deprecated assertEquals() params
The optional parameters of assertEquals() and assertNotEquals()
are deprecated in PHPUnit 8 (to be removed in PHPUnit 9):

- delta => use assertEqualsWithDelta()
- canonicalize => use assertEqualsCanonicalizing()
- ignoreCase => use assertEqualsIgnoringCase
- maxDepth => removed without replacement.

More info @ https://github.com/sebastianbergmann/phpunit/issues/3341

Initial search done with:

ag 'assert(Not)?Equals\(.*,.*,' --php

Then, running tests and fixing remaining cases.
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
d95c378771 MDL-67673 phpunit: Remove expectedException annotations
While this is not strictly required, because removal will
happen in PHPUnit 9.0, we are already getting rid of all
uses in core.

From release notes:https://phpunit.de/announcements/phpunit-8.html

The annotations `@expectedException`, `@expectedExceptionCode`,
`@expectedExceptionMessage`, and `@expectedExceptionMessageRegExp`
are now deprecated.
Using these annotations will trigger a deprecation warning
in PHPUnit 8 and in PHPUnit 9 these annotations will be removed.

Also, all uses of expectExceptionMessageRegExp() has been moved
to expectExceptionMessageMatches(). See https://github.com/sebastianbergmann/phpunit/issues/3957

TODO: Various weirdness found while doing the changes with these tests:
- vendor/bin/phpunit lib/tests/exporter_test.php (created MDL-69700)
- vendor/bin/phpunit competency/tests/external_test.php (same issue than prev one)
- vendor/bin/phpunit question/engine/tests/questionengine_test.php (created MDL-69624)
- vendor/bin/phpunit lib/tests/event_test.php (created MDL-69688)
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
f6711bb394 MDL-67673 phpunit: Fix the return type of template methods
All the setup/teardown/pre/post/conditions template methods
now are required to return void. This was warned with phpunit 7
and now is enforced.

At the same time, fix a few wrong function names,
provider data and param types, return statements...
2020-10-21 12:45:59 +02:00
Sara Arjona
66e3cceaa2 Merge branch 'MDL-69900-master' of git://github.com/mihailges/moodle into master 2020-10-19 13:41:51 +02:00
Jake Dallimore
e19669e432 Merge branch 'master_MDL-47178' of https://github.com/golenkovm/moodle 2020-10-16 11:52:09 +08:00
Stephen Bourget
0544ab902d MDL-69900 core_backup: Allow IMSCC v1.0 restore to finish 2020-10-09 09:04:22 +08:00
Mikhail Golenkov
f8d859a685 MDL-47178 question: Retain question authors when restoring backups. 2020-10-06 09:29:18 +11:00
Shamim Rezaie
2c93a1f53c MDL-69649 backup: Fix missing labels
- The backup details page uses a table to show a sumary of the backup
  content. Used role attribute to denote the tabular format of the
  summary.
- The backup details page displays activity name next to each activity
  icon. Therefore the icons are only decorative and do not need to have
  any title or even alt text.
- Form labels should be associated with form controls.  A div element is
  not a form control.
- The from attribute of the form labels should be equal to the id
  attribute of an element. Therefore, we first create a label and an
  input elements and associate them to each other, and then pass them to
  backup_detail_pair() when a label is needed.
2020-09-28 23:41:29 +10:00
Eloy Lafuente (stronk7)
c43dac4e36 Merge branch 'MDL-69454-master' of git://github.com/bmbrands/moodle into master 2020-09-23 17:10:35 +02:00
Bas Brands
eb9935c909 MDL-69454 core_search: consistent backup search 2020-09-21 13:41:05 +02:00
Claude Vervoort
5b8c646e68 MDL-66934 mod_lti: support context history param 2020-09-18 14:11:34 -04:00
Nathan Nguyen
65c847d8fd MDL-68702 core_backup: exclude legacy course files 2020-09-11 10:41:37 +10:00
Paul Holden
404eabc7b5 MDL-69448 backup: fix capability checks when unable to copy user data.
When a given user doesn't have the capability to "Include user data"
during course copying, freeze the form element rather than not adding
it at all.

This caused problems as the element was required before preceding with
the course copy.
2020-09-04 08:19:53 +01:00
Andrew Nicols
00b731e9b8 Merge branch 'MDL-69418-master' of https://github.com/dmitriim/moodle 2020-09-03 10:56:56 +08:00
Sara Arjona
cf4841cfdb Merge branch '67278-master-categories-selector' of https://github.com/DSI-Universite-Rennes2/moodle into master 2020-09-02 17:37:15 +02:00
Julien Boulen
93d7220587 MDL-67278 course: Use autocomplete widget for course category selector 2020-09-02 15:30:34 +02:00
Andrew Nicols
39ae77ca65 Merge branch 'MDL-67419-master' of git://github.com/farhan6318/moodle 2020-09-02 08:54:27 +08:00
Dmitrii Metelkin
f52114addb MDL-69418 backup: attach data to grade items 2020-08-28 09:36:12 +10:00
Eloy Lafuente (stronk7)
b7100ae5b1 MDL-69475 backup: Proper handling of backup::RELEASE versions
1) Remove any floatval() casting. They are breaking / killing
   .10 versions (converting them to .1). Since Moodle 2.0 all the
   backup::RELEASE have been 100% numerical values.
2) Use version_compare() always to compare backup::RELEASE values.
   They are always versions and the function is aware of versions
   > .9, able to clean/ignore alpha chars... and everything else.

Note that I've also changed a couple of cases in formats (topics and
weeks) that were correct, but just added the same comment and used
the same version_compare() comparison parameters style, so all uses
in core are consistent (and safe to be copied out there).
2020-08-18 12:48:10 +02:00
Eloy Lafuente (stronk7)
45ce46f202 MDL-69475 versions: bump all versions and requires in master
version = 2021052500 release version
requires= 2021052500 same than version

Why 20210525? (25th May 2021) ?

Because master is going to be Moodle 4.0, to be released
on November 2021. And, until then, we are going to have
a couple of "intermediate" releases:

- Moodle 3.10 to be released 9th November 2020. (2020110900)

  This version will be using versions from today to 2020110900
  (once it's released the YYYYMMDD part stops advancing).

- Moodle 3.11 to be released 10th May 2021. (2021051000)

  This version will be using versions from 3.10 release to 2021051000
  (once it's released the YYYYMMDD part stops advancing).

That means that all versions from today to 2021051000 are going
to be used by those 2 "intermediate" releases (3.10 and 3.11).

And we cannot use them in mater, because it's forbidden to have
any overlapping of versions between branches (or different upgrade
paths will fail).

So, get that 2021051000, let's add it a couple of weeks to cover
the on-sync period (or a 2 weeks delay max!) and, the first version
that master can "own" in exclusive (without any overlap) is, exactly,
25th May 2021, hence our 20210525.
2020-08-17 00:11:41 +02:00
Farhan Karmali
470f94dc46 MDL-67419 admin: New admin setting for lang during user creation 2020-08-10 18:34:19 +05:30
Marina Glancy
6bc7645868 MDL-69381 core_backup: make progressbar selector more specific 2020-07-31 13:28:24 +02:00
Andrew Nicols
b284293402 MDL-69138 behat: Update session->visit() to use visit step 2020-07-22 16:43:08 +08:00
Mark Johnson
e37cdf881e MDL-67671 backup: Fix modname display on backup form 2020-07-09 10:11:17 +01:00
Eloy Lafuente (stronk7)
dbe3e2dd13 MDL-69043 backup: Bump release to 4.0 2020-06-14 12:53:38 +02:00
Eloy Lafuente (stronk7)
115cc0214f MDL-68973 versions: bump all versions and requires near release
version = 2020061500 release version
requires= 2020060900 current rc1 (week7roll1) version
2020-06-09 16:23:09 +02:00
Ilya Tregubov
d83bf6e0ff MDL-68203 restore: Decode quiz links when restore into existing course
or duplicating.
2020-05-27 10:38:40 +10:00
Eloy Lafuente (stronk7)
5b188629c7 MDL-68780 unit tests: Add missing ->destroy() calls to controllers
Every backup and restore controller always need to call
to their ->destroy() method in charge of finalizing loggers,
closing file handlers and destroy some circular references.

This is specially important within unit tests, because
open resources cannot be reset between tests, causing problems,
specially within Windows that locks all those files.
2020-05-20 11:02:00 +02:00
Víctor Déniz Falcón
8060ed34db Merge branch 'MDL-67812-master-latest-3' of git://github.com/mihailges/moodle 2020-05-18 16:04:58 +01:00
Mihail Geshoski
4f2a5f2074 MDL-67812 core_contentbank: Modify behat tests
Modify all behat tests that use the behat contentbank content generator
in order to use the updated generator structure
2020-05-18 11:10:07 +08:00
Adrian Greeve
5ec37d28a6 Merge branch 'master_MDL-64843_course_copy_ui' of https://github.com/catalyst/moodle 2020-05-18 10:35:44 +08:00
Matt Porritt
01436f7539 MDL-64843 Backup: Course copy user interface
This patch adds better core support for copying courses.
There is now a simplified and dedicated UI for copying
courses. This can be accessed from the course context
menu or course management screens.

All backups are done asynchronously and there can be multiple
copies of a course in flight at once.
2020-05-15 06:02:02 +00:00
Amaia Anabitarte
66489aea0f MDL-68314 core_contentbank: Backup and restore tests 2020-05-13 09:35:58 +02:00
Amaia Anabitarte
3449e22683 MDL-68314 core_contentbank: Course content bank backup and restore 2020-05-13 09:35:58 +02:00