31144 Commits

Author SHA1 Message Date
Huong Nguyen
3ac2f99ca3 MDL-78065 tiny_link: Fix cannot create link for selection text 2023-05-02 10:23:07 +07:00
Ilya Tregubov
dd4a990fe0 Merge branch 'master_MDL-76929' of https://github.com/mattporritt/moodle 2023-04-26 09:27:58 +08:00
Sara Arjona
49d013efd6 Merge branch 'MDL-77313' of https://github.com/paulholden/moodle 2023-04-25 15:18:26 +02:00
Paul Holden
b495ba0cec
Merge branch 'MDL-78007-master' of https://github.com/HuongNV13/moodle 2023-04-25 12:36:07 +01:00
Paul Holden
1dbeca84f6
MDL-77313 restore: re-add field to indicate course/category search.
When the two restore forms for searching courses and categories were
converted to core templates in eb9935c9 they lost the named submit
button, which broke searching.
2023-04-24 11:04:20 +01:00
Huong Nguyen
1d4c1d9c65 MDL-78007 tiny_media: Fix wrong condition for the Tiny Media
Including in this commit:
 - Switched to Tiny editor in manually_mark_question.feature
2023-04-24 15:53:41 +07:00
Jun Pataleta
9095bb0ef9 MDL-78000 upgrade: add the 4.2.0 separation line to all upgrade scripts 2023-04-22 23:17:50 +08:00
Jun Pataleta
8dd488cb5b Merge branch 'MDL-77989-master' of https://github.com/andrewnicols/moodle 2023-04-21 13:44:51 +08:00
Andrew Nicols
1a53cbbae4 MDL-77989 testing: Add test file isolation helper
When we deprecate the use of a file, we often include tests which ensure
that the legacy behaviour is maintained. There are also legacy uses
in the community where people would like to use the deprecated API for a
period.

The issue that we face is that, if the deprecated file is included once,
then it will be included for all other, unrelated, tests. This means
that other tests may not detect cases where the deprecated file was
included.

We can solve these cases by running the test that performs the inclusion
in a deprecated process. This means that the inclusion is only performed
in that isolated process, and other unrelated tests do not include the
file.

However, we also then need to detect which files which are including the
file and which we do not know about.

This change introduces:
- an override to the TestCase::setInIsolation method to define a
  constant when the test is running in isolation
- a new function that a file can call when it is included, to make sure
  that the test process was isolated, where there is any test.
2023-04-21 13:33:56 +08:00
Ilya Tregubov
04bf346ca3 Merge branch 'MDL-77903' of https://github.com/Chocolate-lightning/moodle 2023-04-21 13:18:14 +08:00
Jun Pataleta
19022cd940 Merge branch 'MDL-77927-master' of https://github.com/stevandoMoodle/moodle 2023-04-21 13:11:43 +08:00
Mathew May
f9c6548189 MDL-77903 gradereport_grader: Keyboard accessibility 2023-04-21 13:09:25 +08:00
Jun Pataleta
4bf6bb37c2 MDL-77927 core: Delete other mod_assignment subplugins
Non-core mod_assignment subplugin data may still be present on the
database. We need to make sure to remove these too during upgrade.
2023-04-21 12:32:10 +08:00
Jun Pataleta
0720524804 MDL-77927 core: mod_assignment subplugins environment check 2023-04-21 12:32:06 +08:00
Jun Pataleta
dddc9a08cd MDL-77927 core: Move assignment removal upgrade code
Move the fixed assignment removal upgrade code to the end of the upgrade
script as a new upgrade step. Already upgraded sites with mod_assignment
removed should just be able to rerun this without any issues.
2023-04-21 12:31:11 +08:00
Stevani Andolo
d023b5356c MDL-77927 grade: Delete mod_assignment orphaned data before its removal 2023-04-21 12:31:07 +08:00
Jun Pataleta
e07f28e276 Merge branch 'MDL-77896' of https://github.com/paulholden/moodle 2023-04-21 11:21:40 +08:00
Andrew Nicols
f7d7ad7fed MDL-77989 core_external: Isolate testing of deprecated file
The inclusion of this deprecated file leads to tests passing which may
fail when run in a different order, or for just a single testsuite.
2023-04-21 09:33:53 +08:00
Paul Holden
571292b6eb
MDL-77896 editor_tiny: approximate height for non-visible editors.
When an editor is renderer initially invisible to the browser, e.g.
the forum "Add discussion" form, it has a `clientHeight` value of
zero. We can approximate an alternative value based on the number
of rows in the textarea.

Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2023-04-20 15:24:23 +01:00
Jake Dallimore
fffc7ebf7c MDL-77973 core: fix broken navigation when moodlenet misconfigured
Instead of failing with an exception, throw a debugging notice.
2023-04-20 11:47:54 +08:00
Andrew Nicols
59d42e1ed2 MDL-77718 editor_tiny: Restrict the revision to int for loaders
The revision should always be an int. I suspect this was missed during
debugging and not corrected.
2023-04-19 16:44:19 +00:00
Paul Holden
a8da761f8b
MDL-77959 moodlenet: void return type style fixes in test. 2023-04-19 17:35:12 +01:00
Paul Holden
5338fc591e
Merge branch 'MDL-77959-master' of https://github.com/HuongNV13/moodle 2023-04-19 17:25:14 +01:00
Jun Pataleta
ad37980aeb Merge branch 'MDL-77955' of https://github.com/paulholden/moodle 2023-04-19 23:45:25 +08:00
Paul Holden
c81bfc4f45
Merge branch 'MDL-77897-master' of https://github.com/andrewnicols/moodle 2023-04-19 14:13:03 +01:00
Paul Holden
b952c16086
Merge branch 'MDL-77944-master' of https://github.com/andrewnicols/moodle 2023-04-19 13:06:40 +01:00
Huong Nguyen
5548b91e3e MDL-77959 core_moodlenet: Convert activity intro to plaintext 2023-04-19 17:40:21 +07:00
Jun Pataleta
02ba4ceefa Merge branch 'MDL-77940' of https://github.com/stronk7/moodle 2023-04-19 17:43:23 +08:00
Jake Dallimore
555ad338bf Merge branch 'MDL-77958-master' of https://github.com/andrewnicols/moodle 2023-04-19 17:08:14 +08:00
Andrew Nicols
3ac1acacca MDL-77958 moodlenet: Various style fixes
This change contains various style fixes which I encountered and fixed
whilst addressing the other issues identified in this issue.
2023-04-19 16:12:50 +08:00
Andrew Nicols
581ccb9a47 MDL-77958 moodlenet: Pass stored_file to improve memory usage
Previously the content of the stored file was extracted and stored in a
variable, passed around, and then submitted to MoodleNet. This results
in very high memory consumption when dealing with MoodleNet.

The stored_file should be passed around as a first-level param to
discourage this, and the content should _never_ be loaded into memory.
Instead file streams and resources should be used to allow Guzzle/Curl
to buffer the file from disk/other storage straight to MoodleNet.
2023-04-19 16:12:50 +08:00
Andrew Nicols
489a53ceb2 MDL-77897 editor_tiny: Save editor content on editor blur 2023-04-19 14:57:10 +08:00
Andrew Nicols
96a1a0abce MDL-77958 file: Add psr stream functionality to file API
This change introduces a new get_psr_stream() method to:
* stored_file
* file_system

This allows us to fetch a Psr Stream implementing the
PSR\Http\Message\StreamInterface and pass it into Guzzle, which means
that there is no need to load the entire file content into memory to
serve it.
2023-04-19 13:51:49 +08:00
Jun Pataleta
b1954bfdf9 Merge branch 'MDL-77953' of https://github.com/stronk7/moodle 2023-04-19 12:37:55 +08:00
Andrew Nicols
a089496f96 Merge branch 'MDL-77954' of https://github.com/paulholden/moodle 2023-04-19 11:16:50 +08:00
Paul Holden
78d24550af
MDL-77955 moodlenet: destroy backup controller in class destructor.
This ensures that it's always cleaned up during tests, where not doing
so can cause spurious errors on Windows.
2023-04-18 22:42:13 +01:00
Paul Holden
fd8184a295
MDL-77954 moodlenet: store packaged activities in user draft.
We shouldn't invent fileareas with invalid values (specifically in
this case, the `itemid` overflowed maximum length of the field on
Oracle).

Given the generated file is transitory in nature, instead store it
in the users draft area.
2023-04-18 18:40:15 +01:00
Eloy Lafuente (stronk7)
30e94a8916 MDL-77953 pagelib: Ensure that null $SCRIPT continues behaving the same
It's possible to have some Moodle components soft linked instead
of being real directories within codebase (within dirroot).

For example, Composer's "vendor" directory can be soft linked
(from elsewhere), or also plugins can be installed using soft
links.

In those cases, Moodle calculates the $SCRIPT global as null. And,
then, string operations on it are emitting a PHP deprecation message
with PHP 8.1 and up.

This fix just ensures that the behaviour is the same than before
PHP 8.1, aka: ltrim(null) = '' (empty string), without any PHP warning.
2023-04-18 18:48:58 +02:00
Eloy Lafuente (stronk7)
061c9d7ba0 MDL-77940 versions: bump all versions and requires near release
version = 2023042400 release version
requires= 2023041800 current rc1 version
2023-04-18 18:08:09 +02:00
Andrew Nicols
3933cbfb5a Merge branch 'MDL-77895' of https://github.com/paulholden/moodle 2023-04-18 23:34:59 +08:00
Jake Dallimore
c9e8aa0406 Merge branch 'MDL-75316-master-4' of https://github.com/mickhawkins/moodle 2023-04-18 17:24:55 +08:00
Michael Hawkins
2e024f304a MDL-75316 core: MoodleNet integration final improvements 2023-04-18 17:00:54 +08:00
Huong Nguyen
58ced4add0 MDL-75316 core_moodlenet: Share to MoodleNet modal and activity menu
Originally implemented as MDL-75785
2023-04-18 17:05:07 +08:00
Huong Nguyen
6a877d438b MDL-75316 core: Webservice for sending activity to MoodleNet
Originally implemented as MDL-75933
2023-04-18 17:04:46 +08:00
Michael Hawkins
42ba0492e2 MDL-75316 core: Corrected oauth2_client::get_accesstoken() docblock
Originally implemented as MDL-75932
2023-04-18 17:04:30 +08:00
Michael Hawkins
77f85ed287 MDL-75316 core: Add activity sender & moodlenet_client to MoodleNet API
This makes it possible to share a single activity to a MoodleNet
instance (which has been enabled for sharing in site admin).
This utilises the core\moodlenet\activity_packager to create an
activity backup, then sends it using the MoodleNet create resource
API specification.

Originally implemented as MDL-75932
2023-04-18 17:04:14 +08:00
raortegar
9bc769a610 MDL-75316 core: Add activity packager to MoodleNet API
This makes it possible to package a single activity as a Moodle backup
file, excluding user data so it is ready to be shared as a MoodleNet
resource.

Co-authored-by: Michael Hawkins <michaelh@moodle.com>

Originally implemented as MDL-75932
2023-04-18 17:03:45 +08:00
Michael Hawkins
d6c4c0fbbd MDL-75316 core: Set up MoodleNet API structure and utilities helper
Initial folder structure and declaring API.
Created utilities class.

Originally implemented as MDL-75932
2023-04-18 17:03:18 +08:00
Huong Nguyen
7727745bf7 MDL-75316 core_moodlenet: Create MoodleNet capability
Originally implemented as MDL-75319
2023-04-18 17:02:47 +08:00
Huong Nguyen
ef2a1934a0 MDL-75316 core_moodlenet: Add setting to control sharing
Originally implemented as MDL-75319
2023-04-18 17:01:38 +08:00