Skip to content

Commit

Permalink
fix: core function calls and ensure they are defined
Browse files Browse the repository at this point in the history
  • Loading branch information
keevan committed Feb 8, 2024
1 parent f0e87aa commit 78803d8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions classes/local/step/update_user_trait.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

namespace tool_dataflows\local\step;

defined('MOODLE_INTERNAL') || die();

require_once($CFG->dirroot . '/user/lib.php');
require_once($CFG->dirroot . '/user/profile/lib.php');

/**
* Update user using core api
*
Expand Down Expand Up @@ -85,8 +90,8 @@ public function execute($input = null) {
unset($userobject->auth);

// Update user fields using core api.
user_update_user($userobject, false, false);
profile_save_data($userobject);
\user_update_user($userobject, false, false);
\profile_save_data($userobject);

return $input;
}
Expand Down

0 comments on commit 78803d8

Please sign in to comment.