1 This files describes API changes for code that uses the user API.
5 * The `profile_field_base` class now contains a `show_field_content` method to determine whether the field and
6 content should be shown to the user. Can be overridden in child classes as required
10 * Added get_internalfield_list() and get_internalfields() in the user_field_mapping class.
11 The get_internalfield_list() returns data in an array by grouping profile fields based on field categories,
12 used for internal field name dropdown in the user field mapping of Oauth2 services
13 The get_internalfields() converts the result from get_internalfield_list() into flat array,
14 used to save/update the profile data when a user uses OAuth2 services.
15 * Added get_profile_field_names() and get_profile_field_list() in the profile_field_base class.
16 The get_profile_field_names() returns the list of valid custom profile user fields.
17 The get_profile_field_list() returns the profile fields
18 in a format that can be used for choices in a group select menu.
19 * New method `core_user::is_current_user`, useful for components implementing permission callbacks for their preferences
20 * New `profile_get_user_field` method for returning profile field instance of given type
21 * The `profile_field_base::is_visible` method now accepts an optional `$context` argument
22 * External function core_user_external::add_user_private_files() now returns moodle_exception when the user quota is exceeded
23 * The `customfields` structure used for returning user profile fields information has been updated to:
24 * Return in the field `value` the value of the custom field (as stored in the database)
25 * Return in the field `displayvalue` the value of the custom field for display
26 External systems displaying user information should always use `displayvalue`.
27 * New method `user_update_device_public_key()`` and accompanying external function core_user_external::update_device_public_key to
28 update a user's app generated public key by device uuid and app id.
32 * Added a new method is_transform_supported() in the profile_field_base class.
33 The purpose is to allow the field to be transformed during the export process.
34 It has been implemented in the Date/Time data type (Applied in 4.1, 4.0.6).
36 * user_get_user_details_courses() now accepts an optional second parameter, an array of userfields that should be
37 returned. The values passed into the $userfields parameter must all be included in the return from
38 user_get_default_fields().
39 It also allows you to reduce how much of a user record is required by the method. The minimum user record fields are:
42 * all potential fullname fields
44 * Participant filter is moved to core as an API which can be used in different areas of core by implementing the API
45 and filterable objects. As a part of making the API mature as a core one, these are the js files moved from core
47 * user/amd/src/local/participantsfilter/filter.js → lib/amd/src/datafilter/filtertype.js
48 * user/amd/src/local/participantsfilter/filtertypes/country.js → lib/amd/src/datafilter/filtertypes/country.js
49 * user/amd/src/local/participantsfilter/filtertypes/courseid.js → lib/amd/src/datafilter/filtertypes/courseid.js
50 * user/amd/src/local/participantsfilter/filtertypes/keyword.js → lib/amd/src/datafilter/filtertypes/keyword.js
51 * user/amd/src/local/participantsfilter/selectors.js → lib/amd/src/datafilter/selectors.js
52 The following mustache have been moved from core user to core library:
53 * user/templates/local/participantsfilter/filterrow.mustache → lib/templates/datafilter/filter_row.mustache
54 * user/templates/local/participantsfilter/filtertype.mustache → lib/templates/datafilter/filter_type.mustache
55 * user/templates/local/participantsfilter/filtertypes.mustache → lib/templates/datafilter/filter_types.mustache
56 * user/templates/local/participantsfilter/autocomplete_layout.mustache → lib/templates/datafilter/autocomplete_layout.mustache
57 * user/templates/local/participantsfilter/autocomplete_selection.mustache → lib/templates/datafilter/autocomplete_selection.mustache
58 * user/templates/local/participantsfilter/autocomplete_selection_items.mustache → lib/templates/datafilter/autocomplete_selection_items.mustache
59 Class participant_filter now extends core filter api in core user.
61 * The unified_filter function has been finally deprecated and cannot be used anymore
62 * The class \core_user\output\unified_filter has been finally deprecated and removed
66 * External function core_user_external::update_users() will now fail on a per user basis. Previously if one user
67 update failed all users in the operation would fail.
68 * External function core_user_external::update_users() now returns an error code and message to why a user update
70 * New method `core_user\fields::get_sql_fullname` for retrieving user fullname format in SQL statement
71 * The `profile_get_custom_field_data_by_shortname` method now accepts an optional parameter to determine whether
72 to use case-sensitive matching of the profile field shortname or not (default true)
76 * Added new core_user/form_user_selector JS module that can be used as the 'ajax' handler for the autocomplete form
77 element implementing the user selector.
78 * Added new external function core_user_external::search_identity(). The main purpose of this external function is to
79 provide data for asynchronous user selectors and similar widgets. It allows to search users matching the given query
80 in their name or other available identity fields.
84 * The unified filter has been replaced by the participants filter. The following have therefore been deprecated:
86 * user_get_participants_sql
87 * user_get_total_participants
88 * user_get_participants
89 * Unified filter renderer (core_user_renderer::unified_filter)
90 * Unified filter renderable (\core_user\output\unified_filter)
91 * Unified filter JavaScript (core_user/unified_filter.js and core_user/unified_filter_datasource.js)
92 * Unified filter template (unified_filter.mustache)
96 * The following functions have been finally deprecated and can not be used anymore:
97 * useredit_update_picture()
98 * core_user_external::update_user_preferences() now allows to unset existing preferences values.
99 If the preference value field is not set, the preference will be unset.