From 6c1e3ad95216fbf9f12ed07bd8c6ae985d5cf27a Mon Sep 17 00:00:00 2001 From: Dmitrii Metelkin Date: Fri, 29 Nov 2024 13:32:13 +1100 Subject: [PATCH] issue #225: fix issue with privacy tests --- classes/steps/actions/webservice_action_step.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/classes/steps/actions/webservice_action_step.php b/classes/steps/actions/webservice_action_step.php index 7eeee3a..f937316 100644 --- a/classes/steps/actions/webservice_action_step.php +++ b/classes/steps/actions/webservice_action_step.php @@ -16,9 +16,7 @@ namespace tool_trigger\steps\actions; -defined('MOODLE_INTERNAL') || die(); - -require_once($CFG->libdir . '/externallib.php'); +use core_external\external_api; /** * Webservice action step class. @@ -113,7 +111,7 @@ private function run_function() { $params = $this->render_datafields($this->params); // Execute the provided function name passing with the given parameters. - $response = \external_api::call_external_function($functionname, json_decode($params, true)); + $response = external_api::call_external_function($functionname, json_decode($params, true)); return $response; } @@ -248,7 +246,7 @@ public function form_validation($data, $files) { if (!empty($data['functionname'])) { try { $errorfield = 'functionname'; - $function = \external_api::external_function_info($data['functionname']); + $function = external_api::external_function_info($data['functionname']); $errorfield = 'params'; @@ -276,7 +274,7 @@ public function form_validation($data, $files) { } // Execute the provided function name passing with the given parameters. - // $response = \external_api::call_external_function($functionname, json_decode($params, true)); + // $response = external_api::call_external_function($functionname, json_decode($params, true)); // Check if the provided function parameters are valid. call_user_func( [$function->classname, 'validate_parameters'],