upgrade.txt 141 KB
Newer Older
1
This files describes API changes in core libraries and APIs,
2
information provided here is intended especially for developers.
3

4
5
=== 4.1 ===

6
7
8
9
10
* Final deprecation and removal of the following class, please use \core\task\manager.
    - \tool_task\run_from_cli
* Final deprecation and removal of the following CLI scripts:
  - admin/tool/task/cli/schedule_task.php please use admin/cli/scheduled_task.php
  - admin/tool/task/cli/adhoc_task.php please use admin/cli/adhoc_task.php
11
* Final deprecation and removal of cron_run_single_task(), please use \core\task\manager::run_from_cli().
12
13
* The $USER->groupmember hack that fills the user object with the groups that the user belongs to has been removed.
  Please use the Groups API function groups_get_user_groups() to fetch the cached list of groups the user is a member of.
14
15
16
17
18
* The following functions, previously used (exclusively) by upgrade steps are not available anymore
  because of the upgrade cleanup performed for this version. See MDL-71747 for more info:
    - upgrade_analytics_fix_contextids_defaults()
    - upgrade_convert_hub_config_site_param_names()
    - upgrade_rename_prediction_actions_useful_incorrectly_flagged()
19
20
* The method ensure_adhoc_task_qos() in lib/classes/task/manager.php  has been deprecated, please use get_next_adhoc_task()
  instead.
21
22
* New setting $CFG->enrolments_sync_interval controls the minimum time in seconds between re-synchronization of enrollment via enrol_check_plugins.
  This only applies to web requests without a session such as webservice calls, tokenpluginfile.php and rss links Function
23
  enrol_check_plugins now has $ignoreintervalcheck flag to bypass checking for that setting.
24
25
26
* For performance reasons, sql_reader interface has a new function get_events_select_exists() which determines whether
  an event exists with the given criteria (see MDL-72723 for details).
   - Breaking: 3rd party log readers implementing interface sql_reader will need to implement get_events_select_exists()
27
* Added $strictness parameter to persistent `get_record` method, optionally allowing caller to ensure record exists
28
* New DML driver method `$DB->sql_cast_to_char` for casting given field/expression to char
29
* The core renderer `edit_button` method now accepts an optional `$method` argument (get/post) for the button
30
31
32
* For plugins that override secondary navigation, the namespace for the custom secondary navigation class has
  changed. It was (for example) mod_mymodule\local\views\secondary but is now
  mod_mymodule\navigation\views\secondary. The old location will continue to work, but is deprecated.
33
34
35
36
* The check for $plugin->incompatible was found to be incorrect. The $plugin->incompatible attribute is meant to define the minimum
  Moodle version the plugin is incompatible with but the implemented logic for the check was the opposite. Plugins declaring this
  attribute may encounter different behaviours between older Moodle versions (<v3.11.8, <v4.0.2) and the later ones. We recommend
  plugin developers to not use this attribute for Moodle versions 4.0 and below in order to avoid this problem.
37
* Added $CFG->proxylogunsafe and proxyfixunsafe to detect code which doesn't honor the proxy config
38
* Function admin_externalpage_setup() now has additional option 'nosearch' allowing to remove Site administration search form.
39
* The function print_error has been deprecated. Kindly use moodle_exception.
40
41
42
* The abstract `get_name` method has been moved from `\core\task\scheduled_task` to the `\core\task\task_base` class and can now be
  implemented by adhoc tasks. For backwards compatibility, a default implementation has been added to `\core\task\adhoc_task` to
  return the class name.
43
* The function get_module_metadata() has been finally deprecated and can not be used anymore.
44

45
=== 4.0 ===
46

47
48
49
50
51
52
53
54
55
56
* To better detect wrong floats (like, for example, unformatted, using local-dependent separators ones) a number of
  gradebook functions now have stricter float type checking. All them will require now the "float" being passed to be
  a correct float value (numeric or string). Usually, that's achieved by using unformat_float() or
  PARAM_LOCALISEDFLOAT for all the user-entered grades before any processing on them. Functions affected are:
    - grade_format_gradevalue(), $value param (keeping it as optional/nullable).
    - grade_format_gradevalue_real(), $value param (keeping it as optional/nullable).
    - grade_format_gradevalue_percentage(), $value param (keeping it as optional/nullable).
    - grade_format_gradevalue_letter(), $value param (keeping it as optional/nullable).
    - grade_floats_different(), $f1 and $f2 params (keeping them as optional/nullable).
    - grade_floats_equal(), $f1 and $f2 params (keeping them as optional/nullable).
57
58
* The method action_menu->set_alignment() has been deprecated, please use action_menu->set_menu_left if you need a dropdown
  to align to the left of the dropdown button.
59
* The $OUTPUT->should_display_main_logo() function has been deprecated and should no longer be used.
60
61
62
* New method flexible_table::set_columnsattributes() has been introduced to add column attributes applied in every cell.
* New method flexible_table::get_row_cells_html() has been introduced, extracted from flexible_table::get_row_html
  so it can be overriden individually.
63
* Since Boxnet has been remove from core then boxnet_client() class has been removed from core too.
64
* New navigation classes to mimic the new navigation project. The existing navigation callbacks are still available and
65
66
67
  will be called. The following behaviour will be the new standard for nodes added via callbacks in Boost and Boost-based themes:
  - Module nodes added will be appended to the end and will appear within the More menu.
  - Course nodes added will also be appended and appear within the 'More' menu.
68
* The core/event events have been renamed and now fire native events, in addition to the legacy YUI and jQuery events.
69
  The following events have been renamed:
70
71
  - The BLOCK_CONTENT_UPDATED event has been replaced with a new native event in the `core_block/events` AMD module
    eventTypes.blockContentUpdated.
72
73
  - The EDITOR_CONTENT_RESTORED event has been replaced with a new native event in the `core_editor/events` AMD module
    eventTypes.editorContentRestored.
74
75
  - The FILTER_CONTENT_UPDATED event has been replaced with a new native event in the `core_filters/events` AMD module
    eventTypes.filterContentUpdated.
76
77
78
79
  - The FORM_FIELD_VALIDATION event has been replaced with a new native event in the `core_form/events` AMD module
    eventTypes.formFieldValidationFailed.
  - The FORM_SUBMIT_AJAX event has been replaced with a new native event in the `core_form/events` AMD module
    eventTypes.formSubmittedByJavascript.
80
* The block template now includues a block-instanceid data attribute.
81
* The core/event::getLegacyEvents() function has been deprecated and should no longer be used.
82
* Typo3 has now been removed. Use native mbstring or iconv functions.
83
* A new index has been added on mdl_user_preferences.name. This upgrade step might take some time on big sites.
84
85
86
* The completion_info function display_help_icon() which returned the 'Your progress' help icon has been deprecated and
  should no longer be used.
* The completion_info function print_help_icon() which has been deprecated since Moodle 2.0 should no longer be used.
87
88
89
* @babel/polyfill has been removed in favour of corejs@3.
* A new parameter $partialrebuild has been added to the rebuild_course_cache to invalidate the cache
  of the section or module only, not the whole course cache
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
* A new parameter $isbulkupdate has been added to the following functions:
  - grade_category::update()
  - grade_category::insert()
  - grade_grade::update()
  - grade_grade::insert()
  - grade_grade::notify_changed()
  - grade_item::insert()
  - grade_item::update()
  - grade_item::update_final_grade()
  - grade_item::update_raw_grade()
  - grade_object::update()
  - grade_object::insert()
  - grade_outcome::update()
  - grade_outcome::insert()
  - grade_scale::update()
  - grade_scale::insert()
  - grade_update()
  - completion_info::inform_grade_changed()
  - completion_info::update_state()
  - completion_info::internal_set_data()
  All functions except completion_info::internal_set_data() are only passing this parameter from very beginning of
  workflow (like grade report page where bulk grade update is possible) so this parameter is used in
  completion_info::internal_set_data() to decide if we need to mark completions instantly without waiting for cron.
* Following methods now return an int instead of bool:
  - completion_completion::_save()
  - completion_completion::mark_enrolled()
  - completion_completion::mark_inprogress()
  - completion_completion::mark_complete()
  which is needed to store id of completion record on successful update which is later beeing used by
  completion_info::internal_set_data() to reaggregate completions that have been marked for instant course completion.
120
121
* The following functions have been finally deprecated and can not be used anymore:
  - generate_uuid
122
123
* The YUI moodle-core-formchangechecker module has been deprecated and replaced with a new AMD module
  core_form/changechecker.
124
125
126
* New method \core_user::awaiting_action() has been introduced to check if the user is fully ready to use the site or
  whether there is an action (such as filling the missing profile field, changing password or agreeing to the site
  policy) needed.
127
128
* The signature of the get_name() function for grade_category and grade_item has been extended. The new parameter allows
  callers to get the name without escaped characters.
129
130
* The inplace_editable element constructor now accepts an optional pix_icon parameter to use as it's editing icon when
  rendered. The default icon for "select" types has also changed to a dropdown caret ("t/expanded").
131
132
* The inplace_editable 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.
133
134
* The function message_send() in messagelib.php now returns false if there is an error sending the message to the
  message processor (MDL-70046).
135
136
* Moodle 4.0 has major changes to the question bank. Therefore, there are major changes in questionlib.php
  and the core_question database tables. These are documented in detail in question/upgrade.txt.
137
138
* The postgres driver now wraps calls to pg_field_type() and caches them in databasemeta to save an invisible internal
  DB call on every request.
139
* The default type of 'core/toast' messages has been changed to 'information' (callers can still explicitely set the type)
140
141
* As the message_jabber notification plugin has been moved to the plugins database, the XMPPHP library (aka Jabber) has been
completely removed from Moodle core too.
142
* The SWF media player has been completely removed (The Flash Player was deprecated in 2017 and officially discontinued
143
  on 31 December 2020).
144
145
146
* The display_size function has been improved to add new optional parameters (decimal places,
  fixed units), to always include a non-breaking space between the number and unit, and to use
  consistent rounding (always 1 decimal place by default).
147
* The persistent method get() now returns the correct type for each property defined in the persistent class.
148
* The persistent method from_record() now only attempts to load record properties defined in the persistent class.
149
* New persistent set_many() helper for setting multiple properties in single method call.
150
151
152
* Require pass grade criteria is now part of core.
  Refer to upgrade.php to see transitioning from similar plugin criteria to core
  Refer to completion/upgrade.txt for additional information.
153
* The method enable_plugin() has been added to the core_plugininfo\base class and it has been implemented by all the plugininfo
154
155
classes extending it. When possible, the enable_plugin() method will store these changes into the config_log table, to let admins
check when and who has enabled/disabled plugins.
156
157
158
* Final deprecation: The following functions along with associated tests have been removed:
  - core_grades_external::get_grades
  - core_grades_external::get_grade_item
159
  - report_insights_context_insights
160
* \core\session\manager::init_empty_session() has a new optional parameter $newsid to indicate whether this is a new user session
161
162
163
* New html_table attribute "$responsive" which defaults to true. When set to true, tables created via html_writer::table() will be enclosed
  in a .table-responsive div container which will allow the table to be scrolled horizontally with ease, especially when the table is rendered in smaller viewports.
  Set to false to prevent the table from being enclosed in the responsive container.
164
165
166
167
* Two new helper functions have been added to lib/datalib.php, for safely preparing SQL ORDER BY statements where user
  interactions define sort parameters (see the respective docblocks for full details and examples):
  -get_safe_orderby() - where a single sort parameter is required.
  -get_safe_orderby_multiple() - where multiple sort parameters are required.
168
* Added the cleanstr mustache template helper to clean strings after loading them from language packs.
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
* The following behat functions have been modified to work with the new navigation
  - i_add_the_block
  - the_add_block_selector_should_contain_block
  - the_add_block_selector_should_contain_block
  - go_to_the_current_course_activity_completion_report
  - i_navigate_to_course_participants
  - i_go_to_advanced_grading_page
  - i_navigate_to_in_the_course_gradebook
  - should_exist_in_current_page_administration
  - should_not_exist_in_current_page_administration
  - go_to_main_course_page
  - select_on_administration_page
  - find_header_administration_menu
  - select_from_administration_menu
  - i_edit_the_lesson
  - i_add_a_question_filling_the_form_with
* The following behat step has been deprecated
  - i_select_from_flat_navigation_drawer
187
* The type for the "message" field in the external_warnings() structure has been changed from PARAM_TEXT to PARAM_RAW
188
189
* A new parameter $displayoptions has been added to the core_renderer::confirm() to allow better customization for confirming page
such as the title and strings for continue and cancel buttons.
190
191
192
* The method get_enabled_plugin($pluginname) has been added to the core_plugininfo\base class. It has a default implementation for
all the plugininfo classes and it can be overwritten when required (like it has been done with filter). This method returns the
current value for a pluginname depending on its status (enabled, disabled, other...).
193
194
195
196
197
198
199
200
201
202
* Unit Test coverage defaults have been updated to include some sensible defaults.
  The default values now include:
  * /classes/
  * /tests/generator/
  * /externallib.php
  * /lib.php
  * /locallib.php
  * /renderer.php
  * /rsslib.php
  This default applies both when there is no supplied coverage.php file, and is used to supplement any existing coverage configuration file if one is found.
203
204
* New method get_unaddable_by_theme_block_types() has been added to block_manager class. It uses the 'unaddableblocks' theme setting
value to get the list of blocks that won't be displayed for a theme.
205
206
207
208
209
210
* Loggedin / Loggedoff component settings on notification preferences have been merged to a single enabled switch:
  MESSAGE_DEFAULT_LOGGEDIN and MESSAGE_DEFAULT_LOGGEDOFF are now deprecated, so plugins should be updated if db/messages.php is present and replace
    MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF to MESSAGE_DEFAULT_ENABLED. Backward compatibility will take any of both settings as enabled.
  MESSAGE_DEFAULT_PERMITTED also deprecated.
  core_message_get_user_notification_preferences and core_message_get_user_message_preferences Webservice are now returning enabled boolean on
    components > notifications > processors. loggedin and loggedoff are deprecated but present for backward compatibility.
211
212
* A new parameter $strength of type int is added to method search_for_active_node. This parameter would help us to search for the active nodes based on the
  $strength passed to it.
213
214
* A new method get_page() has been added to the settings_navigation class. This method can be used to obtain the
  moodle_page object associated to the settings navigation.
215
216
217
* A new interface, `core\output\named_templatable` has been created to allow renderable classes to define a
  `get_template_name(\renderer_base): string` function which will inform the default render() function with a template
  name.
218
* The parameter $modinfo of the get_data method in completion_info class has been deprecated and is not used anymore.
219
220
* A new method, get_default_home_page(), has been added to moodlelib to get the default home page to display if current one is not
defined or can't be applied.
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
* A new language_menu renderable is created to handle collecting available languages and generating the menu for use in different situations
* New primary navigation classes to mimic the primary nav. Consists of the views/primary.php and output/primary.php. The
  base nodes are added within the views/primary.php while output/primary.php is a renderable that combines the primary
  view and the lang, user and any custom menu items.
  - The language menu now resides within the user menu.
* New primary and secondary magic getters/setters included in pagelib.php that also initialises the objects
* All secondary navigation nodes have a predefined ordering within the relevant context and are defined as a
  mapping construct within core\navigation\views\secondary. Secondary navigation ordering can be overridden by
  generating a custom secondary class within a plugin's {plugin}\local\views namespace. This is only applicable to the
  following plugin types and is automatically loaded:
    * Module - refer to mod_assign\local\views\secondary for examples and magic_get_secondarynav for calling code
    * Block - refer to core_block\local\views\secondary for examples and blocklib::get_secondarynav for calling code
  - Additionally a custom secondary object may be set using the convenient setters in pagelib.php.
  - Secondary nav nodes can be forced into the 'More' menu using the 'set_force_into_more_menu'. It is advisable to set
    this in the existing nav callbacks when generating the nodes. Alternately, the corresponding
    'get_default_{admin/course/module}_more_menu_nodes functions in secondary can be overridded to provide a custom set
    of node keys to push into the more menu
  - The secondary navigation can be omitted from a theme/page by setting $PAGE->set_secondary_navigation(false). e.g. admin/search.php and in classic.
  - Within a single activity course format, the course and module level secondary navigation options are displayed within
    dropdowns in the secondary navigation bar
* New function 'get_overflow_menu_data' introduced in core\navigation\views\secondary to get additional/custom sub navigation
  to be displayed as a url_select for tertiary navigation.
* It is required that the action provided to navigation_node::create be of type moodle_url/action_link. Non conformance
  results in a debugging message being thrown.
* New page lib config '_navigationoverflow' and associated getters/setters to toggle whether the overflow menu is displayed
* New functions to explicitly set what tabs should be highlighted on the primary and secondary navigation
* Breadcrumbs modified to follow standards defined here https://www.nngroup.com/articles/breadcrumbs/
  - New navbar class in boost to follow the standards defined above.
* Settings cog have been removed and replaced with either secondary and tertiary navigation components
* New activity_header class to handle display of common content for plugins.
  * Handles display of the activity name, completion information and description.
  * New pagelib.php magic getters to fetch activity_header
  * New theme level config to govern display of the activity name $THEME->activityheaderconfig['notitle']
        - Default for boost is to show no activity title.
  * New page layout level option to handle display within activity header. Options should be defined
    within 'activityheader' and accept the following array keys:
        - notitle
        - nocompletion
        - nodescription
  * Convenient functions to set the parameters in the header OR hide them altogether.
* Category navigations has been updated with a preference of tertiary navigation components over buttons within the page
  content and/or context header actions
* A new 'My courses' page has been introduced which houses the course overview block
* Default blocks for dashboard has been updated. The page will now have the following in the corresponding region:
    * Calendar, Timeline - Center
    * Recently accessed courses - Side bar/blocks drawer
267
* Flat navigation classes have been marked for deprecation with the introduction of primary and secondary navigation concepts.
268
269
270
* A new method, force_lock_all_blocks(), has been added to the moodle_page class to allow pages to force the value of
  user_can_edit_blocks() to return false where necessary. This makes it possible to remove block editing on a page
  from ALL users, including admins, where required on pages with multi region layouts exist, such as "My courses".
271
* Add an early $CFG->session_redis_acquire_lock_warn option
272
273
* Removed $CFG->conversionattemptlimit setting from config.php. assignfeedback_editpdf\task\convert_submissions task
  is now replaced with adhoc tasks with standard fail delay approach.
274

275
276
277
278
279
280
=== 3.11.4 ===
* A new option dontforcesvgdownload has been added to the $options parameter of the send_file() function.
  Note: This option overrides the forced download of directly accessed SVGs, so should only be used where the calling method is
  rendering SVGs directly for content created using XSS risk flagged capabilities (such as creating a SCORM activity).
  This is also not necessary where SVGs are already being safely loaded into <img> tags by Moodle (eg within forum posts).

281
282
283
284
=== 3.11.2 ===
* For security reasons, filelib has been updated so all requests now use emulated redirects.
  For this reason, manually disabling emulateredirects will no longer have any effect (and will generate a debugging message).

285
=== 3.11 ===
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
* PHPUnit has been upgraded to 9.5 (see MDL-71036 for details).
  That comes with a few changes:
  - Breaking: All the changes that were deprecated with PHPUnit 8.5
    are now removed (see the 3.10 section below).
  - Breaking: assertContains() now performs stricter comparison (like assertSame()
    does). New assertContainsEquals() has been created to provide the old
    behavior.
  - Deprecation: A number of file-related assertions have been deprecated, will
    be removed with PHPUnit 10. Alternatives for all them have been created:
      - assertNotIsReadable()         -> assertIsNotReadable()
      - assertNotIsWritable()         -> assertIsNotWritable()
      - assertDirectoryNotExists()    -> assertDirectoryDoesNotExist()
      - assertDirectoryNotIsReadable()-> assertDirectoryIsNotReadable()
      - assertDirectoryNotIsWritable()-> assertDirectoryIsNotWritable()
      - assertFileNotExists()         -> assertFileDoesNotExist()
      - assertFileNotIsReadable()     -> assertFileIsNotReadable()
      - assertFileNotIsWritable()     -> assertFileIsNotWritable()
  - Deprecation: Regexp-related assertions have been deprecated, will be
    removed with PHPUnit 10. Alternatives for all them have been created:
      - assertRegExp()     -> assertMatchesRegularExpression()
      - assertNotRegExp()  -> assertDoesNotMatchRegularExpression()
  - Deprecation: The expectException() for Notice, Warning, Deprecation and
    Error is deprecated, will be removed with PHPUnit 10. New expectations
    have been created to better define the expectation:
      - expectDeprecation() for E_DEPRECATED and E_USER_DEPRECATED.
      - expectNotice() for E_NOTICE, E_USER_NOTICE, and E_STRICT.
      - expectWarning() for E_WARNING and E_USER_WARNING.
      - expectError() for everything else.
   - Deprecation: The Mock->at() matcher has been deprecated and will be
     removed with PHPUnit 10. Switch to better, more deterministic and clearer
     matchers is recommended (->once(), ->exactly(), ->never()...).
   - Deprecation: The Mock->setMethods() method has been *silently* deprecated
     and will be removed in the future. Change uses to the new Mock->onlyMethods()
     alternative. Also, it doesn't accept "null" anymore, new default must
     be [] (empty array).
   - Mostly internal: With the raise to PHP 7.3 as lower version supported,
     various internal bits perform now stricter type checking in params and
     return values. If your tests have own-created comparators, assertions...
     they may need to be adjusted.
   - Mostly internal: The phpunit.xml schema has changed, basically removing
     the old <filter> section and replacing it with a new, less confusing
     <coverage> section. Also the elements within them have been changed:
       - <whitelist> has been replaced by <include>.
       - <exclude> is not a child of <whitelist> anymore, but of <coverage>.
     Note that this only will affect if you've custom phpunit.xml files
     instead of using the automatically generated ones by Moodle.
   - Deprecation: Related to the previous point, the $whitelistxxx properties
     used by the coverage.php files have been deprecated (will continue
     working until Moodle 4.3) to follow the same pattern:
       - whitelistfolders -> includelistfolders
       - whitelistfiles   -> includelistfiles
   - Internal: Custom autoloaders are deprecated and will be removed with
     PHPUnit 10. Hence we have removed our one already.
     Note that it was not useful since PHPUnit 8.5, where the ability
     to run tests by class name was removed.
   - Warning: Because of some new restrictions about how test files and
     test classes must be named (that Moodle haven't followed ever) it's not
     possible to run individual test files any more. Use any of the alternative
     execution methods (filter, suite, config) to specify which tests
     you want to run. This will be hopefully fixed in MDL-71049
     once it has been agreed which the best way to proceed is.
347
* The horde library has been updated to version 5.2.23.
348
349
* New optional parameter $extracontent for print_collapsible_region_start(). This allows developers to add interactive HTML elements
  (e.g. a help icon) after the collapsible region's toggle link.
350
* Final deprecation i_dock_block() in behat_deprecated.php
351
352
* Final deprecation of get_courses_page. Function has been removed and core_course_category::get_courses() should be
  used instead.
353
354
355
356
* New encryption API in \core\encryption allows secure encryption and decryption of data. By
  default the key is stored in moodledata but admins can configure a different, more secure
  location in config.php if required. To get the best possible security for this feature, we
  recommend enabling the Sodium PHP extension.
357
358
  The OpenSSL alternative for this API, used when Sodium is not available, is considered deprecated
  at all effects, and will be removed in Moodle 4.2. See MDL-71421 for more information.
359
* Behat timeout constants behat_base::TIMEOUT, EXTENDED_TIMEOUT, and REDUCED_TIMEOUT, which were deprecated in 3.7, have been removed.
360
361
* \core_table\local\filter\filterset::JOINTYPE_DEFAULT is being changed from 1 (ANY) to 2 (ALL). Filterset implementations
  can override the default filterset join type by overriding \core_table\local\filter\filterset::get_join_type() instead.
362
* HTMLPurifier has been upgraded to the latest version - 4.13.0
363
* Markdown lib has been upgraded to the latest version - 1.9.0
364
* The minify lib has been upgraded to 1.3.63 and pathconvertor to 1.1.3
365
366
* A new optional parameter `$sort` has been added to all `$context->get_capabilities()` methods to be able to define order of
  returned capability array.
367
* Spout has been upgraded to the latest version - 3.1.0
368
* emoji-data has been upgraded to 6.0.0.
369
370
* The final deprecation of /message/defaultoutputs.php file and admin_page_defaultmessageoutputs.
  All their settings moved to admin/message.php (see MDL-64495). Please use admin_page_managemessageoutputs class instead.
371
372
373
* Behat now supports date selection from the date form element. Examples:
    - I set the field "<field_string>" to "##15 March 2021##"
    - I set the field "<field_string>" to "##first day of January last year##"
374
375
376
* Behat now supports date and time selection from the datetime form element. Examples:
    - I set the field "<field_string>" to "##15 March 2021 08:15##"
    - I set the field "<field_string>" to "##first day of January last year noon##"
377
* New DML driver method `$DB->sql_group_concat` for performing group concatenation of a field within a SQL query
378
379
* Added new class, AMD modules and WS that allow displaying forms in modal popups or load and submit in AJAX requests.
  See https://docs.moodle.org/dev/Modal_and_AJAX_forms for more details.
380
381
382
383
384
385
386
387
388
* New base class for defining an activity's custom completion requirements: \core_completion\activity_custom_completion.
  Activity module plugins that define custom completion conditions should implement a mod_[modname]\completion\custom_completion
  subclass and the following methods:
  - get_state(): Provides the completion state for a given custom completion rule.
  - get_defined_custom_rules(): Returns an array of the activity module's custom completion rules.
    e.g. ['completionsubmit']
  - get_custom_rule_descriptions(): Returns an associative array with values containing the user-facing textual description
    of the custom completion rules (which serve as the keys to these values).
    e.g. ['completionsubmit' => 'Must submit']
389
390
391
  - get_sort_order(): Returns an array listing the order the activity module's completion rules should be displayed to the user,
    including both custom completion and relevant core completion rules
    e.g. ['completionview', 'completionsubmit', 'completionusegrade']
392
393
* Admin setting admin_setting_configmulticheckbox now supports lazy-loading the options list by
  supplying a callback function instead of an array of options.
394
* A new core API class \core_user\fields provides ways to get lists of user fields, and SQL related to
395
396
397
  those fields. This replaces existing functions get_extra_user_fields(), get_extra_user_fields_sql(),
  get_user_field_name(), get_all_user_name_fields(), and user_picture::fields(), which have all been
  deprecated.
398
399
400
* Allow plugins to augment the curl security helper via callback. The plugin's function has to be defined as
  plugintype_pluginname_curl_security_helper in pluginname/lib.php file and the function should return a plugin's security
  helper instance.
401
402
403
* The behat transformation 'string time to timestamp' no longer supports datetime format. If provided, the format must
  be strftime compatible. Example:
    - I should see "##tomorrow noon##%A, %d %B %Y, %I:%M %p##"
404
405
* External functions implementation classes should use 'execute' as the method name, in which case the
  'methodname' property should not be specified in db/services.php file.
406
407
* The core_grades_create_gradecategory webservice has been deprecated in favour of core_grades_create_gradecategories, which is
  functionally identical but allows for parallel gradecategory creations by supplying a data array to the webservice.
408
409
410
411
* The signature of the get_context_name() function in the abstract class context and all extending classes (such as context_course)
  has been extended. The new parameter allows the to get the name without escaped characters.
* The signature of the question_category_options() has been extended. The new parameter allows the to get the categories name
  in the returned array without escaped characters.
412
413
* The \core\hub\site_registration_form::add_select_with_email() method has been deprecated in favour of
  \core\hub\site_registration_form::add_checkbox_with_email().
414

415
=== 3.10 ===
416
* PHPUnit has been upgraded to 8.5. That comes with a few changes:
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
  - Breaking change: All the "template methods" (setUp(), tearDown()...) now require to return void. This implies
    that the minimum version of PHP able to run tests will be PHP 7.1
  - A good number of assertions have been deprecated with this version
    and will be removed in a future one. In core all cases have been removed
    (so it's deprecation-warnings free). It's recommended to perform the
    switch to their new counterparts ASAP:
      - assertInternalType() has been deprecated. Use the assertIsXXX() methods instead.
      - assertArraySubset() has been deprecated. Use looping + assertArrayHasKey() or similar.
      - @expectedExceptionXXX annotations have been deprecated. Use the expectExceptionXXX()
        methods instead (and put them exactly before the line that is expected to throw the exception).
      - assertAttributeXXX() have been deprecated. If testing public attributes use normal assertions. If
        testing non-public attributes... you're doing something wrong :-)
      - assertContains() to find substrings on strings has been deprecated. Use assertStringContainsString() instead.
        (note that there are "IgnoringCase()" variants to perform case-insensitive matching.
      - assertEquals() extra params have been deprecated and new assertions for them created:
        - delta => use assertEqualsWithDelta()
        - canonicalize => use assertEqualsCanonicalizing()
        - ignoreCase => use assertEqualsIgnoringCase()
        - maxDepth => removed without replacement.
  - The custom printer that was used to show how to rerun a failure has been removed, it was old and "hacky"
    solution, for more information about how to run tests, see the docs, there are plenty of options.
438
439
440
441
442
443
444
445
446
447
448
  - phpunit/dbunit is not available any more and it has been replaced by a lightweight phpunit_dataset class, able to
    load XML/CSV and PHP arrays, send the to database and return rows to calling code (in tests). That implies the
    follwoing changes in the advanced_testcase class:
      - createFlatXMLDataSet() has been removed. No uses in core, uses can switch to createXMLDataSet() (read below).
      - createXMLDataSet() has been deprecated. Use dataset_from_files() instead.
      - createCsvDataSet() has been deprecated. Use dataset_from_files() instead.
      - createArrayDataSet() has been deprecated. This method was using the phpunit_ArrayDataSet class
        that has been also removed from core. Use dataset_from_array() instead.
      - loadDataSet() has been deprecated. Use phpunit_dataset->to_database() instead.
      - All the previous uses of phpunit/dbunit methods like Dataset:getRows(), Dataset::getRowCount()
        must be replaced by the new phpunit_dataset->get_rows() method.
449
* Retains the source course id when a course is copied from another course on the same site.
450
451
452
453
* Added function setScrollable in core/modal. This function can be used to set the modal's body to be scrollable or not
  when the modal's height exceeds the browser's height. This is also supported in core/modal_factory through the
  'scrollable' config parameter which can be set to either true or false. If not explicitly defined, the default value
  of 'scrollable' is true.
454
455
* The `$CFG->behat_retart_browser_after` configuration setting has been removed.
  The browser session is now restarted between all tests.
456
* add_to_log() has been through final deprecation, please rewrite your code to the new events API.
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
* The following functions have been finally deprecated and can not be used anymore:
  - print_textarea
  - calendar_get_all_allowed_types
  - groups_get_all_groups_for_courses
  - events_get_cached
  - events_uninstall
  - events_cleanup
  - events_dequeue
  - events_get_handlers
  - get_roles_on_exact_context
  - get_roles_with_assignment_on_context
  - message_add_contact
  - message_remove_contact
  - message_unblock_contact
  - message_block_contact
  - message_get_contact
473
474
475
* The following renamed classes have been completely removed:
    - course_in_list (now: core_course_list_element)
    - coursecat (now: core_course_category)
476
* The form element 'htmleditor', which was deprecated in 3.6, has been removed.
477
478
* The `core_output_load_fontawesome_icon_map` web service has been deprecated and replaced by
  `core_output_load_fontawesome_icon_system_map` which takes the name of the theme to generate the icon system map for.
479
480
* A new parameter `$rolenamedisplay` has been added to `get_viewable_roles()` and `get_switchable_roles` to define how role names
  should be returned.
481
* The class coursecat_sortable_records has been removed.
482
483
* Admin setting admin_setting_configselect now supports lazy-loading the options list by supplying
  a callback function instead of an array of options.
484
485
* Admin setting admin_setting_configselect now supports validating the selection by supplying a
  callback function.
486
487
488
* The task system has new functions adhoc_task_starting() and scheduled_task_starting() which must
  be called before executing a task, and a new function \core\task\manager::get_running_tasks()
  returns information about currently-running tasks.
489
* New library function rename_to_unused_name() to rename a file within its current location.
490
491
* Constant \core_h5p\file_storage::EDITOR_FILEAREA has been deprecated
  because it's not required any more.
492
* The ZipStream-PHP library has been added to Moodle core in /lib/zipstream.
493
* The php-enum library has been added to Moodle core in /lib/php-enum.
494
* The http-message library has been added to Moodle core in /lib/http-message.
495
496
* Methods `filetypes_util::is_whitelisted()` and `filetypes_util::get_not_whitelisted()` have been deprecated and
  renamed to `is_listed()` and `get_not_listed()` respectively.
497
498
* Method `mustache_helper_collection::strip_blacklisted_helpers()` has been deprecated and renamed to
  `strip_disallowed_helpers()`.
499
500
* A new admin externalpage type `\core_admin\local\externalpage\accesscallback` for use in plugin settings is available that allows
  a callback to be provided to determine whether page can be accessed.
501
* New setting $CFG->localrequestdir overrides which defaults to sys_get_temp_dir()
502
* Function redirect() now emits a line of backtrace into the X-Redirect-By header when debugging is on
503
504
* New DML function $DB->delete_records_subquery() to delete records based on a subquery in a way
  that will work across databases.
505
* Add support for email DKIM signatures via $CFG->emaildkimselector
506

507
=== 3.9 ===
508
509
510
511
512
513
514
* Following function has been deprecated, please use \core\task\manager::run_from_cli().
    - cron_run_single_task()
* Following class has been deprecated, please use \core\task\manager.
    - \tool_task\run_from_cli
* Following CLI scripts has been deprecated:
  - admin/tool/task/cli/schedule_task.php please use admin/cli/scheduled_task.php
  - admin/tool/task/cli/adhoc_task.php please use admin/cli/adhoc_task.php
515
516
* Old Safe Exam Browser quiz access rule (quizaccess_safebrowser) replaced by new Safe Exam Browser access rule (quizaccess_seb).
  Experimental setting enablesafebrowserintegration was deleted.
517
* New CFPropertyList library has been added to Moodle core in /lib/plist.
518
519
* behat_data_generators::the_following_exist() has been removed, please use
  behat_data_generators::the_following_entities_exist() instead. See MDL-67691 for more info.
520
521
* admin/tool/task/cli/adhoc_task.php now observers the concurrency limits.
  If you want to get the previous (unlimited) behavior, use the --ignorelimits switch).
522
* Removed the following deprecated functions:
523
524
  - question_add_tops
  - question_is_only_toplevel_category_in_context
525
526
* format_float() now accepts a special value (-1) as the $decimalpoints parameter
  which means auto-detecting number of decimal points.
527
528
* plagiarism_save_form_elements() has been deprecated. Please use {plugin name}_coursemodule_edit_post_actions() instead.
* plagiarism_get_form_elements_module() has been deprecated. Please use {plugin name}_coursemodule_standard_elements() instead.
529
* Changed default sessiontimeout to 8 hours to cover most normal working days
530
531
532
533
534
535
536
* Plugins can now explicitly declare supported and incompatible Moodle versions in version.php
  - $plugin->supported = [37,39];
    supported takes an array of ascending numbers, that correspond to a range of branch numbers of supported versions, inclusive.
    Moodle versions that are outside of this range will produce a message notifying at install time, but will allow for installation.
  - $plugin->incompatible = 36;
    incompatible takes a single int corresponding to the first incompatible branch. Any Moodle versions including and
    above this will be prevented from installing the plugin, and a message will be given when attempting installation.
537
* Added the <component>_bulk_user_actions() callback which returns a list of custom action_links objects
538
539
540
541
542
543
* Add 'required' admin flag for mod forms allows elements to be toggled between being required or not in admin settings.
  - In mod settings, along with lock, advanced flags, the required flag can now be set with $setting->set_required_flag_options().
    The name of the admin setting must be exactly the same as the mod_form element.
  - Currently supported by:
    - mod_assign
    - mod_quiz
544
* Added a native MySQL / MariaDB lock implementation
545
546
* The database drivers (moodle_database and subclasses) don't need to implement get_columns() anymore.
  They have to implement fetch_columns instead.
547
* Added function cleanup_after_drop to the database_manager class to take care of all the cleanups that need to be done after a table is dropped.
548
* The 'xxxx_check_password_policy' callback now only fires if $CFG->passwordpolicy is true
549
* grade_item::update_final_grade() can now take an optional parameter to set the grade->timemodified. If not present the current time will carry on being used.
550
* lib/outputrequirementslib::get_jsrev now is public, it can be called from other classes.
551
* H5P libraries have been moved from /lib/h5p to h5p/h5plib as an h5plib plugintype.
552
553
* mdn-polyfills has been renamed to polyfills. The reason there is no polyfill from the MDN is
  because there is no example polyfills on the MDN for this functionality.
554
555
556
557
* AJAX pages can be called without requiring a session lock if they set READ_ONLY_SESSION to true, eg.
  define('READ_ONLY_SESSION', true); Note - this also requires $CFG->enable_read_only_sessions to be set to true.
* External functions can be called without requiring a session lock if they define 'readonlysession' => true in
  db/services.php. Note - this also requires $CFG->enable_read_only_sessions to be set to true.
558
* database_manager::check_database_schema() now checks for missing and extra indexes.
559
* Implement a more direct xsendfile_file() method for an alternative_file_system_class
560
561
* A new `dynamic` table interface has been defined, which allows any `flexible_table` to be converted into a table which
  is updatable via ajax calls. See MDL-68495 and `\core_table\dynamic` for further information.
562
563
564
* The core/notification module has been updated to use AMD modals for its confirmation and alert dialogues.
  The confirmation dialogue no longer has a configurable "No" button as per similar changes in MDL-59759.
  This set of confirmation modals was unintentionally missed from that deprecation process.
565
* The download_as_dataformat() method has been deprecated. Please use \core\dataformat::download_data() instead
566
567
568
* The following functions have been updated to support passing in an array of group IDs (but still support passing in a single ID):
  * groups_get_members_join()
  * groups_get_members_ids_sql()
569
570
571
572
* Additional parameters were added to core_get_user_dates:
    - type: specifies the calendar type. Optional, defaults to Gregorian.
    - fixday: Whether to remove leading zero for day. Optional, defaults to 1.
    - fixhour: Whether to remove leading zero for hour. Optional, defaults to 1.
573
* Legacy cron has been deprecated and will be removed in Moodle 4.1. This includes the functions:
574
575
576
  - cron_execute_plugin_type()
  - cron_bc_hack_plugin_functions()
  Please, use the Task API instead: https://docs.moodle.org/dev/Task_API
577
578
579
580
581
582
583
584
585
586
587
588
589
590
* Introduce new hooks for plugin developers:
    - <component>_can_course_category_delete($category)
    - <component>_can_course_category_delete_move($category, $newcategory)
  These hooks allow plugin developers greater control over category deletion. Plugin can return false in those
  functions if category deletion or deletion with content move to the new parent category is not permitted.
  Both $category and $newcategory params are instances of core_course_category class.
    - <component>_pre_course_category_delete_move($category, $newcategory)
  This hook is expanding functionality of existing <component>_pre_course_category_delete hook and allow plugin developers
  to execute code prior to category deletion when its content is moved to another category.
  Both $category and $newcategory params are instances of core_course_category class.
    - <component>_get_course_category_contents($category)
  This hook allow plugin developers to add information that is displayed on category deletion form. Function should
  return string, which will be added to the list of category contents shown on the form. $category param is an instance
  of core_course_category class.
591
* Data generator create_user in both unittests and behat now validates user fields and triggers user_created event
592

593
=== 3.8 ===
594
* Add CLI option to notify all cron tasks to stop: admin/cli/cron.php --stop
595
* The rotate_image function has been added to the stored_file class (MDL-63349)
596
* The yui checknet module is removed. Call \core\session\manager::keepalive instead.
597
* The generate_uuid() function has been deprecated. Please use \core\uuid::generate() instead.
598
* Remove lib/pear/auth/RADIUS.php (MDL-65746)
599
* Core components are now defined in /lib/components.json instead of coded into /lib/classes/component.php
600
* Subplugins should now be defined using /db/subplugins.json instead of /db/subplugins.php
601
602
603
604
* The following functions have been finally deprecated and can not be used anymore:
    * allow_override()
    * allow_assign()
    * allow_switch()
605
606
    * https_required()
    * verify_https_required()
607
* Remove duplicate font-awesome SCSS, Please see /theme/boost/scss/fontawesome for usage (MDL-65936)
608
* Remove lib/pear/Crypt/CHAP.php (MDL-65747)
609
610
611
612
* New output component available: \core\output\checkbox_toggleall
  - This allows developers to easily output groups of checkboxes that can be toggled by master controls in the form of a checkbox or
    a button. Action elements which perform actions on the selected checkboxes can also be enabled/disabled depending on whether
    at least a single checkbox item is selected or not.
613
* Final deprecation (removal) of the core/modal_confirm dialogue.
614
* Upgrade scssphp to v1.0.2, This involves renaming classes from Leafo => ScssPhp as the repo has changed.
615
616
* Implement supports_xsendfile() method and allow support for xsendfile in alternative_file_system_class
  independently of local files (MDL-66304).
617
618
* The methods get_local_path_from_storedfile and get_remote_path_from_storedfile in lib/filestore/file_system.php
  are now public. If you are overriding these then you will need to change your methods to public in your class.
619
620
621
622
623
624
625
626
627
628
629
* It is now possible to use sub-directories for AMD modules.
  The standard rules for Level 2 namespaces also apply to AMD modules.
  The sub-directory used must be either an valid component, or placed inside a 'local' directory to ensure that it does not conflict with other components.

    The following are all valid module names and locations in your plugin:
      mod_forum/view: mod/forum/amd/src/view.js
      mod_forum/local/views/post: mod/forum/amd/src/local/views/post
      mod_forum/form/checkbox-toggle: mod/forum/amd/src/form/checkbox-toggle.js

    The following are all invalid module names and locations in your plugin:
      mod_forum/views/post: mod/forum/amd/src/views/post
630
631
* The 'xxxx_check_password_policy' method now has an extra parameter: $user. It contains the user object to perform password
validation against and defaults to null (so, no user needed) if not provided.
632
633
634
635
636
637
638
639
* It is now possible to use sub-directories when creating mustache templates.
  The standard rules for Level 2 namespaces also apply to templates.
  The sub-directory used must be either an valid component, or placed inside a 'local' directory to ensure that it does not conflict with other components.

    The following are all valid template names and locations in your plugin:
      mod_forum/forum_post: mod/forum/templates/forum_post.mustache
      mod_forum/local/post/user: mod/forum/templates/local/post/user.mustache
      mod_forum/form/checkbox_toggle: mod/forum/templates/form/checkbox_toggle.mustache
640

641
642
    The following are _invalid_ template names and locations:
      mod_forum/post/user: mod/forum/templates/local/post/user.mustache
643
644
* Following behat steps have been removed from core:
    - I go to "<gradepath_string>" in the course gradebook
645
* A new admin setting widget 'core_admin\local\settings\filesize' is added.
646
* Core capabilities 'moodle/community:add' and 'moodle/community:download' have been removed from core as part of Moodle.net sunsetting.
647
648
649
650
651
652
653
* As part of Moodle.net sunsetting process the following hub api functions have been deprecated:
    - get_courses
    - unregister_courses
    - register_course
    - add_screenshot
    - download_course_backup
    - upload_course_backup
654
655
656
* A new setting 'Cache templates' was added (see MDL-66367). This setting determines if templates are cached or not.
  This setting can be set via the UI or by defining $CFG->cachetemplates in your config.php file. It is a boolean
  and should be set to either false or true. Developers will probably want to set this to false.
657
* The core_enrol_edit_user_enrolment webservice has been deprecated. Please use core_enrol_submit_user_enrolment_form instead.
658
* \single_button constructor has a new attributes param to add attributes to the button HTML tag.
659
* Improved url matching behaviour for profiled urls and excluded urls
660
* Attempting to use xsendfile via the 3rd param of readstring_accel() is now ignored.
661
662
* New H5P libraries have been added to Moodle core in /lib/h5p.
* New H5P core subsystem have been added.
663
664
665
666
* Introduced new callback for plugin developers '<component>_get_path_from_pluginfile($filearea, $args)': This will return
the itemid and filepath for the filearea and path defined in $args. It has been added in order to get the correct itemid and
filepath because some components, such as mod_page or mod_resource, add the revision to the URL where the itemid should be placed
(to prevent caching problems), but then they don't store it in database.
667
668
669
670
671
672
673
* New utility function \core_form\util::form_download_complete should be called if your code sends
  a file with Content-Disposition: Attachment in response to a Moodle form submit button (to ensure
  that disabled submit buttons get re-enabled in that case). It is automatically called by the
  filelib.php send_xx functions.
* If you have a form which sends a file in response to a Moodle form submit button, but you cannot
  call the above function because the file is sent by a third party library, then you should add
  the attribute data-double-submit-protection="off" to your form.
674

675
=== 3.7 ===
676

677
* Nodes in the navigation api can have labels for each group. See set/get_collectionlabel().
678
* The method core_user::is_real_user() now returns false for userid = 0 parameter
679
680
* 'mform1' dependencies (in themes, js...) will stop working because a randomly generated string has been added to the id
attribute on forms to avoid collisions in forms loaded in AJAX requests.
681
682
* A new method to allow queueing or rescheduling of an existing scheduled task was added. This allows an existing task
  to be updated or queued as required. This new functionality can be found in \core\task\manager::reschedule_or_queue_adhoc_task.
683
* Icons are displayed for screen readers unless they have empty alt text (aria-hidden). Do not provide an icon with alt text immediately beside an element with exactly the same text.
684
* admin_settingpage has a new function hide_if(), modeled after the same functionality in the forms library. This allows admin settings to be dynamically hidden based on the values of other settings.
685
686
687
688
* The \core_rating provider's get_sql_join function now accepts an optional $innerjoin parameter.
  It is recommended that privacy providers using this function call rewrite any long query into a number of separate
  calls to add_from_sql for improved performance, and that the new argument is used.
  This will allow queries to remain backwards-compatible with older versions of Moodle but will have significantly better performance in version supporting the innerjoin parameter.
689
690
* /message/defaultoutputs.php file and admin_page_defaultmessageoutputs class have been deprecated
  and all their settings moved to admin/message.php (see MDL-64495). Please use admin_page_managemessageoutputs class instead.
691
692
* A new parameter $lang has been added to mustache_template_source_loader->load_with_dependencies() method
  so it is possible for Mustache to request string in a specific language.
693
694
695
* Behat timeout constants behat_base::TIMEOUT, EXTENDED_TIMEOUT, and REDUCED_TIMEOUT have been
  deprecated. Please instead use the functions behat_base::get_timeout(), get_extended_timeout(),
  and get_reduced_timeout(). These allow for timeouts to be increased by a setting in config.php.
696
697
* The $draftitemid parameter of file_save_draft_area_files() function now supports the constant IGNORE_FILE_MERGE:
  When the parameter is set to that constant, the function won't process file merging, keeping the original state of the file area.
698
  Notice also than when $text is set, pluginfile rewrite won't be processed so the text will not be modified.
699
700
* Introduced new callback for plugin developers '<component>_pre_processor_message_send($procname, $proceventdata)':
  This will allow any plugin to manipulate messages or notifications before they are sent by a processor (email, mobile...)
701
* New capability 'moodle/category:viewcourselist' in category context that controls whether user is able to browse list of courses
702
703
704
  in this category. To work with list of courses use API methods in core_course_category and also 'course' form element.
* It is possible to pass additional conditions to get_courses_search();
  core_course_category::search_courses() now allows to search only among courses with completion enabled.
705
* Add support for a new xxx_after_require_login callback
706
707
708
709
710
711
712
713
* A new conversation type has been created for self-conversations. During the upgrading process:
  - Firstly, the existing self-conversations will be starred and migrated to the new type, removing the duplicated members in the
  message_conversation_members table.
  - Secondly, the legacy self conversations will be migrated from the legacy 'message_read' table. They will be created using the
  new conversation type and will be favourited.
  - Finally, the self-conversations for all remaining users without them will be created and starred.
Besides, from now, a self-conversation will be created and starred by default to all the new users (even when $CFG->messaging
is disabled).
714
715
716
* New optional parameter $throwexception for \get_complete_user_data(). If true, an exception will be thrown when there's no
  matching record found or when there are multiple records found for the given field value. If false, it will simply return false.
  Defaults to false when not set.
717
* Exposed submit button to allow custom styling (via customclassoverride variable) which can override btn-primary/btn-secondary classes
718
719
720
721
722
723
* `$includetoken` parameter type has been changed. Now supports:
   boolean: False indicates to not include the token, true indicates to generate a token for the current user ($USER).
   integer: Indicates to generate a token for the user whose id is the integer value.
* The following functions have been updated to support the new usage:
    - make_pluginfile_url
    - file_rewrite_pluginfile_urls
724
* New mform element 'float' handles localised floating point numbers.
725

726
727
=== 3.6 ===

728
729
730
731
732
733
* A new token-based version of pluginfile.php has been added which can be used for out-of-session file serving by
  setting the `$includetoken` parameter to true on the `moodle_url::make_pluginfile_url()`, and
  `moodle_url::make_file_url()` functions.
* The following picture functions have been updated to support use of the new token-based file serving:
    - print_group_picture
    - get_group_picture_url
734
735
* The `user_picture` class has a new public `$includetoken` property which can be set to make use of the new token-based
  file serving.
736
* Custom AJAX handlers for the form autocomplete fields can now optionally return string in their processResults()
737
  callback. If a string is returned, it is displayed instead of the list of suggested items. This can be used, for
738
  example, to inform the user that there are too many items matching the current search criteria.
739
* The form element 'htmleditor' has been deprecated. Please use the 'editor' element instead.
740
* The print_textarea() function has been deprecated. Please use $OUTPUT->print_textarea() instead.
741
* The following functions have been finally deprecated and can not be used any more:
742
743
    - external_function_info()
    - core_renderer::update_module_button()
744
745
746
747
748
749
750
751
752
753
    - events_trigger()
    - events_cron()
    - events_dispatch()
    - events_is_registered()
    - events_load_def()
    - events_pending_count()
    - events_process_queued_handler()
    - events_queue_handler()
    - events_trigger_legacy()
    - events_update_definition()
754
755
756
757
758
759
    - get_file_url()
    - course_get_cm_rename_action()
    - course_scale_used()
    - site_scale_used()
    - clam_message_admins()
    - get_clam_error_code()
760
761
762
763
764
765
766
767
768
769
770
771
    - get_records_csv()
    - put_records_csv()
    - print_log()
    - print_mnet_log()
    - print_log_csv()
    - print_log_xls()
    - print_log_ods()
    - build_logs_array()
    - get_logs_usercourse()
    - get_logs_userday()
    - get_logs()
    - prevent_form_autofill_password()
772
    - prefixed_tablenode_transformations()
773
774
    - core_media_renderer
    - core_media
775
776
777
778
779
780
781
782
783
784
* Following api's have been removed in behat_config_manager, please use behat_config_util instead.
    - get_features_with_tags()
    - get_components_steps_definitions()
    - get_config_file_contents()
    - merge_behat_config()
    - get_behat_profile()
    - profile_guided_allocate()
    - merge_config()
    - clean_path()
    - get_behat_tests_path()
785
786
787
* Following behat steps have been removed from core:
    - I set the field "<field_string>" to multiline
    - I follow "<link_string>"" in the open menu
788
789
790
791
792
793
794
795
796
797
798
* The following behat steps have been deprecated, please do not use these step definitions any more:
    - behat_navigation.php: i_navigate_to_node_in()
    - theme/boost/tests/behat/behat_theme_boost_behat_navigation.php: i_navigate_to_node_in()
  Use one of the following steps instead:
    - I navigate to "PATH > ITEM" in current page administration
    - I navigate to "PATH > ITEM" in site administration
    - I navigate to course participants
    - I navigate to "TAB1 > TAB2" in the course gradebook
  If some items are not available without Navigation block at all, one can use combination of:
    - I add the "Navigation" block if not present
    - I click on "LINK" "link" in the "Navigation" "block"
799
800
* The core\session\util class has been removed. This contained one function only used by the memcached class which has
  been moved there instead (connection_string_to_memcache_servers).
801
* Removed the lib/password_compat/lib/password.php file.
802
803
804
805
806
807
* The eventslib.php file has been deleted and its functions have been moved to deprecatedlib.php. The affected functions are:
  - events_get_cached()
  - events_uninstall()
  - events_cleanup()
  - events_dequeue()
  - events_get_handlers()
808
809
* coursecat::get() now has optional $user parameter.
* coursecat::is_uservisible() now has optional $user parameter.
810
* Removed the lib/form/submitlink.php element which was deprecated in 3.2.
811
812
813
814
* The user_selector classes do not support custom list of extra identity fields any more. They obey the configured user
  policy and respect the privacy setting made by site administrators. The list of user identifiers should never be
  hard-coded. Instead, the setting $CFG->showuseridentity should be always respected, which has always been the default
  behaviour (MDL-59847).
815
816
817
818
* The function message_send() in messagelib.php will now only take the object \core\message\message as a parameter.
* The method message_sent::create_from_ids() parameter courseid is now required. A debugging
  message was previously displayed, and the SITEID was used, when not provided.
* The method \core\message\manager::send_message() now only takes the object \core\message\message as the first parameter.
819
820
821
* Following functions have been deprecated, please use get_roles_used_in_context.
    - get_roles_on_exact_context()
    - get_roles_with_assignment_on_context()
822
* New functions to support the merging of user draft areas from the interface; see MDL-45170 for details:
jun's avatar
jun committed
823
824
825
826
  - file_copy_file_to_file_area()
  - file_merge_draft_areas()
  - file_replace_file_area_in_text()
  - extract_draft_file_urls_from_text()
827
828
* Class coursecat is now alias to autoloaded class core_course_category, course_in_list is an alias to
  core_course_list_element, class coursecat_sortable_records is deprecated without replacement.
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
* \core_user_external::create_users() and \core_user_external::update_users() can now accept more user profile fields so user
  creation/update via web service can now be very similar to the edit profile page's functionality. The new fields that have been
  added are:
  - maildisplay
  - interests
  - url
  - icq
  - skype
  - aim
  - yahoo
  - msn
  - institution
  - department
  - phone1
  - phone2
  - address
845
846
847
* New function mark_user_dirty() must be called after changing data that gets cached in user sessions. Examples:
  - Assigning roles to users.
  - Unassigning roles from users.
848
849
  - Enrolling users into courses.
  - Unenrolling users from courses.
850
851
852
* New optional parameter $context for the groups_get_members_join() function and ability to filter users that are not members of
any group. Besides, groups_get_members_ids_sql, get_enrolled_sql and get_enrolled_users now accepts -1 (USERSWITHOUTGROUP) for
the groupid field.
853
854
* Added $CFG->conversionattemptlimit setting to config.php allowing a maximum number of retries before giving up conversion
  of a given document by the assignfeedback_editpdf\task\convert_submissions task. Default value: 3.
855
856
857
858
859
* The following events have been deprecated and should not be used any more:
  - message_contact_blocked
  - message_contact_unblocked
  The reason for this is because you can now block/unblock users without them necessarily being a contact. These events
  have been replaced with message_user_blocked and message_user_unblocked respectively.
860
861
862
* The event message_deleted has been changed, it no longer records the value of the 'useridto' due to
  the introduction of group messaging. Please, if you have any observers or are triggering this event
  in your code you will have to make some changes!
863
864
865
866
867
868
869
870
871
872
* The gradebook now supports the ability to accept files as feedback. This can be achieved by adding
  'feedbackfiles' to the $grades parameter passed to grade_update().
    For example -
        $grades['feedbackfiles'] = [
            'contextid' => 1,
            'component' => 'mod_xyz',
            'filearea' => 'mod_xyz_feedback',
            'itemid' => 2
        ];
  These files will be then copied to the gradebook file area.
873
874
875
876
877
878
879
880
881
882
883
* Allow users to choose who can message them for privacy reasons, with a 'growing circle of contactability':
  - Added $CFG->messagingallusers, for enabling messaging to all site users. Default value: 0.
    When $CFG->messagingallusers = false users can choose being contacted by only contacts or contacts and users sharing a course with them.
    In that case, the default user preference is MESSAGE_PRIVACY_COURSEMEMBER (users sharing a course).
    When $CFG->messagingallusers = true users have a new option for the privacy messaging preferences: "Anyone on the site". In that case,
    the default user preference is MESSAGE_PRIVACY_SITE (all site users).
  - Added $CFG->keepmessagingallusersenabled setting to config.php to force enabling $CFG->messagingallusers during the upgrading process.
    Default value: 0.
    When $CFG->keepmessagingallusersenabled is set to true, $CFG->messagingallusers will be also set to true to enable messaging site users.
    However, when it is empty, $CFG->messagingallusers will be disabled during the upgrading process, so the users will only be able to
    message contacts and users sharing a course with them.
884
885
886
887
888
889
* There has been interface and functional changes to admin_apply_default_settings() (/lib/adminlib.php).  The function now takes two
  additional optional parameters, $admindefaultsettings and $settingsoutput.  It also has a return value $settingsoutput.
  The function now does not need to be called twice to ensure all default settings are set.  Instead the function calls itself recursively
  until all settings have been set. The additional parameters are used recursively and shouldn't be need to be explicitly passed in when calling
  the function from other parts of Moodle.
  The return value: $settingsoutput is an array of setting names and the values that were set by the function.
890
* Webservices no longer update the lastaccess time for a user in a course. Call core_course_view_course() manually if needed.
891
* A new field has been added to the context table. Please ensure that any contxt preloading uses get_preload_record_columns_sql or get_preload_record_columns to fetch the list of columns.
892

893
894
=== 3.5 ===

895
896
897
898
* There is a new privacy API that every subsystem and plugin has to implement so that the site can become GDPR
  compliant. Plugins use this API to report what information they store or process regarding users, and provide ability
  to export and delete personal data. See https://docs.moodle.org/dev/Privacy_API for guidelines on how to implement the
  privacy API in your plugin.
899
* The cron runner now sets up a fresh PAGE and OUTPUT between each task.
900
901
* The core_renderer methods notify_problem(), notify_success(), notify_message() and notify_redirect() that were
  deprecated in Moodle 3.1 have been removed. Use \core\notification::add(), or \core\output\notification as required.
902
903
904
* The maximum supported precision (the total number of digits) for XMLDB_TYPE_NUMBER ("number") fields raised from 20 to
  38 digits. Additionally, the whole number part (precision minus scale) must not be longer than the maximum length of
  integer fields (20 digits). Note that PHP floats commonly support precision of roughly 15 digits only (MDL-32113).
905
906
907
* Event triggering and event handlers:
    - The following events, deprecated since moodle 2.6, have been finally removed: groups_members_removed,
      groups_groupings_groups_removed, groups_groups_deleted, groups_groupings_deleted.
908
909
* The following functions have been finally deprecated and can not be used any more:
  - notify()
910
911
* XMLDB now validates the PATH attribute on every install.xml file. Both the XMLDB editor and installation will fail
  when a problem is detected with it. Please ensure your plugins contain correct directory relative paths.
912
* Add recaptchalib_v2.php for support of reCAPTCHA v2.
913
914
915
* Plugins can define class 'PLUGINNAME\privacy\local\sitepolicy\handler' if they implement an alternative mechanisms for
  site policies managements and agreements. Administrators can define which component is to be used for handling site
  policies and agreements. See https://docs.moodle.org/dev/Site_policy_handler
916
917
918
* Scripts can define a constant NO_SITEPOLICY_CHECK and set it to true before requiring the main config.php file. It
  will make the require_login() skipping the test for the user's policyagreed status. This is useful for plugins that
  act as a site policy handler.
919
920
* There is a new is_fulltext_search_supported() DML function. The default implementation returns false. This function
  is used by 'Simple search' global search engine to determine if the database full-text search capabilities can be used.
921
922
923
* The following have been removed from the list of core subsystems:
   - core_register
   - core_publish
924
925
  Following this change, \core_register_renderer and \core_publish_renderer have been removed and their methods have been
  moved to \core_admin_renderer and \core_course_renderer respectively.
926

927
=== 3.4 ===
928

929
* oauth2_client::request method has an extra parameter to specify the accept header for the response (MDL-60733)
930
931
932
933
934
935
936
* The following functions, previously used (exclusively) by upgrade steps are not available
  anymore because of the upgrade cleanup performed for this version. See MDL-57432 for more info:
    - upgrade_mimetypes()
    - upgrade_fix_missing_root_folders_draft()
    - upgrade_minmaxgrade()
    - upgrade_course_tags()

937
938
939
940
* Added new moodleform element 'filetypes' and new admin setting widget 'admin_setting_filetypes'. These new widgets
  allow users to define a list of file types; either by typing them manually or selecting them from a list. The widgets
  directly support the syntax used to feed the 'accepted_types' option of the filemanager and filepicker elements. File
  types can be specified as extensions (.jpg or just jpg), mime types (text/plain) or groups (image).
941
942
943
* Removed accesslib private functions: load_course_context(), load_role_access_by_context(), dedupe_user_access() (MDL-49398).
* Internal "accessdata" structure format has changed to improve ability to perform role definition caching (MDL-49398).
* Role definitions are no longer cached in user session (MDL-49398).
944
945
* External function core_group_external::get_activity_allowed_groups now returns an additional field: canaccessallgroups.
  It indicates whether the user will be able to access all the activity groups.
946
* file_get_draft_area_info does not sum the root folder anymore when calculating the foldercount.
947
948
949
950
* The moodleform element classes can now optionally provide a public function validateSubmitValue(). This method can be
  used to perform implicit validation of submitted values - without the need to explicitly add the validation rules to
  every form. The method should accept a single parameter with the submitted value. It should return a string with the
  eventual validation error, or an empty value if the validation passes.
951
* New user_picture attribute $includefullname to determine whether to include the user's full name with the user's picture.
952
953
954
955
956
957
958
* Enrol plugins which provide enrolment actions can now declare the following "data-action" attributes in their implementation of
  enrol_plugin::get_user_enrolment_actions() whenever applicable:
  * "editenrolment" - For editing a user'e enrolment details. Defined by constant ENROL_ACTION_EDIT.
  * "unenrol" - For unenrolling a student. Defined by constant ENROL_ACTION_UNENROL.
  These attributes enable enrol actions to be rendered via modals. If not added, clicking on the enrolment action buttons will still
  redirect the user to the appropriate enrolment action page. Though optional, it is recommended to add these attributes for a
  better user experience when performing enrol actions.
959
960
961
962
963
964
965
* The enrol_plugin::get_user_enrolment_actions() implementations for core enrol plugins have been removed and moved to
  the parent method itself. New enrol plugins don't have to implement get_user_enrolment_actions(), but just need to
  make sure that they override:
  - enrol_plugin::allow_manage(), and/or
  - enrol_plugin::allow_unenrol_user() or enrol_plugin::allow_unenrol()
  Existing enrol plugins that override enrol_plugin::get_user_enrolment_actions() don't have to do anything, but can
  also opt to remove their own implementation of the method if they basically have the same logic as the parent method.
966
967
968
969
970
971
* New optional parameter $enrolid for the following functions:
  - get_enrolled_join()
  - get_enrolled_sql()
  - get_enrolled_with_capabilities_join()
  Setting this parameter to a non-zero value will add a condition to the query such that only users that were enrolled
  with this enrolment method will be returned.
972
973
974
* New optional parameter 'closeSuggestionsOnSelect' for the enhance() function for form-autocomplete. Setting this to true will
  close the suggestions popup immediately after an option has been selected. If not specified, it defaults to true for single-select
  elements and false for multiple-select elements.
975
* user_can_view_profile() now also checks the moodle/user:viewalldetails capability.
976
977
* The core/modal_confirm dialogue has been deprecated. Please use the core/modal_save_cancel dialogue instead. Please ensure you
  update to use the ModalEvents.save and ModalEvents.cancel events instead of their yes/no counterparts.
978
979
* Instead of checking the 'moodle/course:viewparticipants' and 'moodle/site:viewparticipants' capabilities use the
  new functions course_can_view_participants() and course_require_view_participants().
980
* $stored_file->add_to_curl_request() now adds the filename to the curl request.
981
982
* The option for Login HTTPS (authentication-only SSL) has been removed
* $CFG->loginhttps is now deprecated, do not use it.
983
* $PAGE->https_required and $PAGE->verify_https_required() are now deprecated. They are no longer used and will throw a coding_exception.
984
* $CFG->httpswwwroot is now deprecated and will always result in the same value as wwwroot.
985
986
987
* Added function core_role_set_view_allowed() to check if a user should be able to see a given role.
  This should be checked whenever displaying a list of roles to a user, however, core_role_set_assign_allowed may need to override it
  in some cases.
988
* Deprecated allow_override, allow_assign and allow_switch and replaced with core_role_set_*_allowed to avoid function names conflicting.
989

990
991
992
993
994
=== 3.3.1 ===

* ldap_get_entries_moodle() now always returns lower-cased attribute names in the returned entries.
  It was suppposed to do so before, but it actually didn't.

995
=== 3.3 ===
996

997
998
* Behat compatibility changes are now being documented at
  https://docs.moodle.org/dev/Acceptance_testing/Compatibility_changes
999
1000
* PHPUnit's bootstrap has been changed to use HTTPS wwwroot (https://www.example.com/moodle) from previous HTTP version. Any
  existing test expecting the old HTTP URLs will need to be switched to the new HTTPS value (reference: MDL-54901).