Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/gitdedalo/v6.4.0_beta' int…
Browse files Browse the repository at this point in the history
…o v6.4.0_beta
  • Loading branch information
alex-render committed Jan 2, 2025
2 parents 16ba49f + 950ccaa commit ec1f630
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions core/area_maintenance/class.area_maintenance.php
Original file line number Diff line number Diff line change
Expand Up @@ -1026,27 +1026,35 @@ public static function create_test_record() : object {
* REGISTER_TOOLS
* Alias of tools_register::import_tools
* @return object $response
* {
* result: array|false (on success, list of imported tools objects)
* msg: string
* errors: array
* }
*/
public static function register_tools() : object {

$response = new stdClass();
$response->result = false;
$response->msg = 'Error. Request failed ['.__FUNCTION__.']';

$response->result = tools_register::import_tools();
$response->msg = 'OK. Request done successfully';
// import_tools
$response->result = tools_register::import_tools();

// check results errors
$errors = [];
if (!empty($response->result)) {
foreach ($response->result as $item) {
if (!empty($item->errors)) {
$errors = array_merge($errors, (array)$item->errors);
$errors = [];
if (!empty($response->result)) {
foreach ($response->result as $item) {
if (!empty($item->errors)) {
$errors = array_merge($errors, (array)$item->errors);
}
}
}
$response->msg = 'Warning. Request done with errors';
}
$response->errors = $errors;
$response->errors = $errors;

$response->msg = empty($errors)
? 'OK. Request done successfully'
: 'Warning. Request done with errors';


return $response;
Expand Down

0 comments on commit ec1f630

Please sign in to comment.