-
Bug
-
Resolution: Fixed
-
Minor
-
4.1.1
We've debugged the issue and the problem is that the enrolment_status() method in /course/classes/reportbuilder/local/formatters/enrolment.php is returning a lang_string object instead of an scalar string
This is not compatible with the current exporter implementation in LMS (that does not treat the case) so the external function tries to return an object instead of the expected PARAM_RAW so it fails
I think there are two possible solutions here (there will be more possibly):
- Change how exporters work to detect this case and treat lang_strings()
- Just apply a quick fix in enrolment_status changing the expected returned type to string (something like)
return $statusvalues[(int) $value] ? ($statusvalues[(int) $value])->out() : null;
STEPS TO REPRODUCE
- Create a new report, using the "Courses" report source
- Add the Enrolment Status column
- Using the mobile app (dev webapp version here https://integration.apps.moodledemo.net/) try to access to the report (you can also just try doing a curl request)
curl 'https://mysite/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_reportbuilder_retrieve_report' --data-raw 'reportid=45&page=0&perpage=20&moodlewssettingfilter=true&moodlewssettingfileurl=true&moodlewssettinglang=en&wsfunction=core_reportbuilder_retrieve_report&wstoken=mytoken'
- is a regression caused by
-
MDL-74364 Custom report source for course participants
-
- Closed
-