Quantcast
Channel: Web services
Viewing all articles
Browse latest Browse all 2364

Issue with API endpoint after moodle security updates

$
0
0
by Walter Pabis.  

we recently applied moodle security patches to Moodle 4.5.4 (Build: 20250502) from Moodle 4.5.1 (both on php 8.1)

In doing so this seems to have broken our API module we built for bringing in course enrollments from our SIS

the following error message comes up when viewing the web services/external services/functions of of the web service:

Exception - Class "external_api" not found

stacktrace:

  • line 17 of /local/attendance/externallib.php: Error thrown
  • line 75 of /lib/external/classes/external_api.php: call to require_once()
  • line 217 of /webservice/renderer.php: call to core_external\external_api::external_function_info()
  • line 123 of /admin/webservice/service_functions.php: call to core_webservice_renderer->admin_service_function_list()

I went down this rabbit hole: Github link to Moodle issue 2338

as the error was similar and when adding the line to the local plugins externallib.php:

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

the error becomes:

Exception - call_user_func(): Argument #1 ($callback) must be a valid callback, non-static method local_attendance_external::get_attendance_for_course_parameters() cannot be called statically

stack trace:

  • line 110 of /lib/external/classes/external_api.php: TypeError thrown
  • line 110 of /lib/external/classes/external_api.php: call to call_user_func()
  • line 217 of /webservice/renderer.php: call to core_external\external_api::external_function_info()
  • line 123 of /admin/webservice/service_functions.php: call to core_webservice_renderer->admin_service_function_list()

Any advice on how to resolve this issue would be helpful, thank you.


Viewing all articles
Browse latest Browse all 2364

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>