mirrored from git://git.moodle.org/moodle.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-69194 user: make core_user_update_users return warnings
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.
- Loading branch information
Showing
2 changed files
with
105 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters