153 Commits

Author SHA1 Message Date
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
Sara Arjona
1147a9fe9d MDL-72350 mod: Remove mod_assignment
The Assignment 2.2 activity module was disabled in 2012 but kept to
enable pre-2.2 backups to be restored and have the assignments
auto-converted to new assignments. After almost 10 years, it's time
to remove it from Moodle core.
2023-03-30 09:00:10 +08:00
Andrew Nicols
3e1920966c MDL-76583 core_external: Note deprecations and renames 2023-01-19 07:34:00 +08:00
Andrew Nicols
0392551bcb MDL-76583 core_external: Migrate service management to util 2023-01-19 07:33:35 +08:00
Andrew Nicols
caddb452f0 MDL-76583 core_external: Migrate string formatting functions to util 2023-01-19 07:33:35 +08:00
Andrew Nicols
7f5fb6a592 MDL-76583 core_external: Migrate token functions class 2023-01-19 07:33:35 +08:00
Andrew Nicols
ecbb31b160 MDL-76583 core_external: Migrate external_settings class 2023-01-19 07:33:35 +08:00
Andrew Nicols
e460e2e43f MDL-76583 core_external: Migrate external_format_value class 2023-01-19 07:33:35 +08:00
Andrew Nicols
780ba1333b MDL-76583 core_external: Migrate external_warnings class 2023-01-19 07:33:35 +08:00
Andrew Nicols
c42831cec6 MDL-76583 core_external: Migrate external_files class 2023-01-19 07:33:35 +08:00
Andrew Nicols
ebbf342127 MDL-76583 core_external: Migrate external_util class 2023-01-19 07:33:35 +08:00
Andrew Nicols
fff2c7420f MDL-76583 core_external: Migrate restricted_context_exception class 2023-01-19 07:33:35 +08:00
Andrew Nicols
698f06edeb MDL-76583 core_external: Migrate external_function_parameters class 2023-01-19 07:33:35 +08:00
Andrew Nicols
279ae4d5b3 MDL-76583 core_external: Migrate external_multiple_structure class 2023-01-19 07:33:35 +08:00
Andrew Nicols
967bed2954 MDL-76583 core_external: Migrate external_single_structure class 2023-01-19 07:33:34 +08:00
Andrew Nicols
61d59eaa11 MDL-76583 core_external: Migrate external_value class 2023-01-19 07:33:34 +08:00
Andrew Nicols
6f185f1873 MDL-76583 core_external: Migrate external_description class 2023-01-19 07:33:34 +08:00
Andrew Nicols
56bcaf409f MDL-76583 core_external: Migrate external_api to core_external\external_api 2023-01-19 07:33:18 +08:00
Juan Leyva
dba18ce3b6 MDL-73000 webservice: Fix external_warnings message type 2021-11-23 16:15:08 +01:00
Juan Leyva
39d96944eb MDL-66776 notifications: New login session notification 2021-11-04 11:18:00 +01:00
Cameron Ball
d5eaa5224e MDL-72670 session: Correct read only debugging logic
Prior to this patch the debugging mode (when enabled) would trigger
on everywhere, regardless of whether or not READ_ONLY_SESSION is defined.

This patch modifies that behaviour so that the debugging only kicks in
if READ_ONLY_SESSION is defined and set to true.
2021-10-08 15:11:40 +08:00
Marina Glancy
a7553de7ad MDL-70877 php: remove final functions __clone and __wakeup
Implementing these functions as final does not prevent the object to be
cloned or serialized, so the comment to them was wrong.
However having these functions not public breaks in PHP 8.0.
It still does not make sense to clone or serialise file_system or external_settings classes
but there are a lot of classes in moodle that should not be cloned, no reason to have
a specific solution here.
2021-02-26 13:07:52 +01:00
Sara Arjona
32f5dbbb80 Merge branch 'MDL-69050-master-allowlist' of git://github.com/mudrd8mz/moodle into master 2020-10-01 14:51:11 +02:00
Juan Leyva
d2aa3e054f MDL-69283 webservice: New external setting for forcing timezone 2020-09-25 19:08:59 +02:00
David Mudrák
801ee23427 MDL-69050 lang: Improve the wording of the comments
Stop using the terms whitelist/blacklist when used to allow/deny things.
2020-09-24 19:41:58 +02:00
sam marshall
aa823d1c23 MDL-69663 Web services: override_webservice_execution not honoured
If two different plugin types (e.g. theme, local) implement
override_webservice_execution callbacks, then all of them except
the 'last' plugin type do not work correctly.
2020-09-10 09:48:31 +01:00
Tim Hunt
5f26bdc5e9 MDL-68971 webservice: errors should give enough info to find the problem 2020-06-09 11:09:09 +01:00
Mark Nelson
4400ed3e1c MDL-58018 core: finish dev to support open sessions without a lock 2020-04-21 19:29:12 +02:00
Adam Eijdenberg
82da35fd51 MDL-58018 core: Enable read-only sessions for key pages
These pages are often loaded in parallel.
2020-04-20 14:13:35 +02:00
Dani Palou
096c46bb4e MDL-67189 external: Add test to catch PHP exceptions 2020-03-10 08:26:43 +01:00
Dani Palou
2603034e0a MDL-67189 external: Catch Throwable in call_external_function 2020-03-10 08:26:43 +01:00
Dani Palou
956232db1d MDL-67749 ws: Set private token when reset or manual create token 2020-02-19 12:03:48 +01:00
Eloy Lafuente (stronk7)
65b10696c5 Merge branch 'MDL-65931-master' of https://github.com/sammarshallou/moodle 2019-07-11 00:33:57 +02:00
sam marshall
107ab4b97b MDL-65931 Web services: get_courses_by_field minor inefficiency
When called with a list of course IDs, this change makes it preload
the contexts and categories before further processing. This saves a
number of queries, depending on how many courses you call it for.

(Typically the function is called with a list of all your enrolled
courses.)

The change may also improve performance for other web services that
call the validate_courses function.
2019-07-10 18:27:42 +01:00
Albert Gasset
f19beb3279 MDL-64642 tool_mobile: Web service tool_mobile_call_external_functions 2019-03-26 16:26:06 +01:00
Juan Leyva
27190655b0 MDL-63225 webservice: Return proper debuginfo on WS exceptions
In order to make developers easy, we should give some clues about the type of the data generating exceptions.
2018-10-02 13:14:33 +02:00
sam marshall
b5311ce466 MDL-63131 Web services: Callback to allow web service overrides 2018-08-20 15:32:34 +01:00
Thom Rawson
acf94de6d5 MDL-54551 core: AJAX call redirects to login page when session expired 2018-07-18 18:07:16 +08:00
David Mudrák
4b82c15cdb MDL-60940 weblib: Introduce an ability to force cleaning of all content
The new configuration flag $CFG->forceclean overrides the noclean
option when calling format_text() so that the text is always
and unconditionally cleaned.
2018-04-11 10:23:45 +02:00
Juan Leyva
bb14a48851 MDL-60736 tool_mobile: Support session lang in WS 2018-03-21 17:27:33 +01:00
Ryan Wyllie
0377e78e36 MDL-60966 external: contexts can be passed to external format funcs 2017-12-22 13:10:39 +08:00
Andrew Nicols
d3e69bee38 Merge branch 'MDL-56751-master' of git://github.com/jleyva/moodle 2017-07-25 10:44:05 +08:00
Juan Leyva
993e817576 MDL-56751 admin: New setting to set user created tokens duration
We were using a hardcoded value for 12 months.
With this change, administrators can change the duration time via a
security setting.
2017-07-14 10:24:53 +01:00
Damyon Wiese
a60e8ba51e MDL-59365 enrol_manual: Rewrite the yui enrolment popup in amd
The add/roles thing was only converted to bootstrap 2/4 markup and the yui left in place.

The modal for adding users to a course was unsavable so I rewrote it with an mform in a popup, still calling
the same (barely) modified ajax script.

The webservice for searching cohorts was taken from admin/tool/lp and moved into /cohort. I added a generic "cohort"
mform element at the same time.

The webservice for searching for users was taken from the original ajax script.
2017-07-11 13:47:26 +01:00
Ankit Agarwal
9743b2d4a9 MDL-58701 phpunit: Add tests for external_settings 2017-04-27 09:37:53 +05:30
Ankit Agarwal
1d772481dd MDL-58701 libraries: Use pluginfile.php as rewrite url for web req. 2017-04-27 09:37:53 +05:30
Ankit Agarwal
34773ccf70 MDL-58691 exporter: Filters should always apply for web pages
The variables AJAX_SCIRPT, CLI_SCRIPT, WS_SERVER are always defined (and set to false)
when webpages are rendered, hence the check of 'defined' is invalid
2017-04-24 13:43:11 +05:30
Juan Leyva
1104a9fa44 MDL-58399 webservice: Return additional file fields for repositories
We should be detecting when we are treating files that are linked to
external repositories.
For doing that we'd need to return some additional fields via Web
Services:
- isexternalfile
- mimetype (google docs files use an special one)
- repositorytype (the repository plugin name)
2017-03-28 20:23:16 +02:00
Damyon Wiese
b9b409cfc3 MDL-40759 icons: Peer review fixes (all minor) 2017-03-17 15:52:46 +08:00
Damyon Wiese
95b06c13c6 MDL-40759 icons: Refactor icon system to be extensible. 2017-03-17 15:51:29 +08:00