Commit graph

2896 commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
4053ab14d6 Merge branch 'MDL-71121-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-08-31 23:13:07 +02:00
Andrew Nicols
81ee8fe275 MDL-71055 behat: Update core settings to use generator
These changes have only been applied to settings which were already
using settings names and values, but which were still using the UI.
2021-08-23 12:23:03 +08:00
Tim Hunt
1c25e9ec53 MDL-72265 backup: fix checking of override capabilites on restore
Thanks to Peter Dias <peter@moodle.com> for his help with the unit test.
2021-08-05 14:28:37 +01:00
Paul Holden
f8cffa2803 MDL-71121 backup: apply config defaults for async backups. 2021-08-02 23:35:03 +01:00
Andrew Nicols
613cd69cbd MDL-71113 javascript: Improve basic JS Documentation 2021-06-18 09:38:05 +08:00
Andrew Nicols
e214af5720 MDL-71113 js: Fix all jsdoc warnings 2021-06-18 09:38:05 +08:00
Eloy Lafuente (stronk7)
370a38484f Merge branch 'MDL-71580-311-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2021-05-12 23:00:00 +02:00
David Mudrák
857d7b613f MDL-71580 lang: Fix reworded strings in tests 2021-05-12 17:11:57 +02:00
Eloy Lafuente (stronk7)
71d0cfefab MDL-71583 versions: bump all versions and requires near release
version = 2021051700 release version
requires= 2021051100 current rc1 (week7roll1) version

Note that, because we are under parallel development period,
this is being done in the branch that is going to be released
(MOODLE_311_STABLE already existing) for Moodle 3.11.0 and
not in master, that is the one getting the bump under normal
(non-parallel) periods.
2021-05-11 18:50:34 +02:00
Ilya Tregubov
be5eff78ab MDL-66431 core: Fix behat tests.
Move activity creation to data generators. Only fixing those
tests failing due to removing usemodchooser preference.
2021-05-01 16:18:56 +02:00
Jun Pataleta
b4edfb9031 Merge branch 'MDL-71455-311' of https://github.com/dcai/moodle into MOODLE_311_STABLE 2021-04-29 18:05:17 +08:00
Dongsheng Cai
0ebdf3f1b4 MDL-71455 core_backup: fix course completion options when backup/restore 2021-04-29 11:42:47 +10:00
Adrian Greeve
702ea8590e Merge branch 'MDL-71051-311-2' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-04-29 09:22:37 +08:00
Marina Glancy
3c9e54eafa MDL-71051 core_user: always use API when working with profile fields 2021-04-28 11:49:27 +02:00
Andrew Nicols
1d7bbdfc08 Merge branch 'MDL-71389-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-04-28 09:49:48 +08:00
Sara Arjona
7ccfb2410a Merge branch 'MDL-71136_311' of https://github.com/TomoTsuyuki/moodle into MOODLE_311_STABLE 2021-04-22 13:56:43 +02:00
abgreeve
3f1727adcf Merge branch 'MDL-28452-311' of git://github.com/bmbrands/moodle into MOODLE_311_STABLE 2021-04-22 09:35:18 +08:00
Marina Glancy
6d107d48c9 MDL-71389 various: changes to unittests due to php8 changes:
- some engine error messages changed
- some warning levels changed
- the carriage return symbol randomly appears
- one phpunit assertion fails and not really representative of anything
2021-04-21 12:39:02 +02:00
Bas Brands
37f26f211f MDL-28452 core_user: migrate social profile fields
Create a new profile field type, move all existing content of the fields
'icq', 'skype', 'aim', 'yahoo', 'msn' and 'url' in the mdl_user table to
theses new profile fields if needed.

AMOS BEGIN
MOV [aimid,core],[aimid,courseimage,profilefield_social]
MOV [yahooid,core],[yahooid,profilefield_social]
MOV [skypeid,core],[skypeid,profilefield_social]
MOV [icqnumber,core],[icqnumber,profilefield_social]
MOV [msnid,core],[msnid,profilefield_social]
MOV [webpage,core],[webpage,profilefield_social]
AMOS END
2021-04-21 11:24:34 +02:00
Eloy Lafuente (stronk7)
52dff48650 Merge branch 'MDL-63381_311_v3' of https://github.com/TomoTsuyuki/moodle into MOODLE_311_STABLE 2021-04-20 23:58:48 +02:00
Eloy Lafuente (stronk7)
cb6cdc0fd3 Merge branch 'MOODLE_311_STABLE-MDL-71190-backup-lastaccess' of https://github.com/ScottVerbeek/moodle into MOODLE_311_STABLE 2021-04-19 18:52:30 +02:00
ScottVerbeek
d687a56fed MDL-71190 backup: Include users last access to course
Backup the table user_lastaccess which holds data for when a user last accessed a course.
And also restore to the table user_lastaccess from the .xml file created in the backup.
2021-04-19 12:04:30 +10:00
Eloy Lafuente (stronk7)
c86f286543 MDL-71367 unit tests: Add missing ->destroy() call to test backups
As part of the tests preparations, some backups are created, but
the tests aren't calling to their ->destroy() method at the end.

The destroy() method is needed to go cleaning and unsetting various
objects that, only then, will free resources, like memory, open files...

This isn't critical under Unix OSs... but Windows is really sensible
and keeps all open files locked, so any write operation on them fails.
2021-04-19 00:03:46 +02:00
Sara Arjona
b3209c0ac5 MDL-69331 core_h5p: fix behat errors 2021-04-16 13:07:09 +02:00
Andrew Nicols
b816aa102d Merge branch 'MOODLE_311_MDL-71233' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2021-04-16 08:06:23 +01:00
Sara Arjona
d3b93906d5 MDL-69331 core_h5p: Add missing @core_h5p tag 2021-04-15 09:33:02 +02:00
Sara Arjona
d0d7fc835e 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:33:02 +02:00
Tomo Tsuyuki
c12ef07260 MDL-63381 backup: Have an option to import permissions
Add options to use permission settings for import / restore
2021-04-13 13:21:54 +10:00
Amaia Anabitarte
78a10f1724 MDL-71107 core_contentbank: Fill content author when copying a course
'usercreated' and 'usermodified' fields can not be always mapped.
We are filling those fields with 'old' users when working on the same
site, or with current user when working on a different instance.
2021-04-07 10:03:38 +02:00
Tomo Tsuyuki
cf176f2a7f MDL-71136 backup: Fix moodle_exception path. 2021-03-30 10:56:30 +11:00
Mikhail Golenkov
0b4161c14d MDL-71233 backup: Fix Moodle version for MDL-69418 2021-03-30 10:43:53 +11:00
sam marshall
3dee5cd74c MDL-71099 Lib: Move new user_fields class from core to core_user
This class would belong more appropriately within the 'user' API
(core_user) instead of within the 'core' API, since it is
directly related to user data.

Since the class has only just been added to Moodle, now is a good
time to move it.
2021-03-25 13:48:04 +00:00
Mihail Geshoski
66f592e71b 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:33:39 +08:00
Eloy Lafuente (stronk7)
c0c276e49d Merge branch 'MDL-70901-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-03-18 00:40:55 +01:00
Jun Pataleta
3a9b41613c Merge branch 'MDL-71036_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-03-17 20:05:17 +08:00
Eloy Lafuente (stronk7)
88847544c4 Merge branch 'MOODLE_311_MDL-71044_v3' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2021-03-16 22:39:02 +01:00
Eloy Lafuente (stronk7)
2d693cda7a MDL-71036 phpunit: Mock->setMethods() silently deprecated
The current ->setMethods() has been silently (won't emit any
warning) in PHPUnit 9. And will stop working (current plans)
in PHPUnit 10.

Basically the now deprecated method has been split into:

- onlyMethods(): To point to existing methods in the mocked artifact.
- addMethods(): To point to non existing (yet) methods in the mocked
  artifact.

In practice that means that all our current setMethods() calls can be
converted to onlyMethods() (existing) and done. The addMethods() is
mostly useful on development phases, not final testing.

Finally note that <null> isn't accepted anymore as parameter to
double all the methods. Instead empty array [] must be used.

Link: https://github.com/sebastianbergmann/phpunit/issues/3770
2021-03-11 23:07:31 +01:00
Eloy Lafuente (stronk7)
c989d6ec61 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 23:07:30 +01:00
sam marshall
0919a04311 MDL-45242 Lib: Replace calls to deprecated functions
In all cases changes have been kept to a minimum while not making
the code completely horrible. For example, there are many instances
where it would probably be better to rewrite a query entirely, but
I have not done that (in order to reduce the risk of changes).
2021-03-10 10:58:09 +00:00
Mikhail Golenkov
68588a8f47 MDL-71044 backup: backup_cleanup_task task to remove old files 2021-03-07 21:48:47 +11:00
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