Skip to content

Commit 492c1f8

Browse files
authored
Merge pull request #227 from catalyst/issue225-privacy
issue #225: fix issue with privacy tests
2 parents a768e5b + 6c1e3ad commit 492c1f8

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

classes/steps/actions/webservice_action_step.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616

1717
namespace tool_trigger\steps\actions;
1818

19-
defined('MOODLE_INTERNAL') || die();
20-
21-
require_once($CFG->libdir . '/externallib.php');
19+
use core_external\external_api;
2220

2321
/**
2422
* Webservice action step class.
@@ -113,7 +111,7 @@ private function run_function() {
113111
$params = $this->render_datafields($this->params);
114112

115113
// Execute the provided function name passing with the given parameters.
116-
$response = \external_api::call_external_function($functionname, json_decode($params, true));
114+
$response = external_api::call_external_function($functionname, json_decode($params, true));
117115
return $response;
118116
}
119117

@@ -248,7 +246,7 @@ public function form_validation($data, $files) {
248246
if (!empty($data['functionname'])) {
249247
try {
250248
$errorfield = 'functionname';
251-
$function = \external_api::external_function_info($data['functionname']);
249+
$function = external_api::external_function_info($data['functionname']);
252250

253251
$errorfield = 'params';
254252

@@ -276,7 +274,7 @@ public function form_validation($data, $files) {
276274
}
277275

278276
// Execute the provided function name passing with the given parameters.
279-
// $response = \external_api::call_external_function($functionname, json_decode($params, true));
277+
// $response = external_api::call_external_function($functionname, json_decode($params, true));
280278
// Check if the provided function parameters are valid.
281279
call_user_func(
282280
[$function->classname, 'validate_parameters'],

0 commit comments

Comments
 (0)