Merge branch 'install_master' of https://git.in.moodle.com/amosbot/moodle-install
[moodle.git] / user / upgrade.txt
blobe20f6c073002a47e72b6cfd8fed476d36a4287fd
1 This files describes API changes for code that uses the user API.
3 === 4.3 ===
5 * Added new methods:
6  - `core_user::get_profile_picture` for retrieving user picture.
7  - `core_user::get_profile_url` for retrieving profile url.
8  - `core_user::get_fullname` for retrieving user full name.
9 * The `core_user/repository` Javascript module now exports new methods for manipulating user preferences:
10   - `[get|set]UserPreference`
11   - `[get|set]UserPreferences`
12 * The following user preference helpers have been deprecated, please use the `core_user/repository` module instead:
13   - `user_preference_allow_ajax_update`
14   - `M.util.set_user_preference`
15   - `lib/ajax/setuserpref.php`
16 * The external `core_user_set_user_preferences` method will now default the `userid` property of each preference to
17   that of the current user, if omitted
18 * The following previously deprecated methods have been removed and can no longer be used:
19   - `profile_display_fields`
20   - `profile_edit_category`
21   - `profile_edit_field`
22   - `user_get_participants`
23   - `user_get_participants_sql`
24   - `user_get_total_participants`
25 * The users_search_sql function parameter $searchanywhere has been change to $searchtype for different type of search. $searchtype is a int parameter and has three constant value:
26   USER_SEARCH_STARTS_WITH: 0, USER_SEARCH_CONTAINS: 1, USER_SEARCH_EXACT_MATCH: 2
27   users_search_sql('User Test 2', '', false) =>  users_search_sql('Test Street', '', USER_SEARCH_CONTAINS)
29 === 4.2 ===
31 * Added get_internalfield_list() and get_internalfields() in the user_field_mapping class.
32   The get_internalfield_list() returns data in an array by grouping profile fields based on field categories,
33   used for internal field name dropdown in the user field mapping of Oauth2 services
34   The get_internalfields() converts the result from get_internalfield_list() into flat array,
35   used to save/update the profile data when a user uses OAuth2 services.
36 * Added get_profile_field_names() and get_profile_field_list() in the profile_field_base class.
37   The get_profile_field_names() returns the list of valid custom profile user fields.
38   The get_profile_field_list() returns the profile fields
39   in a format that can be used for choices in a group select menu.
40 * New method `core_user::is_current_user`, useful for components implementing permission callbacks for their preferences
41 * New `profile_get_user_field` method for returning profile field instance of given type
42 * The `profile_field_base::is_visible` method now accepts an optional `$context` argument
43 * External function core_user_external::add_user_private_files() now returns moodle_exception when the user quota is exceeded
44 * The `customfields` structure used for returning user profile fields information has been updated to:
45    * Return in the field `value` the value of the custom field (as stored in the database)
46    * Return in the field `displayvalue` the value of the custom field for display
47    External systems displaying user information should always use `displayvalue`.
48 * New method `user_update_device_public_key()`` and accompanying external function core_user_external::update_device_public_key to
49   update a user's app generated public key by device uuid and app id.
51 === 4.1 ===
53 * Added a new method is_transform_supported() in the profile_field_base class.
54   The purpose is to allow the field to be transformed during the export process.
55   It has been implemented in the Date/Time data type (Applied in 4.1, 4.0.6).
57 * user_get_user_details_courses() now accepts an optional second parameter, an array of userfields that should be
58   returned. The values passed into the $userfields parameter must all be included in the return from
59   user_get_default_fields().
60   It also allows you to reduce how much of a user record is required by the method. The minimum user record fields are:
61     * id
62     * deleted
63     * all potential fullname fields
65 * Participant filter is moved to core as an API which can be used in different areas of core by implementing the API
66   and filterable objects. As a part of making the API mature as a core one, these are the js files moved from core
67   user to core library:
68   * user/amd/src/local/participantsfilter/filter.js → lib/amd/src/datafilter/filtertype.js
69   * user/amd/src/local/participantsfilter/filtertypes/country.js → lib/amd/src/datafilter/filtertypes/country.js
70   * user/amd/src/local/participantsfilter/filtertypes/courseid.js → lib/amd/src/datafilter/filtertypes/courseid.js
71   * user/amd/src/local/participantsfilter/filtertypes/keyword.js → lib/amd/src/datafilter/filtertypes/keyword.js
72   * user/amd/src/local/participantsfilter/selectors.js → lib/amd/src/datafilter/selectors.js
73   The following mustache have been moved from core user to core library:
74   * user/templates/local/participantsfilter/filterrow.mustache → lib/templates/datafilter/filter_row.mustache
75   * user/templates/local/participantsfilter/filtertype.mustache → lib/templates/datafilter/filter_type.mustache
76   * user/templates/local/participantsfilter/filtertypes.mustache → lib/templates/datafilter/filter_types.mustache
77   * user/templates/local/participantsfilter/autocomplete_layout.mustache → lib/templates/datafilter/autocomplete_layout.mustache
78   * user/templates/local/participantsfilter/autocomplete_selection.mustache → lib/templates/datafilter/autocomplete_selection.mustache
79   * user/templates/local/participantsfilter/autocomplete_selection_items.mustache → lib/templates/datafilter/autocomplete_selection_items.mustache
80   Class participant_filter now extends core filter api in core user.
82 * The unified_filter function has been finally deprecated and cannot be used anymore
83 * The class \core_user\output\unified_filter has been finally deprecated and removed
85 === 4.0 ===
87 * External function core_user_external::update_users() will now fail on a per user basis. Previously if one user
88   update failed all users in the operation would fail.
89 * External function core_user_external::update_users() now returns an error code and message to why a user update
90   action failed.
91 * New method `core_user\fields::get_sql_fullname` for retrieving user fullname format in SQL statement
92 * The `profile_get_custom_field_data_by_shortname` method now accepts an optional parameter to determine whether
93   to use case-sensitive matching of the profile field shortname or not (default true)
95 === 3.11 ===
97 * Added new core_user/form_user_selector JS module that can be used as the 'ajax' handler for the autocomplete form
98   element implementing the user selector.
99 * Added new external function core_user_external::search_identity(). The main purpose of this external function is to
100   provide data for asynchronous user selectors and similar widgets. It allows to search users matching the given query
101   in their name or other available identity fields.
103 === 3.9 ===
105 * The unified filter has been replaced by the participants filter. The following have therefore been deprecated:
106   * Library functions:
107     * user_get_participants_sql
108     * user_get_total_participants
109     * user_get_participants
110   * Unified filter renderer (core_user_renderer::unified_filter)
111   * Unified filter renderable (\core_user\output\unified_filter)
112   * Unified filter JavaScript (core_user/unified_filter.js and core_user/unified_filter_datasource.js)
113   * Unified filter template (unified_filter.mustache)
115 === 3.6 ===
117 * The following functions have been finally deprecated and can not be used anymore:
118   * useredit_update_picture()
119 * core_user_external::update_user_preferences() now allows to unset existing preferences values.
120   If the preference value field is not set, the preference will be unset.