List of upgrade and API changes in Totara core,
information provided here is intended especially for developers.

=== 19.1.5 ===

* Modified the internal behavior of \totara_core\virtualmeeting\user_auth::create, \totara_core\virtualmeeting\authoriser\oauth2_authoriser::store,
  \totara_core\virtualmeeting\authoriser\mock_authoriser::refresh to encrypt the tokens when storing them.
* Modified the internal behavior of \totara_core\virtualmeeting\user_auth::get_token and \totara_core\virtualmeeting\user_auth::get_fresh_token
  to decrypt the access token when retrieving it.

=== 19.1.0 ===

* Updated totara_core\http\clients\curl_client to return a http code of 0 if the IP/hostname was blocked, previously a null was implied and a PHP warning thrown.
* Updated learning items completed() function to only return the latest 100 completed records
* Updated ARIA attributes in quickaccessmenu.mustache:
  * Changed button aria-haspopup from "true" to "dialog"
  * Added role="dialog" and aria-label to popover container

=== 19.0 ===

* Changed aside tag to div in templates/quickaccessmenu.mustache
* Added menuitem role on close anchor tag in templates/nav_primary.mustache
* Added presentation role on select_multi template
* Updated select_tree.mustache so that the label is linked to the dropdown
* Changed element from section to div in templates/grid.mustache
* Changed h1 tag to div in templates/masthead_logo.mustache
* \totara_core\local\visibility\base::sql_view_hidden has been undeprecated
  \totara_core\local\visibility\base::sql_view_hidden_exists has been deprecated in favour of \totara_core\local\visibility\base::sql_view_hidden
* \totara_core\local\visibility\map::sql_view_hidden_roles has been undeprecated
  \totara_core\local\visibility\map::sql_view_hidden_roles_subquery has been deprecated in favour of sql_view_hidden_roles
* Function encrypt_data now prints a developer debugging message if a key could not be read
* Function encrypt_data now requires a string for both the $plaintext and $key parameters

=== 18.0 ===

* get_my_reports_list_and_errors() has been deprecated, please use get_my_reports_data() instead.
* totara_core_renderer::my_reports_page() has been deprecated
* \totara_core\local\visibility\base::sql_view_hidden has been deprecated in favour of sql_view_hidden_exists
* \totara_core\local\visibility\map::sql_view_hidden_roles has been deprecated in favour of sql_view_hidden_roles_subquery

=== 17.0 ===

* Changed visibility for $filters and $filter_factory on totara_core\data_provider\provider to allow overriding
 in a child class.
* Added new role 'apiuser' to archetypes of 'totara/core:delegateusersmanager' capability

=== 16.0 ===

* Upgraded jQuery DataTables to 1.11.3
* Modified totara_core\data_provider\provider::set_user_id() to return the provider instance; previously it was a void
  function.
* Added field progress_summary to GraphQL type totara_core_learning_item

--- Update to graphQL ---
* Updated field 'filename' scalar type 'param_text' to 'String' for mutation 'totara_core_delete_draft_file'

=== 15.0 ===

* Moved tests/language_pack_faker_trait to the core_phpunit namespace. Any testcases using the trait need to be updated.
* totara_get_categoryid_with_capability() has added a second parameter for user's id to not depends on the global $USER.
* Progress bar renderer can now receive optional label (used for aria label)

=== 14.0 ===

* totara_core_renderer::masthead has changed, no longer returning quickaccessmenu content - this is now loaded by Ajax
* totara_core/quickaccessmenu template has changed, moving menu content into the new totara_core/quickaccessmenu_content template

=== 13.5 ===

* totara_core\virtualmeeting\plugin\factory\feature_factory has been added
  a virtual meeting provider plugin that does not support a lossless update operation should return true for feature::LOSSY_UPDATE
* Added converted accordion icon to a button in totara_core/accordion_item template and added aria-label
* Added expandlabel to the external API return for quick access menu groups

=== 13.4 ===

* totara_core\virtualmeeting\dto\meeting_edit_dto::create_with_user_timezone(), an internal function previously marked as 'do not use', has been removed
* totara_core\virtualmeeting\virtual_meeting::create_with_user_timezone(), previously marked as 'do not use', has been removed
  please use totara_core\virtualmeeting\virtual_meeting::create() instead
* Added a new method _update_with_data() to totara_dialog.js for sending post requests with body data
* totara_core\entities\relationship_resolver has been moved to totara_core\entity\relationship_resolver
* totara_core\entities\relationship has been moved to totara_core\entity\relationship

=== 13.0 ===

* Added aria-label to sub nav to make the landmark distinguishable.
* Added aria-label to primary nav to make the landmark distinguishable.
* Updated totara_core/grid template, adding a new attribute to control whether an item
  is marked as active or redirects on click
* totara_print_report_manager() function has been deprecated and should no longer be used.
* Added 'Totara grid catalogue' as a third option for 'Default home page for users' setting in Navigation settings
* Changed 'Allow default page selection' default value from 'Yes' to 'No'
* totara_core\quickaccessmenu\menu::get_items_in_group() added second argument $includehidden
* Removed deprecated custom errorlog handling
  The following have all been removed as part of this:
    - Method: totara_core_renderer::errorlog_link
    - Function: totara_setup_error_handlers
    - Function: totara_error_handler
    - Function: totara_exception_handler
    - Function: totara_crop_error_log
    - Function: totara_errors_download
    - DB Table: errorlog
    - Template: totara/core/templates/errorlog_link.mustache
* Removed deprecated templates:
  - core/alert_danger
  - core/alert_info
  - core/alert_success
  - core/alert_warning
* Removed deprecated function totara_random_bytes()
* Removed deprecated function check_string()
* totara_core\quickaccessmenu\external::add_group returns group context object instead of a boolean
* totara_core/accordion widget changed default setting of "always_open" to true
* Changed how menu compares menu items to values set by $PAGE->set_totara_menu_selected
** totara_build_menu_selected_node() now contains logic to find highlighted item
** $PAGE->set_totara_menu_selected now requires the fully qualified class name (including backslash),
   e.g 'recordoflearning' => '\totara_plan\totara\menu\recordoflearning'
** totara_core\masthead constructor no longer uses $selected_items parameter
* Added an id attribute to main navigation items in nav_primary.mustache, nav_expand.mustache and nav_sub.mustache so
  they may be targeted by user_tours. This is to replace the the css classes used to identify individual menu items used
  in Totara 11 and below.
* totara_core\masthead_menu::export_for_template now outputs totara_core|home instead of home (as provided by the basis theme)
* Added moodle_database::recommends_counted_recordset() which should be overridden for databases where performance
  testing shows that counted recordsets perform better than two simple queries.
* Deprecated custom notification handling.
  The following functions have been deprecated as part of this:
    - Function: totara_get_notifications() (alternative method: \core\notification::fetch())
    - Function: totara_set_notification() (alternative: redirect or \core\notification::*())
    - Function: totara_convert_notification_to_legacy_array() (no alternative)
    - Function: totara_queue_append() (no alternative)
    - Function: totara_queue_shift() (no alternative)
    - Method: \core\notification::add_totara_legacy() (no alternative)
    - Method: \totara_core_renderer::totara_notifications() (alternative method: \core_renderer::course_content_header_notifications())
* Deprecated function totara_print_scheduled_reports().
* Changed quickaccesssettings_group.mustache to use core/action_menu for group controls
* Changed report_list.mustache to have a grid and list view
* Moved advanced feature checks from totara.php lib file into own namespaced class \totara_core\advanced_feature
  marking the old functions as deprecated and redirecting its functionality to the new class.
  This affects: totara_feature_visible() and totara_feature_disabled().
  Please use: \totara_core\advanced_feature::is_enabled() and \totara_core\advanced_feature::is_disabled() instead.
  totara_feature_hidden() is now deprecated as we do not support hidden anymore, just enabled and disabled.
* Updated totara_core/grid template, adding role attributes
* totara_core_renderer::course_progress_bar() added fourth argument $hideifnotactive
* totara_core_renderer::export_course_progress_for_template() added fourth argument $hideifnotactive
* totara_display_course_progress_bar() added fourth argument $hideifnotactive
* totara_export_course_progress() added fourth argument $hideifnotactive
* Updated totara_core/select_search_text template, changing remove text string
* Changed class totara_dialog_content_plan_evidence and file totara/core/dialogs/search.php to use the new totara evidence tables
    and totara/core/dialogs/search.php now searches the text and text area content of evidence in addition to just the name.
* The basket code in Totara core is deprecated; it is currently only used in the totara competency module and will be
  replaced with vue/tui basket in the future. Affected files/classes are:
  - All the files/classes in server/totara/core/classes/basket
  - The basket class in server/lib/classes/orm/entity/filter/basket.php

=== 12.0 ===

* Major cleanup and refactoring in Totara menu API:
** totara_menu_reset_cache() was deprecated, use totara_menu_reset_all_caches() or totara_menu_reset_session_cache() instead
** \totara_core\totara\menu\item methods that are not allowed to be overridden are now marked with final keyword.
** item::check_visibility() does not need to use is_disabled() and bool result is now expected.
** Parentable Totare menu classes now must extends a new base class totara/core/classes/totara/menu/container.php
** Totara menu list files db/totaramenu.php are now obsolete and should be deleted,
   item classes are now automatically discovered using component class namespace 'totara\menu' lookup.
** Internal Totara menu API was refactored, menu and build classes are now deprecated and should not be used,
   use new constants and methods in item class or new helper class.
* Deprecated totara_print_my_courses()
* Deprecated totara_core/progressbar mustache template
* Icon helpers are no longer used in the following templates, icon data is passed via context data:
** totara/core/templates/my_team_nav.mustache
** totara/core/templates/report_list.mustache
* Removed deprecated placeholder polyfill
* Removed deprecated methods:
  * build_nojs_positionpicker()
  * totara_update_temporary_managers()
  * totara_display_course_progress_icon()
  * totara_is_manager()
  * totara_get_staff()
  * totara_get_manager()
  * totara_get_most_primary_manager()
  * totara_update_temporary_manager()
  * totara_unassign_temporary_manager()
  * totara_get_teamleader()
  * totara_get_appraiser()
  * sql_cast2char()
  * sql_cast2float()
  * totara_core_renderer::totara_print_active_users()
  * totara_core_renderer::display_course_progress_icon()
  * totara_core_renderer::print_my_team_nav()
  * totara_core_renderer::print_report_manager()
  * totara_core_renderer::print_scheduled_reports()
  * totara_core_renderer::print_toolbars()
  * totara_core_renderer::print_totara_search()
  * totara_core_renderer::print_totara_menu()
  * totara_core_renderer::print_totara_notifications()
  * totara_core_renderer::print_totara_progressbar()
  * totara_core_renderer::print_icons_list()
* Removed deprecated file dialogs/dialog_content_manager.class.php
* Changed totara/core/templates/totara_menu.mustache, adding aria menu attributes
* Deprecated totara/core/js/goal.item.js file
* Deprecated template totara_menu, instead use nav_prim (just the nav menu) or masthead (includes other masthead elements)
* Deprecated class totara_core\output\totara_menu, instead use totara_core\output\masthead_menu
* Deprecated function totara_core_renderer::render_totara_menu(), use totara_core_renderer::masthead() instead.
* totara_core_renderer::icon_list() has changed
* totara_core/icon_list mustache template has been updated
* totara/core/templates/report_list.mustache name property was being double escaped, converted from double to triple braces.

=== 11 ===

* Deprecated custom errorlog handling that has not been used since Totara 1.1
  The following have all been deprecated in Totara 11 as part of this:
    - Method: totara_core_renderer::errorlog_link
    - Function: totara_setup_error_handlers
    - Function: totara_error_handler
    - Function: totara_exception_handler
    - Function: totara_crop_error_log
    - Function: totara_errors_download
    - Argument: admin_notifications_page::$latesterror
    - DB Table: errorlog
    - Template: totara/core/templates/errorlog_link.mustache

=== 10.0 ===

* unused function resize_image() was renamed to totara_resize_image() because it collided with gdlib
* totara_dialog_content_manager has been deprecated, please use totara_job_dialog_assign_manager instead.
* updated totara/core/templates/totara_search.mustache
* totara/core/templates/totara_search.mustache context object has changed, the property ->alt has been deprecated
* updated totara/core/templates/course_progress_bar.mustache
* totara/core/templates/report_list.mustache context object has changed, the property ->report_list[]->name is no
    longer sanitised (as it sanitised in the template and in the flex/pix templates);
* updated totara_core_renderer::report_list_export_for_template()

Hook is added for Seminar Sing-up link directly to calendar upcoming events block
# calendar_upcoming_event class in totara/core/classes/hook/calendar_upcoming_event.php
# calendar_dynamic_content class in totara/core/classes/watcher/calendar_dynamic_content.php
# calendar_dynamic_content class in mod/facetoface/classes/hook/calendar_dynamic_content.php
# seminar_calendar_dynamic_content class in mod/facetoface/watcher/seminar_calendar_dynamic_content.php

*** Usage: ***
no need to change calendar_get_block_upcoming function in calendar/lib.php
change calendar_dynamic_content class in totara/core/classes/watcher/calendar_dynamic_content.php
    ...
    public static function create(calendar_upcoming_event $hook) {
        ...
        case '{modulename}':
            $hook = new \mod_{modulename}\hook\{modulename_hook}($hook->event, $hook->content);
            $hook->execute();
            break;
        ...

and create {modulename_hook} as sample
 # mod/facetoface/classes/hook/calendar_dynamic_content.php
 # mod/facetoface/watcher/seminar_calendar_dynamic_content.php

* The following functions has been deprecated and can not be used any more:
    - sql_cast2char()
    - sql_cast2float()
* Deprecated TOTARA_JS_PLACEHOLDER as all supported browsers support the HTML placeholder attribute
* Updated totara_core_renderer::active_users()
* Updated totara_core_renderer::errorlog_link()
* Updated totara_core_renderer::is_registered()
* Deprecated totara_core/is_registered mustache template
* Deprecated core/alert_danger mustache template
* Deprecated core/alert_info mustache template
* Deprecated core/alert_success mustache template
* Deprecated core/alert_warning mustache template
