This files describes API changes in core libraries and APIs,
information provided here is intended especially for developers.

=== 10.7 ===

* Updated popover_region.mustache correcting role attribute.
* New $mustequal parameter added to the following methods in lib/tests/behat/behat_general.php
  to control whether a table call data must 'equal' or 'contain' the data to be matched.
    - following_should_exist_in_the_table
    - row_column_of_table_should_contain

=== 10.5 ===

* Updated tabobject so that the title attribute is no longer set if not provided
* Updated core_renderer::render_tabobject()

=== 10.1 ===

* updated progress_bar.mustache

=== 10.0 ===

* Added classes for external command execution (e.g. shell commands or external applications)
  See https://help.totaralearning.com/display/DEV/Command+execution+API for more information.
* filter_get_globally_enabled() added first argument $resetcache
* JQuery has been updated to 3.2.1. - please read
  https://jquery.com/upgrade-guide/3.0/ and update your javascript.
* get_user_capability_course() now has an additional parameter 'limit'. This can be used to return a set number of records with
  the submitted capability. The parameter 'fieldsexceptid' will now accept context fields which can be used for preloading.
* Admin setting "Show My courses expanded on Dashboard" has been removed.
* MForms element 'submitlink' has been deprecated.
* Searchable selector form element is now a wrapper for autocomplete. A "No selection" option is automatically
  added to the options list for best backwards compatibility - if you were manually adding a "no selection" option you will need
  to remove it.
* Node.js versions >=4 are now required to run grunt.
* JQuery has been updated to 3.2.1. Please read https://jquery.com/upgrade-guide/3.0/ and update your javascript.
* New option 'blanktarget' added to format_text. This option adds target="_blank" to links
* A new webservice structure `external_files` has been created which provides a standardised view of files in Moodle and
  should be used for all file return descriptions.
  Files matching this format can be retrieved via the new `external_util::get_area_files` method.
  See MDL-54951 for further information.
* The parameter $usepost of the following functions has been deprecated and is not used any more:
  - get_max_upload_file_size()
  - get_user_max_upload_file_size()
* The following classes have been removed and should not be used any more:
    - boxclient - See MDL-49599 for more information.
* The following functions have been removed and should not be used any more:
    - file_modify_html_header() - See MDL-29738 for more information.
* core_grades_external::get_grades has been deprecated. Please do not call this function any more.
  External function gradereport_user_external::get_grade_items can be used for retrieving the course grades information.
* New option 'escape' added to format_string. When true (default), escapes HTML entities from the string
* The following functions have been deprecated and are not used any more:
  - get_records_csv() Please use csv_import_reader::load_csv_content() instead.
  - put_records_csv() Please use download_as_dataformat (lib/dataformatlib.php) instead.
  - zip_files()   - See MDL-24343 for more information.
  - unzip_file()  - See MDL-24343 for more information.
  - print_log()           - See MDL-43681 for more information
  - print_log_csv()       - See MDL-43681 for more information
  - print_log_ods()       - See MDL-43681 for more information
  - print_log_xls()       - See MDL-43681 for more information
  - print_mnet_log()      - See MDL-43681 for more information
  - build_logs_array()    - See MDL-43681 for more information
  - get_logs()            - See MDL-43681 for more information
  - get_logs_usercourse() - See MDL-43681 for more information
  - get_logs_userday()    - See MDL-43681 for more information
  - prevent_form_autofill_password() Please do not use anymore.
* The password_compat library was removed as it is no longer required.
* Phpunit has been upgraded to 5.4.x and following has been deprecated and is not used any more:
  - setExpectedException(), use @expectedException or $this->expectException() and $this->expectExceptionMessage()
  - getMock(), use createMock() or getMockBuilder()->getMock()
  - UnitTestCase class is removed.
* The following methods have been finally deprecated and should no longer be used:
  - course_modinfo::build_section_cache()
  - cm_info::get_deprecated_group_members_only()
  - cm_info::is_user_access_restricted_by_group()
* The following methods in cm_info::standardmethods have also been finally deprecated and should no longer be used:
  - cm_info::get_after_edit_icons()
  - cm_info::get_after_link()
  - cm_info::get_content()
  - cm_info::get_custom_data()
  - cm_info::get_extra_classes()
  - cm_info::get_on_click()
  - cm_info::get_url()
  - cm_info::obtain_dynamic_data()
  Calling them through the magic method __call() will throw a coding exception.
* The alfresco library has been removed from core. It was an old version of
  the library which was not compatible with newer versions of Alfresco.
* Added down arrow: $OUTPUT->darrow.
* All file_packer implementations now accept an additional parameter to allow a simple boolean return value instead of
  an array of individual file statuses.
* "I set the field "field_string" to multiline:" now end with colon (:), as PyStrings is supposed to end with ":"
* New functions to support deprecation of events have been added to the base event. See MDL-46214 for further details.
* A new function `get_name_with_info` has been added to the base event. This function adds information about event
  deprecations and should be used where this information is relevant.
* Following api's have been deprecated 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
* behat_util::start_test_mode() accepts 3 options now:
  - 1. Theme sute with all features: If behat should initialise theme suite with all core features.
  - 2. Parallel runs: How many parallel runs will be running.
  - 3. Run: Which process behat should be initialise for.
* behat_context_helper::set_session() has been deprecated, please use behat_context_helper::set_environment() instead.
* data-fieldtype="type" attribute has been added to form field default template.
* form elements extending MoodleQuickForm_group must call $this->createFormElement() instead of
  @MoodleQuickForm::createElement() in order to be compatible with PHP 7.1
* Relative paths in $CFG->alternateloginurl will be resolved to absolute path within moodle site. Previously they
  were resolved to absolute path within the server. That means:
  - $CFG->wwwroot: http://example.com/moodle
  - $CFG->alternateloginurl : /my/super/login.php
  - Login url will be: http://example.com/moodle/my/super/login.php (moodle root based)
* Database (DML) layer:
  - new sql_equal() method available for places where case sensitive/insensitive varchar comparisons are required.
* PostgreSQL connections now use advanced options to reduce connection overhead.  These options are not compatible
  with some connection poolers.  The dbhandlesoptions parameter has been added to allow the database to configure the
  required defaults. The parameters that are required in the database are;
    ALTER DATABASE moodle SET client_encoding = UTF8;
    ALTER DATABASE moodle SET standard_conforming_strings = on;
    ALTER DATABASE moodle SET search_path = 'moodle,public';  -- Optional, if you wish to use a custom schema.
  You can set these options against the database or the moodle user who connects.
* Some form elements have been refined to better support right-to-left languages. In RTL,
  most fields should not have their direction flipped, a URL, a path to a file, a number, ...
  are always displayed LTR. Input fields and text areas now will best guess whether they
  should be forced to be displayed in LTR based on the PARAM type associated with it. You
  can call $mform->setForceLtr($elementName, true/false) on some form fields to manually
  set the value.
* Action menus do_not_enhance() is deprecated, use a list of action_icon instead.
* The minifier library used by core_minify has been switched to https://github.com/matthiasmullie/minify - there are minor differences
  in minifier output.
* context_header additional buttons can now have a class attribute provided in the link attributes.
* The return signature for the antivirus::scan_file() function has changed.
  The calling function will now handle removal of infected files from Moodle based on the new integer return value.
* The first parameter $eventdata of both message_send() and \core\message\manager::send_message() should
  be \core\message\message. Use of stdClass is deprecated.
* The message_sent event now expects other[courseid] to be always set, exception otherwise. For BC with contrib code,
  message_sent::create_from_ids() will show a debugging notice if the \core\message\message being sent is missing
  the courseid property, defaulting to SITEID automatically. In Moodle 3.6 (MDL-55449) courseid will be fully mandatory
  for all messages sent.
* Introduced a new hook for plugin developers:
    - <component>_course_module_background_deletion_recommended()
  This hook should be used in conjunction with the existing '<component>_pre_course_module_delete($mod)'. It must
  return a boolean and is called by core to check whether a plugin's implementation of
  <component>_pre_course_module_deleted($mod) will take a long time. A plugin should therefore only implement this
  function if it also implements <component>_pre_course_module_delete($mod).
  An example in current use is recyclebin, which performs what can be a lengthy backup process in
  tool_recyclebin_pre_course_module_delete. The recyclebin, if enabled, now returns true in its implementation of
  tool_recyclebin_course_module_background_deletion_recommended(), to indicate to core that the deletion (and
  execution of tool_recyclebin_pre_course_module_delete) should be handled with an adhoc task, meaning it will not
  occur in real time.
* Webservice function core_course_search_courses accepts a new parameter 'limittoenrolled' to filter the results
  only to courses the user is enrolled in, and are visible to them.
* External functions that are not calling external_api::validate_context are buggy and will now generate
  exceptions. Previously they were only generating warnings in the webserver error log.
  See https://docs.moodle.org/dev/External_functions_API#Security
* The moodle/blog:associatecourse and moodle/blog:associatemodule capabilities has been removed.
* The following functions has been finally deprecated and can not be used any more:
    - profile_display_badges()
    - useredit_shared_definition_preferences()
    - calendar_normalize_tz()
    - get_user_timezone_offset()
    - get_timezone_offset()
    - get_list_of_timezones()
    - calculate_user_dst_table()
    - dst_changes_for_year()
    - get_timezone_record()
    - test_get_list_of_timezones()
    - test_get_timezone_offset()
    - test_get_user_timezone_offset()
* The google api library has been updated to version 1.1.7. There was some important changes
  on the SSL handling. Now the SSL version will be determined by the underlying library.
  For more information see https://github.com/google/google-api-php-client/pull/644
* The core_user::fill_properties_cache() static method has been introduced to be a reference
  and allow standard user fields data validation. Right now only type validation is supported
  checking it against the parameter (PARAM_*) type of the target user field. MDL-52781 is
  going to add support to null/not null and choices validation, replacing the existing code to
  validate the user fields in different places in a common way.
* Webservice function core_course_search_courses now returns results when the search string
  is less than 2 chars long.
* Webservice function core_course_search_courses accepts a new parameter 'requiredcapabilities' to filter the results
  by the capabilities of the current user.
* New mform element 'course' handles thousands of courses with good performance and usability.
* environment.xml file format was changed to use Totara major version numbers,
  use new TOTARA tag, for example: <TOTARA version="10" requires="9">
* environmentlib.php was partially refactored, do not use this internal API in custom code
* all incompatible Moodle plugin installation and update code and APIs were removed
* theme_config::get_all_block_regions() added argument $pagelayout
* core_renderer::render_file_picker flex-icon used for upload rather than CSS loaded image.
* CSS class 'link-as-button' has been removed. Please use "btn" instead
* core/templates method property renderIcon may alternatively be called with two parameters the second being a custom data object
* \core\output\block::from_block_contents() now always returns ->header attribute.
  As such, lib/templates/block.mustache has changed (removing the {{^header}} section).
* The redirect() function will now redirect immediately if output has not
  already started. Messages will be displayed on the subsequent page using
  session notifications. The type of message output can be configured using the
  fourth parameter to redirect().
* The specification of extra classes in the $OUTPUT->notification()
  function, and \core\output\notification renderable have been deprecated
  and will be removed in a future version.
  Notifications should use the levels found in \core\output\notification.
* The constants for NOTIFY_PROBLEM, NOTIFY_REDIRECT, and NOTIFY_MESSAGE in
  \core\output\notification have been deprecated in favour of NOTIFY_ERROR,
  NOTIFY_WARNING, and NOTIFY_INFO respectively.
* The following functions, previously used (exclusively) by upgrade steps are not available
  anymore because of the upgrade cleanup performed for this version. See MDL-51580 for more info:
    - upgrade_mysql_fix_unsigned_and_lob_columns()
    - upgrade_course_completion_remove_duplicates()
    - upgrade_save_orphaned_questions()
    - upgrade_rename_old_backup_files_using_shortname()
    - upgrade_mssql_nvarcharmax()
    - upgrade_mssql_varbinarymax()
    - upgrade_fix_missing_root_folders()
    - upgrade_course_modules_sequences()
    - upgrade_grade_item_fix_sortorder()
    - upgrade_availability_item()
* A new parameter $ajaxformdata was added to the constructor for moodleform. When building a
  moodleform in a webservice or ajax script (for example using the new fragments API) we
  cannot allow the moodleform to parse it's own data from _GET and _POST - we must pass it as
  an array.
* Plugins can extend the navigation for user by declaring the following callback:
  <frankenstyle>_extend_navigation_user(navigation_node $parentnode, stdClass $user,
                                        context_user $context, stdClass $course,
                                        context_course $coursecontext)
* The function notify() now throws a debugging message - see MDL-50269.
* Ajax calls going through lib/ajax/* now validate the return values before sending
  the response. If the validation does not pass an exception is raised. This behaviour
  is consistent with web services.
* Several changes in Moodle core, standard plugins and third party libraries to
  ensure compatibility with PHP7. All plugins are recommended to perform testing
  against PHP7 as well. Refer to https://docs.moodle.org/dev/Moodle_and_PHP7 for more
  information. The following changes may affect you:
  * Class moodleform, moodleform_mod and some module classes have been changed to use
    __construct() for the constructor. Calling parent constructors by the class
    name will display debugging message. Incorrect: parent::moodleform(),
    correct: parent::__construct()
  * All form elements have also changed the constructor syntax. No changes are
    needed for using form elements, however if plugin defines new form element it
    needs to use correct syntax. For example, incorrect: parent::HTML_QuickForm_input(),
    HTML_QuickForm_input::HTML_QuickForm_input(), $this->HTML_QuickForm_input().
    Correct: HTML_QuickForm_input::__construct() or parent::__construct().
  * profile_field_base::profile_field_base() is deprecated, use parent::__construct()
    in custom profile fields constructors. Similar deprecations in exsiting
    profile_field_* classes.
  * user_filter_type::user_filter_type() is deprecated, use parent::__construct() in
    custom user filters. Similar deprecations in existing user_filter_* classes.
  * table_default_export_format_parent::table_default_export_format_parent() is
    deprecated, use parent::__construct() in extending classes.
* groups_delete_group_members() $showfeedback parameter has been removed and is no longer
  respected. Users of this function should output their own feedback if required.
* Number of changes to Tags API, see tag/upgrade.txt for more details
* The previous events API handlers are being deprecated in favour of events 2 API, debugging messages are being displayed if
  there are 3rd party plugins using it. Switch to events 2 API please, see https://docs.moodle.org/dev/Event_2#Event_dispatching_and_observers
  Note than you will need to bump the plugin version so moodle is aware that you removed the plugin's event handlers.
* mforms validation functions are not available in the global JS namespace anymore, event listeners
  are assigned to fields and buttons through a self-contained JS function.
* Added $CFG->urlrewriteclass option to config.php allowing clean / semantic urls to
  be implemented in a plugin, eg local_cleanurls.
* $CFG->pathtoclam global setting has been moved to clamav antivirus plugin setting of the same name.
* clam_message_admins() and get_clam_error_code() have been deprecated, its functionality
  is now a part of \antivirus_clamav\scanner class methods.
* \repository::antivir_scan_file() has been deprecated, \core\antivirus\manager::scan_file() that
  applies antivirus plugins is replacing its functionality.
* Added core_text::str_max_bytes() which safely truncates multi-byte strings to a maximum number of bytes.
* Zend Framework has been removed completely.
* Any plugin can report when a scale is being used with the callback function [pluginname]_scale_used_anywhere(int $scaleid).
* Changes in file_rewrite_pluginfile_urls: Passing a new option reverse = true in the $options var will make the function to convert
  actual URLs in $text to encoded URLs in the @@PLUGINFILE@@ form.
* behat_util::is_server_running() is removed, please use behat_util::check_server_status() instead.
* Behat\Mink\Selector\SelectorsHandler::xpathLiteral() method is deprecated use behat_context_helper::escape instead
  when building Xpath, or pass the unescaped value when using the named selector.',
* table_sql download process is using the new data formats plugin which you can't use if you are buffering any output
    * flexible_table::get_download_menu(), considered private, has been deleted. Use
      $OUTPUT->download_dataformat_selector() instead.
* Add new file_is_executable(), to consistently check for executables even in Windows (PHP bug #41062).
* Introduced new hooks for plugin developers.
    - <component>_pre_course_category_delete($category)
    - <component>_pre_course_delete($course)
    - <component>_pre_course_module_delete($cm)
    - <component>_pre_block_delete($instance)
    - <component>_pre_user_delete($user)
  These hooks allow developers to use the item in question before it is deleted by core. For example, if your plugin is
  a module (plugins located in the mod folder) called 'xxx' and you wish to interact with the user object before it is
  deleted then the function to create would be mod_xxx_pre_user_delete($user) in mod/xxx/lib.php.
* Added new class breadcrumb_navigation_node
* Added plugin_renderer_base::render_breadcrumb_navigation_node()
* The get_file_url() function has been deprecated please call moodle_url::make_file_url() instead.
* Updated JavaScript Mustache implementation from 2.1.3 to 2.2.1
* Updated PHP Mustache implementation from 2.9.0 to 2.11.1
* Provided identifiers in the form of data-url attributes for user menu items
* core_renderer::render_help_icon() has changed.
* help_icon::export_for_template() includes icon, linktext, title, url in the return object
* loglevel.js has been updated 1.4.1 from 1.4.0
* Notifications are now output above the main content container by core_renderer not at the top of it by totara_core renderer.
* CSS class names used to define notification type when passed to totara_set_notification() e.g. 'notifysuccess' are now stripped
  and converted to Bootstrap equivalents. Other custom classes passed to totara_set_notification are preserved.
* completion_info::wipe_session_cache has been deprecated, tests automatically purge MUC
* progress_bar.mustache has changed
* ldap_get_entries_moodle() now always returns lower-cased attribute names in the returned entries.
  It was supposed to do so before, but it actually didn't.
* pix_icon::export_for_pix() now outputs a JSON string in the title key
* The pix mustache helper now accepts JSON as the final parameter as well as a string. If it is not a JSON object, the title
  and alt attributes will be the third parameter.
* 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).
* user_can_view_profile() now also checks the moodle/user:viewalldetails capability.
* The caching option 'immutable' has been added to send_stored_file() and send_file().

=== 9.2 ===

* lib/templates/flex_icon.mustache context variable has changed, the property ->customdata->title sets the title of the flex icon
* lib/templates/flex_icon_stack.mustache context variable has changed, the property ->customdata->title sets the title of the flex icon
* pear::Net::GeoIP has been removed.
