1441 |
ariadna |
1 |
# core (subsystem) Upgrade notes
|
|
|
2 |
|
|
|
3 |
## 5.0.2+
|
|
|
4 |
|
|
|
5 |
### Added
|
|
|
6 |
|
|
|
7 |
- The Behat `::execute()` method now accepts an array-style callable in addition to the string `classname::method` format.
|
|
|
8 |
|
|
|
9 |
The following formats are now accepted:
|
|
|
10 |
|
|
|
11 |
```php
|
|
|
12 |
// String format:
|
|
|
13 |
$this->execute('behat_general::i_click_on', [...]);
|
|
|
14 |
|
|
|
15 |
// Array format:
|
|
|
16 |
$this->execute([behat_general::class,' i_click_on'], [...]);
|
|
|
17 |
```
|
|
|
18 |
|
|
|
19 |
For more information see [MDL-86231](https://tracker.moodle.org/browse/MDL-86231)
|
|
|
20 |
- The `\externallib_advanced_testcase` has been replaced by `\core_external\tests\externallib_testcase` and is now autoloadable.
|
|
|
21 |
|
|
|
22 |
For more information see [MDL-86283](https://tracker.moodle.org/browse/MDL-86283)
|
|
|
23 |
|
|
|
24 |
### Changed
|
|
|
25 |
|
|
|
26 |
- The `\core\output\local\dropdown\dialog` class constructor now accepts a `$definition['autoclose']` parameter to define autoclose behaviour of the element
|
|
|
27 |
|
|
|
28 |
For more information see [MDL-86015](https://tracker.moodle.org/browse/MDL-86015)
|
|
|
29 |
- The default PHPUnit configuration now enables the following properties, ensuring PHP warnings will cause test failures (restoring pre-PHPUnit version 10 behaviour):
|
|
|
30 |
|
|
|
31 |
* `failOnDeprecation`
|
|
|
32 |
* `failOnWarning`
|
|
|
33 |
|
|
|
34 |
For more information see [MDL-86311](https://tracker.moodle.org/browse/MDL-86311)
|
|
|
35 |
|
|
|
36 |
## 5.0.2
|
|
|
37 |
|
|
|
38 |
### Added
|
|
|
39 |
|
|
|
40 |
- Add a new method has_valid_group in \core\report_helper that will return true or false depending if the user has a valid group. This is mainly false in case the user is not in any group in SEPARATEGROUPS. Used in report_log and report_loglive
|
|
|
41 |
|
|
|
42 |
For more information see [MDL-84464](https://tracker.moodle.org/browse/MDL-84464)
|
|
|
43 |
|
|
|
44 |
### Changed
|
|
|
45 |
|
|
|
46 |
- The `\core\attribute\deprecated` attribute constructor `$replacement` parameter now defaults to null, and can be omitted
|
|
|
47 |
|
|
|
48 |
For more information see [MDL-84531](https://tracker.moodle.org/browse/MDL-84531)
|
|
|
49 |
- Added a new `\core\deprecation::emit_deprecation()` method which should be used in places where a deprecation is known to occur. This method will throw debugging if no deprecation notice was found, for example:
|
|
|
50 |
```php
|
|
|
51 |
public function deprecated_method(): void {
|
|
|
52 |
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
|
|
53 |
}
|
|
|
54 |
```
|
|
|
55 |
|
|
|
56 |
For more information see [MDL-85897](https://tracker.moodle.org/browse/MDL-85897)
|
|
|
57 |
|
|
|
58 |
## 5.0.1
|
|
|
59 |
|
|
|
60 |
### Added
|
|
|
61 |
|
|
|
62 |
- - Added is_site_registered_in_hub method in lib/classes/hub/api.php to
|
|
|
63 |
check if the site is registered or not.
|
|
|
64 |
- Added get_secret method in lib/classes/hub/registration.php to get site's secret.
|
|
|
65 |
|
|
|
66 |
For more information see [MDL-83448](https://tracker.moodle.org/browse/MDL-83448)
|
|
|
67 |
- Added a new optional param to adhoc_task_failed and scheduled_task_failed to allow skipping log finalisation when called from a separate task.
|
|
|
68 |
|
|
|
69 |
For more information see [MDL-84442](https://tracker.moodle.org/browse/MDL-84442)
|
|
|
70 |
- There is a new `core/page_title` Javascript module for manipulating the current page title
|
|
|
71 |
|
|
|
72 |
For more information see [MDL-84804](https://tracker.moodle.org/browse/MDL-84804)
|
|
|
73 |
|
|
|
74 |
## 5.0
|
|
|
75 |
|
|
|
76 |
### Added
|
|
|
77 |
|
|
|
78 |
- The `core/sortable_list` Javascript module now emits native events, removing the jQuery dependency from calling code that wants to listen for the events. Backwards compatibility with existing code using jQuery is preserved
|
|
|
79 |
|
|
|
80 |
For more information see [MDL-72293](https://tracker.moodle.org/browse/MDL-72293)
|
|
|
81 |
- `\core\output\activity_header` now uses the `is_title_allowed()` method when setting the title in the constructor.
|
|
|
82 |
|
|
|
83 |
This method has been improved to give priority to the 'notitle' option in the theme config for the current page layout, over the top-level option in the theme.
|
|
|
84 |
|
|
|
85 |
For example, the Boost theme sets `$THEME->activityheaderconfig['notitle'] = true;` by default, but in its `secure` pagelayout, it has `'notitle' = false`.
|
|
|
86 |
This prevents display of the title in all layouts except `secure`.
|
|
|
87 |
|
|
|
88 |
For more information see [MDL-75610](https://tracker.moodle.org/browse/MDL-75610)
|
|
|
89 |
- Behat now supports email content verification using Mailpit.
|
|
|
90 |
You can check the contents of an email using the step `Then the email to "user@example.com" with subject containing "subject" should contain "content".`
|
|
|
91 |
To use this feature:
|
|
|
92 |
1. Ensure that Mailpit is running
|
|
|
93 |
2. Define the following constants in your `config.php`:
|
|
|
94 |
- `TEST_EMAILCATCHER_MAIL_SERVER` - The Mailpit server address (e.g. `0.0.0.0:1025`)
|
|
|
95 |
- `TEST_EMAILCATCHER_API_SERVER` - The Mailpit API server (qe.g. `http://localhost:8025`)
|
|
|
96 |
|
|
|
97 |
3. Ensure that the email catcher is set up using the step `Given an email catcher server is configured`.
|
|
|
98 |
|
|
|
99 |
For more information see [MDL-75971](https://tracker.moodle.org/browse/MDL-75971)
|
|
|
100 |
- A new core\ip_utils::normalize_internet_address() method is created to sanitize an IP address, a range of IP addresses, a domain name or a wildcard domain matching pattern.
|
|
|
101 |
|
|
|
102 |
Moodle previously allowed entries such as 192.168. or .moodle.org for certain variables (eg: $CFG->proxybypass). Since MDL-74289, these formats are no longer allowed. This method converts this informations into an authorized format. For example, 192.168. becomes 192.168.0.0/16 and .moodle.org becomes *.moodle.org.
|
|
|
103 |
|
|
|
104 |
Also a new core\ip_utils::normalize_internet_address_list() method is created. Based on core\ip_utils::normalize_internet_address(), this method normalizes a string containing a series of Internet addresses.
|
|
|
105 |
|
|
|
106 |
For more information see [MDL-79121](https://tracker.moodle.org/browse/MDL-79121)
|
|
|
107 |
- The stored progress API has been updated. The `\core\output\stored_progress_bar` class has
|
|
|
108 |
now has a `store_pending()` method, which will create a record for the stored process, but
|
|
|
109 |
without a start time or progress percentage.
|
|
|
110 |
`\core\task\stored_progress_task_trait` has been updated with a new `initialise_stored_progress()` method,
|
|
|
111 |
which will call `store_pending()` for the task's progress bar. This allows the progress bar to be displayed
|
|
|
112 |
in a "pending" state, to show that a process has been queued but not started.
|
|
|
113 |
|
|
|
114 |
For more information see [MDL-81714](https://tracker.moodle.org/browse/MDL-81714)
|
|
|
115 |
- A new `\core\output\task_indicator` component has been added to display a progress bar and message
|
|
|
116 |
for a background task using `\core\task\stored_progress_task_trait`. See the "Task indicator"
|
|
|
117 |
page in the component library for usage details.
|
|
|
118 |
|
|
|
119 |
For more information see [MDL-81714](https://tracker.moodle.org/browse/MDL-81714)
|
|
|
120 |
- The deprecated implementation in course/view.php, which uses the extern_server_course function to handle routing between internal and external courses, can be improved by utilizing the Hook API. This enhancement is essential for a project involving multiple universities, as the Hook API provides a more generalized and flexible approach to route users to external courses from within other plugins.
|
|
|
121 |
|
|
|
122 |
For more information see [MDL-83473](https://tracker.moodle.org/browse/MDL-83473)
|
|
|
123 |
- Add after_role_switched hook that is triggered when we switch role to a new role in a course.
|
|
|
124 |
|
|
|
125 |
For more information see [MDL-83542](https://tracker.moodle.org/browse/MDL-83542)
|
|
|
126 |
- New generic collapsable section output added. Use core\output\local\collapsable_section or include the core/local/collapsable_section template to use it. See the full documentation in the component library.
|
|
|
127 |
|
|
|
128 |
For more information see [MDL-83869](https://tracker.moodle.org/browse/MDL-83869)
|
|
|
129 |
- A new method get_instance_record has been added to cm_info object so core can get the activity table record without using the $DB object every time. Also, the method caches de result so getting more than once per execution is much faster.
|
|
|
130 |
|
|
|
131 |
For more information see [MDL-83892](https://tracker.moodle.org/browse/MDL-83892)
|
|
|
132 |
- Now lib/templates/select_menu.mustache has a new integer headinglevel context value to specify the heading level to keep the header accessibility when used as a tertiary navigation.
|
|
|
133 |
|
|
|
134 |
For more information see [MDL-84208](https://tracker.moodle.org/browse/MDL-84208)
|
|
|
135 |
- The public method `get_slashargument` has been added to the `url` class.
|
|
|
136 |
|
|
|
137 |
For more information see [MDL-84351](https://tracker.moodle.org/browse/MDL-84351)
|
|
|
138 |
- The new PHP enum core\output\local\properties\iconsize can be used to limit the amount of icons sizes an output component can use. The enum has the same values available in the theme_boost scss.
|
|
|
139 |
|
|
|
140 |
For more information see [MDL-84555](https://tracker.moodle.org/browse/MDL-84555)
|
|
|
141 |
- A new method, `core_text::trim_ctrl_chars()`, has been introduced to clean control characters from text. This ensures cleaner input handling and prevents issues caused by invisible or non-printable characters
|
|
|
142 |
|
|
|
143 |
For more information see [MDL-84907](https://tracker.moodle.org/browse/MDL-84907)
|
|
|
144 |
|
|
|
145 |
### Changed
|
|
|
146 |
|
|
|
147 |
- The {user_preferences}.value database field is now TEXT instead of CHAR. This means that any queries with a condition on this field in a WHERE or JOIN statement will need updating to use `$DB->sql_compare_text()`. See the `$newusers` query in `\core\task\send_new_users_password_task::execute` for an example.
|
|
|
148 |
|
|
|
149 |
For more information see [MDL-46739](https://tracker.moodle.org/browse/MDL-46739)
|
|
|
150 |
- The `core_renderer::tag_list` function now has a new parameter named `displaylink`. When `displaylink` is set to `true`, the tag name will be displayed as a clickable hyperlink. Otherwise, it will be rendered as plain text.
|
|
|
151 |
|
|
|
152 |
For more information see [MDL-75075](https://tracker.moodle.org/browse/MDL-75075)
|
|
|
153 |
- All uses of the following PHPUnit methods have been removed as these methods are
|
|
|
154 |
deprecated upstream without direct replacement:
|
|
|
155 |
|
|
|
156 |
- `withConsecutive`
|
|
|
157 |
- `willReturnConsecutive`
|
|
|
158 |
- `onConsecutive`
|
|
|
159 |
|
|
|
160 |
Any plugin using these methods must update their uses.
|
|
|
161 |
|
|
|
162 |
For more information see [MDL-81308](https://tracker.moodle.org/browse/MDL-81308)
|
|
|
163 |
- PHPSpreadSheet has been updated to version 4.0.0.
|
|
|
164 |
|
|
|
165 |
All library usage should be via the Moodle wrapper and no change should be required.
|
|
|
166 |
|
|
|
167 |
For more information see [MDL-81664](https://tracker.moodle.org/browse/MDL-81664)
|
|
|
168 |
- The Moodle subplugins.json format has been updated to accept a new `subplugintypes` object.
|
|
|
169 |
|
|
|
170 |
This should have the same format as the current `plugintypes` format, except that the paths should be relative to the _plugin_ root instead of the Moodle document root.
|
|
|
171 |
|
|
|
172 |
Both options can co-exist, but if both are present they must be kept in-sync.
|
|
|
173 |
|
|
|
174 |
```json
|
|
|
175 |
{
|
|
|
176 |
"subplugintypes": {
|
|
|
177 |
"tiny": "plugins"
|
|
|
178 |
},
|
|
|
179 |
"plugintypes": {
|
|
|
180 |
"tiny": "lib/editor/tiny/plugins"
|
|
|
181 |
}
|
|
|
182 |
}
|
|
|
183 |
```
|
|
|
184 |
|
|
|
185 |
For more information see [MDL-83705](https://tracker.moodle.org/browse/MDL-83705)
|
|
|
186 |
- The behat/gherkin has been updated to 4.11.0 which introduces a breaking change where backslashes in feature files need to be escaped.
|
|
|
187 |
|
|
|
188 |
For more information see [MDL-83848](https://tracker.moodle.org/browse/MDL-83848)
|
|
|
189 |
- The following test classes have been moved into autoloadable locations:
|
|
|
190 |
|
|
|
191 |
| Old location | New classname |
|
|
|
192 |
| --- | --- |
|
|
|
193 |
| `\core\tests\route_testcase` | `\core\tests\router\route_testcase` |
|
|
|
194 |
| `\core\router\mocking_route_loader` | `\core\tests\router\mocking_route_loader` |
|
|
|
195 |
|
|
|
196 |
For more information see [MDL-83968](https://tracker.moodle.org/browse/MDL-83968)
|
|
|
197 |
- Analytics is now disabled by default on new installs.
|
|
|
198 |
|
|
|
199 |
For more information see [MDL-84107](https://tracker.moodle.org/browse/MDL-84107)
|
|
|
200 |
|
|
|
201 |
### Deprecated
|
|
|
202 |
|
|
|
203 |
- The methods `want_read_slave` and `perf_get_reads_slave` in `lib/dml/moodle_database.php` have been deprecated in favour of renamed versions that substitute `slave` for `replica`.
|
|
|
204 |
|
|
|
205 |
For more information see [MDL-71257](https://tracker.moodle.org/browse/MDL-71257)
|
|
|
206 |
- The trait `moodle_read_slave_trait` has been deprecated in favour of a functionally identical version called `moodle_read_replica_trait`. The renamed trait substitutes the terminology of `slave` with `replica`, and `master` with `primary`.
|
|
|
207 |
|
|
|
208 |
For more information see [MDL-71257](https://tracker.moodle.org/browse/MDL-71257)
|
|
|
209 |
- question_make_default_categories()
|
|
|
210 |
|
|
|
211 |
No longer creates a default category in either CONTEXT_SYSTEM, CONTEXT_COURSE, or CONTEXT_COURSECAT.
|
|
|
212 |
Superceded by question_get_default_category which can optionally create one if it does not exist.
|
|
|
213 |
|
|
|
214 |
For more information see [MDL-71378](https://tracker.moodle.org/browse/MDL-71378)
|
|
|
215 |
- question_delete_course()
|
|
|
216 |
|
|
|
217 |
No replacement. Course contexts no longer hold question categories.
|
|
|
218 |
|
|
|
219 |
For more information see [MDL-71378](https://tracker.moodle.org/browse/MDL-71378)
|
|
|
220 |
- question_delete_course_category()
|
|
|
221 |
|
|
|
222 |
Course category contexts no longer hold question categories.
|
|
|
223 |
|
|
|
224 |
For more information see [MDL-71378](https://tracker.moodle.org/browse/MDL-71378)
|
|
|
225 |
- The 'core_renderer::sr_text()' function has been deprecated, use 'core_renderer::visually_hidden_text()' instead.
|
|
|
226 |
|
|
|
227 |
For more information see [MDL-81825](https://tracker.moodle.org/browse/MDL-81825)
|
|
|
228 |
- The function imagecopybicubic() is now deprecated. The GD lib is a strict requirement, so use imagecopyresampled() instead.
|
|
|
229 |
|
|
|
230 |
For more information see [MDL-84449](https://tracker.moodle.org/browse/MDL-84449)
|
|
|
231 |
|
|
|
232 |
### Removed
|
|
|
233 |
|
|
|
234 |
- moodle_process_email() has been deprecated with the removal of the unused and non-functioning admin/process_email.php.
|
|
|
235 |
|
|
|
236 |
For more information see [MDL-61232](https://tracker.moodle.org/browse/MDL-61232)
|
|
|
237 |
- The method `site_registration_form::add_select_with_email()` has been finally deprecated and will now throw an exception if called.
|
|
|
238 |
|
|
|
239 |
For more information see [MDL-71472](https://tracker.moodle.org/browse/MDL-71472)
|
|
|
240 |
- Remove support deprecated boolean 'primary' parameter in \core\output\single_button. The 4th parameter is now a string and not a boolean (the use was to set it to true to have a primary button)
|
|
|
241 |
|
|
|
242 |
For more information see [MDL-75875](https://tracker.moodle.org/browse/MDL-75875)
|
|
|
243 |
- Final removal of the following constants/methods from the `\core\encyption` class, removing support for OpenSSL fallback:
|
|
|
244 |
|
|
|
245 |
- `METHOD_OPENSSL`
|
|
|
246 |
- `OPENSSL_CIPHER`
|
|
|
247 |
- `is_sodium_installed`
|
|
|
248 |
|
|
|
249 |
For more information see [MDL-78869](https://tracker.moodle.org/browse/MDL-78869)
|
|
|
250 |
- Final deprecation of core_renderer\activity_information()
|
|
|
251 |
|
|
|
252 |
For more information see [MDL-78926](https://tracker.moodle.org/browse/MDL-78926)
|
|
|
253 |
- Final removal of `share_activity()` in `core\moodlenet\activity_sender`, please use `share_resource()` instead.
|
|
|
254 |
|
|
|
255 |
For more information see [MDL-79086](https://tracker.moodle.org/browse/MDL-79086)
|
|
|
256 |
- Final deprecation of methods `task_base::is_blocking` and `task_base::set_blocking`.
|
|
|
257 |
|
|
|
258 |
For more information see [MDL-81509](https://tracker.moodle.org/browse/MDL-81509)
|
|
|
259 |
- - Remove php-enum library. - It was a dependency of zipstream, but is no longer required as this
|
|
|
260 |
functionality has been replaced by native PHP functionality.
|
|
|
261 |
|
|
|
262 |
For more information see [MDL-82825](https://tracker.moodle.org/browse/MDL-82825)
|
|
|
263 |
- Oracle support has been removed in LMS
|
|
|
264 |
|
|
|
265 |
For more information see [MDL-83172](https://tracker.moodle.org/browse/MDL-83172)
|
|
|
266 |
- The Atto HTML editor has been removed from core, along with all standard
|
|
|
267 |
subplugins.
|
|
|
268 |
|
|
|
269 |
The editor is available for continued use in the Plugins Database.
|
|
|
270 |
|
|
|
271 |
For more information see [MDL-83282](https://tracker.moodle.org/browse/MDL-83282)
|
|
|
272 |
- Support for `subplugins.php` files has been removed. All subplugin metadata must be created in a `subplugins.json` file.
|
|
|
273 |
|
|
|
274 |
For more information see [MDL-83703](https://tracker.moodle.org/browse/MDL-83703)
|
|
|
275 |
- set_alignment(), set_constraint() and do_not_enhance() functions have been fully removed from action_menu class.
|
|
|
276 |
|
|
|
277 |
For more information see [MDL-83765](https://tracker.moodle.org/browse/MDL-83765)
|
|
|
278 |
- The `core_output_load_fontawesome_icon_map` web service has been fully removed and replaced by `core_output_load_fontawesome_icon_system_map`
|
|
|
279 |
|
|
|
280 |
For more information see [MDL-84036](https://tracker.moodle.org/browse/MDL-84036)
|
|
|
281 |
- Final deprecation and removal of \core\event\course_module_instances_list_viewed
|
|
|
282 |
|
|
|
283 |
For more information see [MDL-84593](https://tracker.moodle.org/browse/MDL-84593)
|
|
|
284 |
|
|
|
285 |
### Fixed
|
|
|
286 |
|
|
|
287 |
- url class now correctly supports multi level query parameter parsing and output.
|
|
|
288 |
|
|
|
289 |
This was previously supported in some methods such as get_query_string, but not others. This has been fixed to be properly supported.
|
|
|
290 |
|
|
|
291 |
For example https://example.moodle.net?test[2]=a&test[0]=b will be parsed as ['test' => [2 => 'a', 0 => 'b']]
|
|
|
292 |
|
|
|
293 |
All parameter values that are not arrays are casted to strings.
|
|
|
294 |
|
|
|
295 |
For more information see [MDL-77293](https://tracker.moodle.org/browse/MDL-77293)
|
|
|
296 |
|
|
|
297 |
## 4.5
|
|
|
298 |
|
|
|
299 |
### Added
|
|
|
300 |
|
|
|
301 |
- A new method, `\core_user::get_name_placeholders()`, has been added to return an array of user name fields.
|
|
|
302 |
|
|
|
303 |
For more information see [MDL-64148](https://tracker.moodle.org/browse/MDL-64148)
|
|
|
304 |
- The following classes have been renamed and now support autoloading.
|
|
|
305 |
Existing classes are currently unaffected.
|
|
|
306 |
|
|
|
307 |
| Old class name | New class name |
|
|
|
308 |
| --- | --- |
|
|
|
309 |
| `\core_component` | `\core\component` |
|
|
|
310 |
|
|
|
311 |
For more information see [MDL-66903](https://tracker.moodle.org/browse/MDL-66903)
|
|
|
312 |
- Added the ability for unit tests to autoload classes in the `\[component]\tests\`
|
|
|
313 |
namespace from the `[path/to/component]/tests/classes` directory.
|
|
|
314 |
|
|
|
315 |
For more information see [MDL-66903](https://tracker.moodle.org/browse/MDL-66903)
|
|
|
316 |
- Added a helper to load fixtures from a components `tests/fixtures/` folder:
|
|
|
317 |
|
|
|
318 |
```php
|
|
|
319 |
advanced_testcase::load_fixture(string $component, string $fixture): void;
|
|
|
320 |
```
|
|
|
321 |
|
|
|
322 |
For more information see [MDL-66903](https://tracker.moodle.org/browse/MDL-66903)
|
|
|
323 |
- Redis session cache has been improved to make a single call where two were used before.
|
|
|
324 |
|
|
|
325 |
For more information see [MDL-69684](https://tracker.moodle.org/browse/MDL-69684)
|
|
|
326 |
- Added stored progress bars
|
|
|
327 |
|
|
|
328 |
For more information see [MDL-70854](https://tracker.moodle.org/browse/MDL-70854)
|
|
|
329 |
- Two new functions have been introduced in the `\moodle_database` class:
|
|
|
330 |
- `\moodle_database::get_counted_records_sql()`
|
|
|
331 |
- `\moodle_database::get_counted_recordset_sql()`
|
|
|
332 |
|
|
|
333 |
These methods are compatible with all databases.
|
|
|
334 |
|
|
|
335 |
They will check the current running database engine and apply the `COUNT` window function if it is supported,
|
|
|
336 |
otherwise, they will use the usual `COUNT` function.
|
|
|
337 |
|
|
|
338 |
The `COUNT` window function optimization is applied to the following databases:
|
|
|
339 |
- PostgreSQL
|
|
|
340 |
- MariaDB
|
|
|
341 |
- Oracle
|
|
|
342 |
|
|
|
343 |
Note: MySQL and SQL Server do not use this optimization due to insignificant performance differences before and
|
|
|
344 |
after the improvement.
|
|
|
345 |
|
|
|
346 |
For more information see [MDL-78030](https://tracker.moodle.org/browse/MDL-78030)
|
|
|
347 |
- The `after_config()` callback has been converted to a hook, `\core\hook\after_config`.
|
|
|
348 |
|
|
|
349 |
For more information see [MDL-79011](https://tracker.moodle.org/browse/MDL-79011)
|
|
|
350 |
- The `\core\output\select_menu` widget now supports rendering dividers between menu options. Empty elements (`null` or empty strings) within the array of options are considered and rendered as dividers in the dropdown menu.
|
|
|
351 |
|
|
|
352 |
For more information see [MDL-80747](https://tracker.moodle.org/browse/MDL-80747)
|
|
|
353 |
- The `\core\output\select_menu` widget now supports a new feature: inline labels. You can render the label inside the combobox widget by passing `true` to the `$inlinelabel` parameter when calling the `->set_label()` method.
|
|
|
354 |
|
|
|
355 |
For more information see [MDL-80747](https://tracker.moodle.org/browse/MDL-80747)
|
|
|
356 |
- A new hook called `\core\hook\output\after_http_headers` has been created. This hook allow plugins to modify the content after headers are sent.
|
|
|
357 |
|
|
|
358 |
For more information see [MDL-80890](https://tracker.moodle.org/browse/MDL-80890)
|
|
|
359 |
- The following classes have been renamed.
|
|
|
360 |
Existing classes are currently unaffected.
|
|
|
361 |
|
|
|
362 |
| Old class name | New class name |
|
|
|
363 |
| --- | --- |
|
|
|
364 |
| `\core_user` | `\core\user` |
|
|
|
365 |
|
|
|
366 |
For more information see [MDL-81031](https://tracker.moodle.org/browse/MDL-81031)
|
|
|
367 |
- New DML constant `SQL_INT_MAX` to define the size of a large integer with cross database platform support.
|
|
|
368 |
|
|
|
369 |
For more information see [MDL-81282](https://tracker.moodle.org/browse/MDL-81282)
|
|
|
370 |
- Added a new `exception` L2 Namespace to APIs.
|
|
|
371 |
|
|
|
372 |
For more information see [MDL-81903](https://tracker.moodle.org/browse/MDL-81903)
|
|
|
373 |
- Added a mechanism to support autoloading of legacy class files.
|
|
|
374 |
This will help to reduce the number of `require_once` calls in the codebase, and move away from the use of monolithic libraries.
|
|
|
375 |
|
|
|
376 |
For more information see [MDL-81919](https://tracker.moodle.org/browse/MDL-81919)
|
|
|
377 |
- The following exceptions are now also available in the `\core\exception` namespace:
|
|
|
378 |
|
|
|
379 |
- `\coding_exception`
|
|
|
380 |
- `\file_serving_exception`
|
|
|
381 |
- `\invalid_dataroot_permissions`
|
|
|
382 |
- `\invalid_parameter_exception`
|
|
|
383 |
- `\invalid_response_exception`
|
|
|
384 |
- `\invalid_state_exception`
|
|
|
385 |
- `\moodle_exception`
|
|
|
386 |
- `\require_login_exception`
|
|
|
387 |
- `\require_login_session_timeout_exception`
|
|
|
388 |
- `\required_capability_exception`
|
|
|
389 |
- `\webservice_parameter_exception`
|
|
|
390 |
|
|
|
391 |
For more information see [MDL-81919](https://tracker.moodle.org/browse/MDL-81919)
|
|
|
392 |
- The following classes are now also available in the `\core\` namespace and support autoloading:
|
|
|
393 |
|
|
|
394 |
| Old class name | New class name |
|
|
|
395 |
| --- | --- |
|
|
|
396 |
| `\emoticon_manager` | `\core\emoticon_manager` |
|
|
|
397 |
| `\lang_string` | `\core\lang_string` |
|
|
|
398 |
|
|
|
399 |
For more information see [MDL-81920](https://tracker.moodle.org/browse/MDL-81920)
|
|
|
400 |
- The following classes have been renamed and now support autoloading.
|
|
|
401 |
Existing classes are currently unaffected.
|
|
|
402 |
|
|
|
403 |
| Old class name | New class name |
|
|
|
404 |
| --- | --- |
|
|
|
405 |
| `\moodle_url` | `\core\url` |
|
|
|
406 |
| `\progress_trace` | `\core\output\progress_trace` |
|
|
|
407 |
| `\combined_progress_trace` | `\core\output\progress_trace\combined_progress_trace` |
|
|
|
408 |
| `\error_log_progress_trace` | `\core\output\progress_trace\error_log_progress_trace` |
|
|
|
409 |
| `\html_list_progress_trace` | `\core\output\progress_trace\html_list_progress_trace` |
|
|
|
410 |
| `\html_progress_trace` | `\core\output\progress_trace\html_progress_trace` |
|
|
|
411 |
| `\null_progress_trace` | `\core\output\progress_trace\null_progress_trace` |
|
|
|
412 |
| `\progress_trace_buffer` | `\core\output\progress_trace\progress_trace_buffer` |
|
|
|
413 |
| `\text_progress_trace` | `\core\output\progress_trace\text_progress_trace` |
|
|
|
414 |
|
|
|
415 |
For more information see [MDL-81960](https://tracker.moodle.org/browse/MDL-81960)
|
|
|
416 |
- The following classes are now also available in the following new
|
|
|
417 |
locations. They will continue to work in their old locations:
|
|
|
418 |
|
|
|
419 |
| Old classname | New classname |
|
|
|
420 |
| --- | --- |
|
|
|
421 |
| `\action_link` | `\core\output\action_link` |
|
|
|
422 |
| `\action_menu_filler` | `\core\output\action_menu\filler` |
|
|
|
423 |
| `\action_menu_link_primary` | `\core\output\action_menu\link_primary` |
|
|
|
424 |
| `\action_menu_link_secondary` | `\core\output\action_menu\link_secondary` |
|
|
|
425 |
| `\action_menu_link` | `\core\output\action_menu\link` |
|
|
|
426 |
| `\action_menu` | `\core\output\action_menu` |
|
|
|
427 |
| `\block_contents` | `\core_block\output\block_contents` |
|
|
|
428 |
| `\block_move_target` | `\core_block\output\block_move_target` |
|
|
|
429 |
| `\component_action` | `\core\output\actions\component_action` |
|
|
|
430 |
| `\confirm_action` | `\core\output\actions\confirm_action` |
|
|
|
431 |
| `\context_header` | `\core\output\context_header` |
|
|
|
432 |
| `\core\output\local\action_menu\subpanel` | `\core\output\action_menu\subpanel` |
|
|
|
433 |
| `\core_renderer_ajax` | `\core\output\core_renderer_ajax` |
|
|
|
434 |
| `\core_renderer_cli` | `\core\output\core_renderer_cli` |
|
|
|
435 |
| `\core_renderer_maintenance` | `\core\output\core_renderer_maintenance` |
|
|
|
436 |
| `\core_renderer` | `\core\output\core_renderer` |
|
|
|
437 |
| `\custom_menu_item` | `\core\output\custom_menu_item` |
|
|
|
438 |
| `\custom_menu` | `\core\output\custom_menu` |
|
|
|
439 |
| `\file_picker` | `\core\output\file_picker` |
|
|
|
440 |
| `\flexible_table` | `\core_table\flexible_table` |
|
|
|
441 |
| `\fragment_requirements_manager` | `\core\output\requirements\fragment_requirements_manager` |
|
|
|
442 |
| `\help_icon` | `\core\output\help_icon` |
|
|
|
443 |
| `\html_table_cell` | `\core_table\output\html_table_cell` |
|
|
|
444 |
| `\html_table_row` | `\core_table\output\html_table_row` |
|
|
|
445 |
| `\html_table` | `\core_table\output\html_table` |
|
|
|
446 |
| `\html_writer` | `\core\output\html_writer` |
|
|
|
447 |
| `\image_icon` | `\core\output\image_icon` |
|
|
|
448 |
| `\initials_bar` | `\core\output\initials_bar` |
|
|
|
449 |
| `\js_writer` | `\core\output\js_writer` |
|
|
|
450 |
| `\page_requirements_manager` | `\core\output\requirements\page_requirements_manager` |
|
|
|
451 |
| `\paging_bar` | `\core\output\paging_bar` |
|
|
|
452 |
| `\pix_emoticon` | `\core\output\pix_emoticon` |
|
|
|
453 |
| `\pix_icon_font` | `\core\output\pix_icon_font` |
|
|
|
454 |
| `\pix_icon_fontawesome` | `\core\output\pix_icon_fontawesome` |
|
|
|
455 |
| `\pix_icon` | `\core\output\pix_icon` |
|
|
|
456 |
| `\plugin_renderer_base` | `\core\output\plugin_renderer_base` |
|
|
|
457 |
| `\popup_action` | `\core\output\actions\popup_action` |
|
|
|
458 |
| `\preferences_group` | `\core\output\preferences_group` |
|
|
|
459 |
| `\preferences_groups` | `\core\output\preferences_groups` |
|
|
|
460 |
| `\progress_bar` | `\core\output\progress_bar` |
|
|
|
461 |
| `\renderable` | `\core\output\renderable` |
|
|
|
462 |
| `\renderer_base` | `\core\output\renderer_base` |
|
|
|
463 |
| `\renderer_factory_base` | `\core\output\renderer_factory\renderer_factory_base` |
|
|
|
464 |
| `\renderer_factory` | `\core\output\renderer_factory\renderer_factory_interface` |
|
|
|
465 |
| `\single_button` | `\core\output\single_button` |
|
|
|
466 |
| `\single_select` | `\core\output\single_select` |
|
|
|
467 |
| `\standard_renderer_factory` | `\core\output\renderer_factory\standard_renderer_factory` |
|
|
|
468 |
| `\table_dataformat_export_format` | `\core_table\dataformat_export_format` |
|
|
|
469 |
| `\table_default_export_format_parent` | `\core_table\base_export_format` |
|
|
|
470 |
| `\table_sql` | `\core_table\sql_table` |
|
|
|
471 |
| `\tabobject` | `\core\output\tabobject` |
|
|
|
472 |
| `\tabtree` | `\core\output\tabtree` |
|
|
|
473 |
| `\templatable` | `\core\output\templatable` |
|
|
|
474 |
| `\theme_config` | `\core\output\theme_config` |
|
|
|
475 |
| `\theme_overridden_renderer_factory` | `\core\output\renderer_factory\theme_overridden_renderer_factory` |
|
|
|
476 |
| `\url_select` | `\core\output\url_select` |
|
|
|
477 |
| `\user_picture` | `\core\output\user_picture` |
|
|
|
478 |
| `\xhtml_container_stack` | `\core\output\xhtml_container_stack` |
|
|
|
479 |
| `\YUI_config` | `\core\output\requirements\yui` |
|
|
|
480 |
|
|
|
481 |
For more information see [MDL-82183](https://tracker.moodle.org/browse/MDL-82183)
|
|
|
482 |
- A new method, `\core\output\::get_deprecated_icons()`, has been added to the `icon_system` class. All deprecated icons should be registered through this method.
|
|
|
483 |
Plugins can implement a callback to `pluginname_get_deprecated_icons()` to register their deprecated icons too.
|
|
|
484 |
When `$CFG->debugpageinfo` is enabled, a console message will display a list of the deprecated icons.
|
|
|
485 |
|
|
|
486 |
For more information see [MDL-82212](https://tracker.moodle.org/browse/MDL-82212)
|
|
|
487 |
- Two new optional parameters have been added to the `\core\output\notification` constructor:
|
|
|
488 |
- `null|string $title` - `null|string $icon`
|
|
|
489 |
|
|
|
490 |
For more information see [MDL-82297](https://tracker.moodle.org/browse/MDL-82297)
|
|
|
491 |
- A new method, `\url_select::set_disabled_option()`, has been added to enable or disable an option from its url (the key for the option).
|
|
|
492 |
|
|
|
493 |
For more information see [MDL-82490](https://tracker.moodle.org/browse/MDL-82490)
|
|
|
494 |
- A new static method, `\advanced_testcase::get_fixture_path()`, has been added to enable unit tests to fetch the path to a fixture.
|
|
|
495 |
|
|
|
496 |
For more information see [MDL-82627](https://tracker.moodle.org/browse/MDL-82627)
|
|
|
497 |
- A new static method, `\advanced_testcase::get_mocked_http_client()`, has been added to allow unit tests to mock the `\core\http_client` and update the DI container.
|
|
|
498 |
|
|
|
499 |
For more information see [MDL-82627](https://tracker.moodle.org/browse/MDL-82627)
|
|
|
500 |
- The Moodle autoloader should now be registered using `\core\component::register_autoloader` rather than manually doing so in any exceptional location which requires it.
|
|
|
501 |
Note: It is not normally necessary to include the autoloader manually, as it is registered automatically when the Moodle environment is bootstrapped.
|
|
|
502 |
|
|
|
503 |
For more information see [MDL-82747](https://tracker.moodle.org/browse/MDL-82747)
|
|
|
504 |
- A new JS module for interacting with the Routed REST API has been introduced.
|
|
|
505 |
For more information see the documentation in the `core/fetch` module.
|
|
|
506 |
|
|
|
507 |
For more information see [MDL-82778](https://tracker.moodle.org/browse/MDL-82778)
|
|
|
508 |
- The `\section_info` class now includes a new method `\section_info::get_sequence_cm_infos()` that retrieves all `\cm_info` instances associated with the course section.
|
|
|
509 |
|
|
|
510 |
For more information see [MDL-82845](https://tracker.moodle.org/browse/MDL-82845)
|
|
|
511 |
- When rendering a renderable located within a namespace, the namespace
|
|
|
512 |
will now be included in the renderer method name with double-underscores
|
|
|
513 |
separating the namespace parts.
|
|
|
514 |
|
|
|
515 |
Note: Only those renderables within an `output` namespace will be
|
|
|
516 |
considered, for example `\core\output\action_menu\link` and only the
|
|
|
517 |
parts of the namespace after `output` will be included.
|
|
|
518 |
|
|
|
519 |
The following are examples of the new behaviour:
|
|
|
520 |
|
|
|
521 |
| Renderable name | Renderer method name |
|
|
|
522 |
| --- | --- |
|
|
|
523 |
| `\core\output\action_menu\link` | `render_action_menu__link` |
|
|
|
524 |
| `\core\output\action_menu\link_primary` | `render_action_menu__link_primary` |
|
|
|
525 |
| `\core\output\action\menu\link` | `render_action__menu__link` |
|
|
|
526 |
| `\core\output\user_menu\link` | `render_user_menu__link` |
|
|
|
527 |
|
|
|
528 |
For more information see [MDL-83164](https://tracker.moodle.org/browse/MDL-83164)
|
|
|
529 |
|
|
|
530 |
### Changed
|
|
|
531 |
|
|
|
532 |
- The minimum Redis server version is now 2.6.12. The minimum PHP Redis extension version is now 2.2.4.
|
|
|
533 |
|
|
|
534 |
For more information see [MDL-69684](https://tracker.moodle.org/browse/MDL-69684)
|
|
|
535 |
- The class autoloader has been moved to an earlier point in the Moodle bootstrap.
|
|
|
536 |
|
|
|
537 |
Autoloaded classes are now available to scripts using the `ABORT_AFTER_CONFIG` constant.
|
|
|
538 |
|
|
|
539 |
For more information see [MDL-80275](https://tracker.moodle.org/browse/MDL-80275)
|
|
|
540 |
- The `\core\dataformat::get_format_instance()` method is now public, and can be used to retrieve a writer instance for a given dataformat.
|
|
|
541 |
|
|
|
542 |
For more information see [MDL-81781](https://tracker.moodle.org/browse/MDL-81781)
|
|
|
543 |
- The `\get_home_page()` function can now return new constant `HOMEPAGE_URL`, applicable when a third-party hook has extended the default homepage options for the site.
|
|
|
544 |
|
|
|
545 |
A new function, `\get_default_home_page_url()` has been added which will return the correct URL when this constant is returned.
|
|
|
546 |
|
|
|
547 |
For more information see [MDL-82066](https://tracker.moodle.org/browse/MDL-82066)
|
|
|
548 |
|
|
|
549 |
### Deprecated
|
|
|
550 |
|
|
|
551 |
- The following method has been deprecated and should no longer be used: `reset_password_and_mail`. Please consider using `setnew_password_and_mail` as a replacement.
|
|
|
552 |
|
|
|
553 |
For more information see [MDL-64148](https://tracker.moodle.org/browse/MDL-64148)
|
|
|
554 |
- - The following methods have been finally deprecated and removed:
|
|
|
555 |
- `\plagiarism_plugin::get_configs()`
|
|
|
556 |
- `\plagiarism_plugin::get_file_results()`
|
|
|
557 |
- `\plagiarism_plugin::update_status()`, please use `{plugin name}_before_standard_top_of_body_html` instead.
|
|
|
558 |
- Final deprecation and removal of `\plagiarism_get_file_results()`. Please use `\plagiarism_get_links()` instead.
|
|
|
559 |
- Final deprecation and removal of `\plagiarism_update_status()`. Please use `\{plugin name}_before_standard_top_of_body_html()` instead.
|
|
|
560 |
|
|
|
561 |
For more information see [MDL-71326](https://tracker.moodle.org/browse/MDL-71326)
|
|
|
562 |
- `\moodle_list` and `\list_item` were only used by `qbank_managecategories`, and these usages have been removed, so these classes, and the `lib/listlib.php` file have now been deprecated. This method was the only usage of the `QUESTION_PAGE_LENGTH` constant, which was defined in `question_category_object.php`, and so is also now deprecated.
|
|
|
563 |
|
|
|
564 |
For more information see [MDL-72397](https://tracker.moodle.org/browse/MDL-72397)
|
|
|
565 |
- The `$timeout` property of the `\navigation_cache` class has been deprecated.
|
|
|
566 |
|
|
|
567 |
For more information see [MDL-79628](https://tracker.moodle.org/browse/MDL-79628)
|
|
|
568 |
- The following classes are deprecated as they are handled by core_sms API and smsgateway_aws plugin:
|
|
|
569 |
- `\core\aws\admin_settings_aws_region`
|
|
|
570 |
- `\core\aws\aws_helper`
|
|
|
571 |
- `\core\aws\client_factory`
|
|
|
572 |
|
|
|
573 |
For more information see [MDL-80962](https://tracker.moodle.org/browse/MDL-80962)
|
|
|
574 |
- The following methods have been deprecated, existing usage should switch to use the secure `\core\encryption::encrypt()` and `\core\encryption::decrypt()` static methods:
|
|
|
575 |
|
|
|
576 |
- `\rc4encrypt()`
|
|
|
577 |
- `\rc4decrypt()`
|
|
|
578 |
- `\endecrypt()`
|
|
|
579 |
|
|
|
580 |
For more information see [MDL-81940](https://tracker.moodle.org/browse/MDL-81940)
|
|
|
581 |
- The following method has been deprecated and should not be used any longer: `\print_grade_menu()`.
|
|
|
582 |
|
|
|
583 |
For more information see [MDL-82157](https://tracker.moodle.org/browse/MDL-82157)
|
|
|
584 |
- The following files and their contents have been deprecated:
|
|
|
585 |
|
|
|
586 |
- `lib/soaplib.php`
|
|
|
587 |
- `lib/tokeniserlib.php`
|
|
|
588 |
|
|
|
589 |
For more information see [MDL-82191](https://tracker.moodle.org/browse/MDL-82191)
|
|
|
590 |
- The following functions have been initially deprecated:
|
|
|
591 |
|
|
|
592 |
- `\get_core_subsystems()`
|
|
|
593 |
- `\get_plugin_types()`
|
|
|
594 |
- `\get_plugin_list()`
|
|
|
595 |
- `\get_plugin_list_with_class()`
|
|
|
596 |
- `\get_plugin_directory()`
|
|
|
597 |
- `\normalize_component()`
|
|
|
598 |
- `\get_component_directory()`
|
|
|
599 |
- `\get_context_instance()`
|
|
|
600 |
|
|
|
601 |
Note: These methods have been deprecated for a long time, but previously did not emit any deprecation notice.
|
|
|
602 |
|
|
|
603 |
For more information see [MDL-82287](https://tracker.moodle.org/browse/MDL-82287)
|
|
|
604 |
- The following methods have been finally deprecated and will now throw an exception if called:
|
|
|
605 |
|
|
|
606 |
- `\get_context_instance()`
|
|
|
607 |
- `\can_use_rotated_text()`
|
|
|
608 |
- `\get_system_context()`
|
|
|
609 |
- `\print_arrow()`
|
|
|
610 |
|
|
|
611 |
For more information see [MDL-82287](https://tracker.moodle.org/browse/MDL-82287)
|
|
|
612 |
- The `global_navigation::load_section_activities` method is now deprecated and replaced by `global_navigation::load_section_activities_navigation`.
|
|
|
613 |
|
|
|
614 |
For more information see [MDL-82845](https://tracker.moodle.org/browse/MDL-82845)
|
|
|
615 |
- The following renderer methods have been deprecated from the core
|
|
|
616 |
renderer:
|
|
|
617 |
|
|
|
618 |
| method | replacement |
|
|
|
619 |
| --- | --- |
|
|
|
620 |
| `render_action_menu_link` | `render_action_menu__link` |
|
|
|
621 |
| `render_action_menu_link_primary` | `render_action_menu__link_primary` |
|
|
|
622 |
| `render_action_menu_link_secondary` | `render_action_menu__link_secondary` |
|
|
|
623 |
| `render_action_menu_filler` | `render_action_menu__filler` |
|
|
|
624 |
|
|
|
625 |
For more information see [MDL-83164](https://tracker.moodle.org/browse/MDL-83164)
|
|
|
626 |
|
|
|
627 |
### Removed
|
|
|
628 |
|
|
|
629 |
- The previously deprecated function `search_generate_text_SQL` has been removed and can no longer be used.
|
|
|
630 |
|
|
|
631 |
For more information see [MDL-48940](https://tracker.moodle.org/browse/MDL-48940)
|
|
|
632 |
- The previously deprecated function `\core_text::reset_caches()` has been removed and can no longer be used.
|
|
|
633 |
|
|
|
634 |
For more information see [MDL-71748](https://tracker.moodle.org/browse/MDL-71748)
|
|
|
635 |
- The following previously deprecated methods have been removed and can no longer be used:
|
|
|
636 |
- `\renderer_base::should_display_main_logo()`
|
|
|
637 |
|
|
|
638 |
For more information see [MDL-73165](https://tracker.moodle.org/browse/MDL-73165)
|
|
|
639 |
- Final deprecation of `\print_error()`. Please use the `\moodle_exception` class instead.
|
|
|
640 |
|
|
|
641 |
For more information see [MDL-74484](https://tracker.moodle.org/browse/MDL-74484)
|
|
|
642 |
- Final deprecation of `\core\task\manager::ensure_adhoc_task_qos()`.
|
|
|
643 |
|
|
|
644 |
For more information see [MDL-74843](https://tracker.moodle.org/browse/MDL-74843)
|
|
|
645 |
- Support for the deprecated block and activity namespaces `<component>\local\views\secondary`, which supported the overriding of secondary navigation, has now been entirely removed.
|
|
|
646 |
|
|
|
647 |
For more information see [MDL-74939](https://tracker.moodle.org/browse/MDL-74939)
|
|
|
648 |
- Remove deprecation layer for YUI JS Events. The deprecation layer was introduced with MDL-70990 and MDL-72291.
|
|
|
649 |
|
|
|
650 |
For more information see [MDL-77167](https://tracker.moodle.org/browse/MDL-77167)
|
|
|
651 |
|
|
|
652 |
### Fixed
|
|
|
653 |
|
|
|
654 |
- The `\navigation_cache` class now uses the Moodle Universal Cache (MUC) to store the navigation cache data instead of storing it in the global `$SESSION` variable.
|
|
|
655 |
|
|
|
656 |
For more information see [MDL-79628](https://tracker.moodle.org/browse/MDL-79628)
|
|
|
657 |
- All the `setUp()` and `tearDown()` methods of `PHPUnit` now are required to, always, call to their parent counterparts. This is a good practice to avoid future problems, especially when updating to PHPUnit >= 10.
|
|
|
658 |
This includes the following methods:
|
|
|
659 |
- `setUp()`
|
|
|
660 |
- `tearDown()`
|
|
|
661 |
- `setUpBeforeClass()`
|
|
|
662 |
- `tearDownAfterClass()`
|
|
|
663 |
|
|
|
664 |
For more information see [MDL-81523](https://tracker.moodle.org/browse/MDL-81523)
|
|
|
665 |
- Use server timezone when constructing `\DateTimeImmutable` for the system `\core\clock` implementation.
|
|
|
666 |
|
|
|
667 |
For more information see [MDL-81894](https://tracker.moodle.org/browse/MDL-81894)
|