From 13f868f4f854a5e4514102e2fee687a52e872c35 Mon Sep 17 00:00:00 2001 From: Kevin Pham Date: Thu, 8 Feb 2024 16:43:02 +1100 Subject: [PATCH] fix: core function calls and ensure they are defined --- classes/local/step/update_user_trait.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/classes/local/step/update_user_trait.php b/classes/local/step/update_user_trait.php index e5204263..7611cf86 100644 --- a/classes/local/step/update_user_trait.php +++ b/classes/local/step/update_user_trait.php @@ -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 * @@ -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; }