MDL-53772 externallib: Fix busted webservices context handling

Fix:
$PAGE->context must be reset when calling validate_context

Improve:
Provide wrapper for calling an external function

The wrapper correctly checks the function parameters and return type against
the description of the external function, and stores the PAGE and COURSE global
state variables, restoring them before the function returns.

Fix: buggy unit tests.

These tests are expecting debugging from a bug that was fixed, and calling web
service functions with no user or session.
This commit is contained in:
Damyon Wiese 2016-04-08 13:01:06 +08:00
parent b611ade3ab
commit 56fa860ead
7 changed files with 258 additions and 164 deletions

View file

@ -3,6 +3,8 @@ information provided here is intended especially for developers.
=== 3.1 ===
* External functions that are not calling external_api::validate_context are buggy and will now generate
exceptions. Previously they were only generating warnings in the webserver error log.
* The moodle/blog:associatecourse and moodle/blog:associatemodule capabilities has been removed.
* The following functions has been finally deprecated and can not be used any more:
- profile_display_badges()