1935 Commits

Author SHA1 Message Date
Helen Foster
ab53075f22 MDL-72063 lang: Import fixed English strings (en_fix) 2021-07-01 14:11:23 +02:00
Peter Dias
cf66500557 MDL-70271 repository_dropbox: Switch to core\oauth2 API
Dropbox is updating their OAuth2 authentication to issue short-term
tokens, which are already supported by core\oauth2\client.

This commit updates the dropbox repository to use the
core\oauth2 API, which has built-in support for tokens and
offline access.
2021-06-22 11:44:11 +08:00
Andrew Nicols
0e7e393748 Merge branch 'MDL-71813-master' of https://github.com/NashTechOpenUniversity/moodle 2021-06-17 11:28:22 +08:00
Sujith Haridasan
0845f53d14 MDL-67975 nextcloud: Add support for Link to file
This change set would bring the following new additions
to the nextcloud repo:
1. Create a new radio button in filepicker: "Link to file"
2. When user clicks this radio button a warning message
   would be created, saying this file would become public.
   Meaning a public link is created in the nextcloud server.
3. Created a sync_reference method to sync the files downloaded
   from nextcloud server. The sync/refresh time given is 1 day/24 hours.
4. Made sure that when the file is downloaded, we use the file
   from moodledata file pool.

Signed-off-by: Sujith Haridasan <sujith@moodle.com>
2021-06-09 13:34:31 +05:30
hiendinh
ffb403d9b5 MDL-71813 filepicker: view file not available using keyboard (Enter) 2021-06-03 14:14:21 +07:00
Eloy Lafuente (stronk7)
9d6aa39985 MDL-71583 versions: Add all the missing full-stops to version/requires
It seems that the new phpcs3 checker is now controlling those
line comments that previously were ignored.

This commit just looks for all the cases and bulk-add
them when needed. The bash script (mac) used to add all them is:

while read -r line; do
    arr=(${line//:/ })
    if [[ -n ${arr[0]} ]] && [[ -n ${arr[1]} ]]; then
        echo "  file ${arr[0]}, line ${arr[1]}"
        sed -i "${arr[1]}s/\$/\./" ${arr[0]}
    fi
done < <(find . -name version.php | xargs ag --nomultiline '>(version|requires) *=.*//.*[^;\.]$')
2021-05-11 20:11:07 +02:00
Eloy Lafuente (stronk7)
b0d79e3b18 Merge branch 'MDL-71313' of https://github.com/timhunt/moodle 2021-05-06 23:14:50 +02:00
Sara Arjona
076116e7a6 Merge branch 'MDL-71491' of git://github.com/paulholden/moodle 2021-05-06 18:42:18 +02:00
Paul Holden
72304875ec MDL-71491 repository_flickr: return more file data.
See also 643b0cca.
2021-05-06 16:36:49 +01:00
Shamim Rezaie
9c11ceac1f MDL-69028 repository: Put a rate limit on draft file uploads 2021-05-04 17:23:11 +02:00
Adrian Greeve
c94a0090e0 Merge branch 'MDL-71481' of git://github.com/paulholden/moodle 2021-04-30 11:19:02 +08:00
Paul Holden
643b0ccabe MDL-71481 repository_flickr_public: return more file data.
A HTTP HEAD request is required to get the image filesize.
The remaining data can be obtained from existing calls to
the Flickr API.
2021-04-29 09:48:19 +01:00
Mihail Geshoski
49ce037665 MDL-71470 repository_googledocs: Update unit tests 2021-04-28 16:30:27 +08:00
Mihail Geshoski
0ce519591b MDL-71470 repository_googledocs: Use file name in the source attribute
Instead of using the file title when generating the source attribute,
we should be using only the name of the Google Drive file in order to
avoid having the original extension within the filename after the file
is imported and added into Moodle.
2021-04-28 16:30:27 +08:00
Marina Glancy
0152fdbdff MDL-71017 oauth2: configure some oauth2 services for login only 2021-04-20 10:50:40 +02:00
Sara Arjona
39fa45e299 MDL-69331 core_contentbank: Hide disabled H5P content-types
If a H5P content-type is disabled:
- The content bank won't display existing contents having it as a
main library.
- The content bank won't allow to create new contents using it.
2021-04-15 09:16:32 +02:00
Mihail Geshoski
5f4bdefc54 MDL-61768 repository_googledocs: Deprecate unused methods
Deprecates methods from the repository_googledocs class which are
no longer used.
2021-04-15 12:40:32 +08:00
Mihail Geshoski
6528181e72 MDL-61768 repository_googledocs: Add unit tests
Adds unit tests for the newly introduced methods related to the content
browsing and searching functionallity across drives.
2021-04-15 12:40:32 +08:00
Mihail Geshoski
54a850640d MDL-61768 repository_googledocs: Support shared drives
Enables the Google Drive repository to support browsing and searching
for content from the existing shared drives.
2021-04-15 12:40:32 +08:00
Mihail Geshoski
241e778ca7 MDL-61768 repository_googledocs: Rest API function to list shared drives
Adds a new rest API function in the googledocs repository which would
return the existing shared drives.
2021-04-15 11:06:11 +08:00
Tim Hunt
385ce8a5e1 MDL-71313 repositories: warn if get_instances context is wrong type 2021-04-12 20:30:43 +01:00
Eloy Lafuente (stronk7)
cfba0366db Merge branch 'MDL-70893-master' of git://github.com/marinaglancy/moodle 2021-03-18 00:23:26 +01:00
Eloy Lafuente (stronk7)
81407f18ec 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:04:31 +01:00
Marina Glancy
465d1ef495 MDL-70921 repository: filter function can not accept argument by ref
PHP8.0 shows error that filter function accepts value by reference
The nested filtering was never working but also this function was never called on a tree with sub-levels,
so this logic is now removed
2021-02-25 18:24:52 +01:00
Andrew Nicols
a84a55bd45 MDL-64554 user: Fix use of Private files page on classic
The "Private files" link does not exist in the site navigation when
using the classic theme, so it is not possible to test the dedicated
page via Behat at this time.
2021-02-19 09:33:06 +08:00
Marina Glancy
440073ff20 MDL-64554 user: make private files editor modal/ajax form 2021-02-17 18:06:57 +01:00
Marina Glancy
0eada7a5f9 MDL-70893 various: optional function arguments must be in the end 2021-02-15 16:53:37 +01:00
Andrew Nicols
3b7a564e17 Merge branch 'MDL-70429-master' of git://github.com/sarjona/moodle 2021-02-08 12:02:11 +08:00
Sara Arjona
d80613f9de MDL-70429 repository_contentbank: set default returntype
Credits for Alexander Bias, for sharing the patch!

The content bank was designed for making easier to reuse content.
So "Link to the file" should be the default option when using the
contentbank repository, in order to let teachers modify their
content in the content bank and update automatically it everywhere
is used.
2021-01-28 16:45:08 +01:00
Andrew Nicols
bf6983107f Merge branch 'MDL-70048-master' of git://github.com/peterRd/moodle 2021-01-28 08:02:58 +08:00
Peter Dias
663c84ace6 MDL-70048 dropbox: Augmented unit tests to account for additional params 2021-01-28 07:31:07 +08:00
Peter Dias
44664d35e5 MDL-70048 dropbox: Update the dropbox search URL.
- Update fetch_dropbox_data to allow different result nodes and version
- Update search to the new URL with new params
- Update the get entities function to account for the change in structure.
2021-01-28 07:31:07 +08:00
Eloy Lafuente (stronk7)
77342b96fc MDL-69308 upgrade: remove all the < 3.6.0 upgrade steps
This just deletes all the upgrade steps previous to 3.6.0. Some
small adjustments, like tweaking globals can also be applied
when needed.

Also includes an upgrade step to prevent upgrading from any
version < 2018120300 (v3.6.0) as anti-cheating measure.

Note that in this case, there wasn't any case of upgradelib
functions being used, hence we haven't to deprecate/remove
anything in codebase. When there is such a need, that is done
in separate commits (one for each function) and documented here.

See MDL-65809 commits for an example removing/deprecating a
good number of functions.
2021-01-13 19:11:19 +01:00
Jake Dallimore
6fcd084f68 Merge branch 'MDL-70041-master' of git://github.com/mihailges/moodle 2020-10-29 11:48:58 +08:00
Mihail Geshoski
81d0642b6c MDL-70041 filepicker: Make sure the user has a recently used license 2020-10-28 11:48:33 +08:00
David Mudrák
e576fef1fa MDL-69998 lang: Fix reworded strings in Behat test scenarios 2020-10-27 11:32:10 +01:00
Helen Foster
dd7a1d60e2 MDL-69998 lang: Import fixed English strings (en_fix) 2020-10-27 11:32:10 +01: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)
f94195c320 MDL-67673 phpunit: Remove deprecated assertInternalType()
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

assertInternalType() is deprecated and will be removed in
PHPUnit 9. Refactor your test to use assertIsArray(), assertIsBool(),
assertIsFloat(), assertIsInt(), assertIsNumeric(), assertIsObject(),
assertIsResource(), assertIsString(), assertIsScalar(),
assertIsCallable(), or assertIsIterable() instead.
2020-10-21 12:45:59 +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
d09980a8b0 Merge branch 'MDL-69897' of https://github.com/paulholden/moodle into master 2020-10-19 18:14:45 +02:00
Paul Holden
9cbce6858f MDL-69897 repository: add heading to delete file modal. 2020-10-08 20:28:40 +01:00
Jake Dallimore
255a910c92 MDL-59510 core_oauth2: autorefresh google drive, nextcloud and onedrive
Request additional offline access, allowing the repository to sign in
automatically each time, including across different user sessions, until
either the refresh token is invalidated or the user logs out of the
repository.
2020-10-05 09:19:29 +08:00
Paul Holden
582bb534c9 MDL-37802 repository: return error if unzipping files fails.
For instance, when a user tried to unzip a password protected zip
archive using the file manager.
2020-09-25 09:33:44 +01:00
Mihail Geshoski
cb72d845f5 MDL-65115 repository: Prevent unzipping if it will exceed allowed quota 2020-09-08 08:54:26 +02:00
Thong Bui
fb75fd0396 MDL-68344 filepicker: File Picker focus lost on upload 2020-09-04 09:30:59 +07:00
Nathan Nguyen
8bbee0c8f0 MDL-33981 repository_equella: support internal copy 2020-08-24 09:54:34 +10:00
Eloy Lafuente (stronk7)
fbb0767536 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 master, 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-18 00:47:15 +02:00
Eloy Lafuente (stronk7)
b764343e5a MDL-69044 upgrade: add 3.9.0 separation line to all upgrade scripts 2020-06-14 13:08:09 +02:00
Eloy Lafuente (stronk7)
39885e35f4 Merge branch 'MDL-68954-master' of git://github.com/mihailges/moodle 2020-06-10 23:53:35 +02:00