Commit graph

2906 commits

Author SHA1 Message Date
Jun Pataleta
c9d57344b0 Merge branch 'MDL-70876_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-03-02 16:02:15 +08:00
Eloy Lafuente (stronk7)
81761afcb1 Merge branch 'MDL-70898-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-03-01 22:50:41 +01:00
Eloy Lafuente (stronk7)
bbe91c4828 MDL-70876 php80: 5th param removed from custom error handlers
It was deprecated in php72 and now it's gone.

Have used this regexp to find all the uses in core:

ag set_error_handler | uniq

And then checked all them manually, that parameter was not
being used in the 3 methods where we are removing it.
2021-02-26 13:08:31 +01:00
Eloy Lafuente (stronk7)
6e9c9f7f87 Merge branch 'MDL-70920-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-02-23 17:43:39 +01:00
Marina Glancy
681c70017c MDL-70901 core: @ no longer masks errors in PHP 8.0 2021-02-22 16:19:37 +01:00
Marina Glancy
8b5bd4fb00 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:19:37 +01:00
Marina Glancy
acc72a1f00 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:22:56 +01:00
Daniel Kristian Steffensen
94f2284bdb MDL-43697 backup: Archived badges are restored during course restore 2021-02-19 15:50:42 +01:00
Víctor Déniz
93034373df Merge branch 'MOODLE_311_MDL-70752' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2021-02-17 16:57:18 +00:00
Jun Pataleta
ef9bf314c4 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:28:43 +08:00
Frederic Massart
026d2d227b 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:53:30 +08:00
Marina Glancy
dbb31d14d6 MDL-70898 various: private functions can not be declared final 2021-02-15 16:37:05 +01:00
Mikhail Golenkov
f9c1978c5e MDL-70752 restore: Fix remote file recovery 2021-02-04 19:20:24 +11:00
Adrian Perez
0e365f283c MDL-69202 Restore backup: add getter method for oldmoduleid 2021-01-16 10:36:33 +01:00
Paul Holden
e5e287396d MDL-70422 restore: fix for undefined question answer ordering in test. 2020-12-07 10:15:48 +00:00
Eloy Lafuente (stronk7)
adb8fe4c42 MDL-70229 install: Changes to continue working with parallel branches
- Main version (version, release, branch and maturity), guaranteeing
  we are diverging from previous stable branch and won't overlap any more.
- Backup release, to match new branch.
- CI configuration files (.travis.yml in this case), to match new branch.

For changes needed to START working with parallel branches, see MDL-69475
2020-11-14 17:10:41 +01:00
Jun Pataleta
940ed72017 Merge branch 'MDL-70089_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2020-11-04 13:05:47 +08:00
Eloy Lafuente (stronk7)
b0a1b4ce8b MDL-70089 versions: bump all versions and requires near release
version = 2020110900 release version
requires= 2020110300 current beta+ (week6roll1) version

Note that, because we are under parallel development period,
this is being done in the branch that is going to be released
(MOODLE_310_STABLE already existing) for Moodle 3.10.0 and
not in master, that is the one getting the bump under normal
(non-parallel) periods.
2020-11-03 19:34:52 +01:00
Mihail Geshoski
fd2427746f MDL-67837 backup: Verify caps before unenrolling users on course restore 2020-11-03 12:34:28 +01:00
Peter Dias
1d1b148ca9 MDL-56310 restore: Confirm user has permission to change capabilities 2020-11-03 12:34:28 +01:00
Paul Holden
a850fa5de8 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:15:04 +01:00
Adrian Perez
8d0d0b1f59 MDL-69156 course_copy: set defaults for idnumber when not permitted 2020-10-29 14:15:00 +01:00
Luca Bösch
a9f5f8094c MDL-69995 backup: padding before activity icons. 2020-10-25 02:07:26 +02:00
Eloy Lafuente (stronk7)
46606b3ddd 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:05 +02:00
Eloy Lafuente (stronk7)
ddf72dd60d 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:05 +02:00
Eloy Lafuente (stronk7)
d81a94807b 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:46:04 +02:00
Sara Arjona
b7146b655a Merge branch 'MDL-69900-310' of git://github.com/mihailges/moodle into MOODLE_310_STABLE 2020-10-19 13:41:59 +02:00
Jake Dallimore
04a02b5bd9 Merge branch 'MOODLE_310_MDL-47178' of https://github.com/golenkovm/moodle into MOODLE_310_STABLE 2020-10-16 11:52:29 +08:00
Stephen Bourget
a2b727d7bc MDL-69900 core_backup: Allow IMSCC v1.0 restore to finish 2020-10-09 09:06:26 +08:00
Mikhail Golenkov
1f3aacf8fc MDL-47178 question: Retain question authors when restoring backups. 2020-10-06 09:33:56 +11:00
Shamim Rezaie
2fca843e49 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:43:01 +10:00
Bas Brands
486aa319c2 MDL-69454 core_search: consistent backup search 2020-09-23 17:36:15 +02:00
Claude Vervoort
fae57261e7 MDL-66934 mod_lti: support context history param 2020-09-18 14:06:58 -04:00
Nathan Nguyen
cf4b6c8c94 MDL-68702 core_backup: exclude legacy course files 2020-09-11 10:59:28 +10:00
Paul Holden
f2b1242364 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:20:04 +01:00
Dmitrii Metelkin
558ef4f778 MDL-69418 backup: attach data to grade items 2020-09-03 11:08:00 +08:00
Sara Arjona
893cf77d33 Merge branch '67278-moodle-310-categories-selector' of https://github.com/DSI-Universite-Rennes2/moodle into MOODLE_310_STABLE 2020-09-02 17:37:24 +02:00
Julien Boulen
f9f41f5061 MDL-67278 course: Use autocomplete widget for course category selector 2020-09-02 16:00:20 +02:00
Farhan Karmali
d179137f1b MDL-67419 admin: New admin setting for lang during user creation 2020-09-02 08:54:47 +08:00
Eloy Lafuente (stronk7)
12ffcc5097 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:49:20 +02:00
Eloy Lafuente (stronk7)
ae3af1d860 MDL-69475 install: Version, env. and minimal changes before branching
- Also bump travis to get builds against 310_STABLE.
- And backup release to match 3.10

Note this doesn't aim to be a complete change-set, but just the
minimum to switch to 3-digit $branches and keep installation, checks
and tests running and passing.
2020-08-17 00:12:30 +02:00
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