There were existing places each doing its own checks similar to the ones
covered by the newly added core_user::awaiting_action() method. This
patch replaces those custom checks with this new API call.
The external function 'core_user_update_users()' always returned 'null' no matter
if a user or users were successfully updated or there were some failures.
So, there was no way for the caller to know which users were updated and which were not.
After the commit changes the function returns an 'external_warnings' instance. The function uses
a delegated transaction for each user to update within a loop. This enables the function to update
as many users as possible. This differs from the previous behavior of the function when it used
a delegate transaction outside of the loop where the users were updated. This resulted in a rollback
of the whole users updating in case any of the users had some invalid data. For each user within a loop
a 'try-catch' block is used to throw exceptions which are actually returned
as warnings by the function when they are caught.
It seems that the new phpcs3 checker is now controlling those
line comments that previously were ignored.
This commit just looks for all the cases and bulk-add
them when needed. The bash script (mac) used to add all them is:
while read -r line; do
arr=(${line//:/ })
if [[ -n ${arr[0]} ]] && [[ -n ${arr[1]} ]]; then
echo " file ${arr[0]}, line ${arr[1]}"
sed -i "${arr[1]}s/\$/\./" ${arr[0]}
fi
done < <(find . -name version.php | xargs ag --nomultiline '>(version|requires) *=.*//.*[^;\.]$')
The define_after_data method was looking for a required_param
when it should have been an optional parameter. This was causing
error messages when creating a new datetime field.
Create a new profile field type, move all existing content of the fields
'icq', 'skype', 'aim', 'yahoo', 'msn' and 'url' in the mdl_user table to
theses new profile fields if needed.
AMOS BEGIN
MOV [aimid,core],[aimid,courseimage,profilefield_social]
MOV [yahooid,core],[yahooid,profilefield_social]
MOV [skypeid,core],[skypeid,profilefield_social]
MOV [icqnumber,core],[icqnumber,profilefield_social]
MOV [msnid,core],[msnid,profilefield_social]
MOV [webpage,core],[webpage,profilefield_social]
AMOS END
This class would belong more appropriately within the 'user' API
(core_user) instead of within the 'core' API, since it is
directly related to user data.
Since the class has only just been added to Moodle, now is a good
time to move it.
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.