-
Bug
-
Resolution: Fixed
-
Minor
-
4.1.4, 4.2
-
MOODLE_401_STABLE, MOODLE_402_STABLE
-
MOODLE_401_STABLE, MOODLE_402_STABLE
-
MDL-78872-401 -
Found on another issue:
$ git grep "protected static function execute"
|
grade/classes/external/get_groups_for_search_widget.php: protected static function execute(int $courseid, string $actionbaseurl): array {
|
grade/classes/external/get_groups_for_selector.php: protected static function execute(int $courseid): array {
|
grade/report/grader/classes/external/get_users_in_report.php: protected static function execute(int $courseid): array {
|
The problem is that each method adds itself to the Moodle mobile service, but is impossible to actually call due to the method visibility:
$ curl --silent "http://localhost:8000/webservice/rest/server.php?moodlewsrestformat=json" --data "wstoken=7e5286681acdad9312994c188ec92766&wsfunction=gradereport_grader_get_users_in_report&courseid=2" | python -m "json.tool"
|
{
|
"exception": "TypeError",
|
"message": "call_user_func_array(): Argument #1 ($callback) must be a valid callback, cannot access protected method gradereport_grader\\external\\get_users_in_report::execute()"
|
}
|
We should fix that
https://github.com/moodle/moodle/blob/a1d5d1b2f758a3178bff4c42883a477f4b1ea50c/lib/db/services.php#L980-L995
https://github.com/moodle/moodle/blob/a1d5d1b2f758a3178bff4c42883a477f4b1ea50c/grade/report/grader/db/services.php#L35