866 Commits

Author SHA1 Message Date
Sara Arjona
39263ddb62 MDL-69331 core_h5p: Add missing @core_h5p tag 2021-04-15 09:16:36 +02:00
Sara Arjona
f3d43c76bc MDL-69331 core_h5p: Add missing library files to behat tests
Some of the pre-existing behat tests were creating content into the
content bank using the generator but the H5P content-type libraries
weren't uploaded.
Since MDL-69331, libraries need to be deployed previously (so fake
H5P content-type won't be displayed if these libraries don't exist).
2021-04-15 09:16:36 +02:00
Mihail Geshoski
5cc31c3691 MDL-67870 backup: Skip value change if setting is locked by hierarchy
The given condition in the if statement did not take into account cases
when the setting is locked by hierarchy. Settings which are locked by
hierarchy should should keep their current values which were inherited
from the parent.
2021-03-22 15:32:49 +08:00
Eloy Lafuente (stronk7)
e3a46964dc Merge branch 'MDL-70901-master' of git://github.com/marinaglancy/moodle 2021-03-18 00:40:46 +01:00
Jun Pataleta
ebf078458d Merge branch 'MDL-71036' of https://github.com/stronk7/moodle 2021-03-17 20:05:25 +08:00
Eloy Lafuente (stronk7)
ba5b6089d5 MDL-71036 phpunit: Renamed various regexp-related assertions
In PHPUnit 9.1, the following regexp-related assertions
have been deprecated and there are new alternatives for
all them:
    - assertRegExp()     -> assertMatchesRegularExpression()
    - assertNotRegExp()  -> assertDoesNotMatchRegularExpression()

This is about to, simply, move all cases to the new alternatives.

Source: https://github.com/sebastianbergmann/phpunit/blob/9.1.0/ChangeLog-9.1.md

Regexp to find all them:

    ag 'assertRegExp|assertNotRegExp' -li
2021-03-11 19:22:24 +01:00
Mikhail Golenkov
e9eb3ad6c5 MDL-71044 backup: backup_cleanup_task task to remove old files 2021-03-07 21:46:47 +11:00
Jun Pataleta
2b113fd93c Merge branch 'MDL-70876' of https://github.com/stronk7/moodle 2021-03-02 16:02:52 +08:00
Eloy Lafuente (stronk7)
bf2b1b18b5 Merge branch 'MDL-70898-master' of git://github.com/marinaglancy/moodle 2021-03-01 22:50:33 +01:00
Eloy Lafuente (stronk7)
08ae245926 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:27 +01:00
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
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
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)
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
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
Bas Brands
eb9935c909 MDL-69454 core_search: consistent backup search 2020-09-21 13:41:05 +02: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
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
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
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)
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
Andrew Nicols
29c5fafff5 MDL-66109 js: Fix Shifter linting issues 2020-05-11 11:07:49 +08:00
Andrew Nicols
7afd16ad84 MDL-66109 behat: Require newline at EOF
This change enables the gherkinlint rule to require a new line at the
end of the file. This change is in keeping with existing Moodle coding
style guidelines.
2020-05-11 11:07:49 +08:00
Eloy Lafuente (stronk7)
d9776bc02a Merge branch 'MDL-67499' of git://github.com/paulholden/moodle 2020-04-15 12:49:14 +02:00
Paul Holden
0c68ae88eb MDL-67499 restore: account for deleted user truncated email/username. 2020-04-06 12:09:48 +01:00
Eloy Lafuente (stronk7)
68ba708334 MDL-67499 restore: add 100% cov. to restore_dbops::precheck_user()
Supports multiple mails to be tested.

So we can perform changes to it and also some related stuff,
like delete_user() with confidence.
2020-04-06 11:48:27 +01:00
Tim Hunt
1dcd0d3499 MDL-68233 renderers/block: remove illegal uses of $PAGE and $OUTPUT 2020-03-29 15:34:26 +01:00
Paul Holden
5526870052 MDL-67731 backup: fix async restores in progress table listing. 2020-03-22 19:57:34 +00:00
Peter
74d95c7bf9 MDL-65724 core: Force restore to use the settings from the plan
When importing use the import settings.
2020-03-06 13:43:39 +08:00
Bas Brands
40ea67534c MDL-66999 theme_boost: @extend remove extends for tables 2019-12-12 11:27:56 +01:00
Eloy Lafuente (stronk7)
97d5eeda32 Merge branch 'MDL-41958-master' of git://github.com/lucaboesch/moodle 2019-12-04 23:24:46 +01:00
John Yao
d0734df404 MDL-65729 Backup: Split individual backups into ad-hoc tasks
* refactor run automated backup
* new backup status of Queued
* adhoc task for backing up a course
* course locking for course backup adhoc task
* use Moodle locking instead of custom locking for run automated backup task
* add unit tests to extracted methods
2019-12-04 15:10:23 +11:00
Luca Bösch
292b987c5c MDL-41958 import: Constistently showing progress steps. 2019-11-30 10:07:56 +01:00