The new API replaces identical behaviour in existing calling code, but
allows for profile field types to override/separate the logic used to
show the field and determine whether it's empty
The `M.util.set_user_preference` method (plus accompanying helpers)
are now deprecated, in favour of the `core_user/repository` module
to achieve the same.
Update current implementation to proxy calls to the new API ensuring
backwards compatibility, while emitting copious developer debugging.
New functions:
* `core_user::get_profile_picture` for retrieving user picture.
* `core_user::get_profile_url` for retrieving profile url.
* `core_user::get_fullname` for retrieving user full name.
Note: the context is not used as this stage. It will be used by "User Disguises" plugin, which will be implemented later.
After the user creation, the system must call an update function to update profile_fields_*.
We also provided two functions into user/profile/lib.php to get available from other areas.
We added PHP unit testing for new public functions and
the Behat tests for custom profile fields with locked and unlocked statuses.
Co-authored-by: Matt Porritt <matt.porritt@moodle.com>
This implementation will de-couple the participant filter from
core user to core so its easily usable to any api in core or any
community plugin. This removes the dependency from the core_user
and creates a nice api where it can produce filterable objects.
Co-Authored-By: Safat Shahin <safatshahin@catalyst-au.net>
Co-Authored-By: Tomo Tsuyuki <tomotsuyuki@catalyst-au.net>
AMOS BEGIN
MOV [addcondition,core_user], [addcondition,core]
MOV [adverbfor_and,core_user], [operator_and,core]
MOV [adverbfor_andnot,core_user], [operator_andnot,core]
MOV [adverbfor_or,core_user], [operator_or,core]
MOV [applyfilters,core_user], [applyfilters,core]
MOV [clearfilterrow,core_user], [clearfilterrow,core]
MOV [clearfilters,core_user], [clearfilters,core]
MOV [filtersetmatchdescription,core_user], [filtersetmatchdescription,core]
MOV [filterrowlegend,core_user], [filterrowlegend,core]
MOV [filtertype,core_user], [filtertype,core]
MOV [match,core_user], [match,core]
MOV [matchofthefollowing,core_user], [matchofthefollowing,core]
MOV [placeholdertypeorselect,core_user], [placeholdertypeorselect,core]
MOV [selectfiltertype,core_user], [selectfiltertype,core]
AMOS END
Custom profile fields allow for shortnames containing mixed character
casing, which should also be supported within the user fields API
when retrieving said custom fields.
Given that the DML libs convert all selected columns to lowercased
equivalent, we need to do the same when requesting custom fields to
ensure calling code doesn't try to access `->profile_field_Foo`
property when the DB returns `->profile_field_foo` instead.
The purpose of this external function is to provide data for
asynchronous user selectors and similar widgets. It allows to search
users matching the given query in their name or other available identity
fields.