From aaff04694e089678719618340b1c63a00710599f Mon Sep 17 00:00:00 2001 From: Frederik Milling Pytlick Date: Thu, 12 Dec 2024 09:38:31 +0100 Subject: [PATCH] praxisdigital/moodle-opgaver#528 - Made user profile fields show up no matter field implementation --- classes/steps/lookups/user_lookup_step.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/steps/lookups/user_lookup_step.php b/classes/steps/lookups/user_lookup_step.php index 9f14e85..87ced52 100644 --- a/classes/steps/lookups/user_lookup_step.php +++ b/classes/steps/lookups/user_lookup_step.php @@ -155,7 +155,7 @@ public function execute($step, $trigger, $event, $stepresults) { $stepresults[$this->outputprefix . 'fullname'] = fullname($userdata); // Get custom profile_fields if any. - profile_load_custom_fields($userdata); + $userdata->profile = (array)profile_user_record($userdata->id, false); if (!empty($userdata->profile)) { foreach ($userdata->profile as $shortname => $value) { $stepresults[$this->outputprefix . $shortname] = $value; @@ -214,7 +214,7 @@ public static function get_privacyfields() { * @return array $stepfields The fields this step provides. */ public static function get_fields() { - $customfields = profile_get_custom_fields(true); + $customfields = profile_get_custom_fields(); $customfieldoptions = array_column($customfields, 'shortname', 'shortname'); return self::$stepfields + $customfieldoptions;