-
Bug
-
Resolution: Fixed
-
Minor
-
3.3.2, 3.4, 3.5
-
MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
-
MOODLE_33_STABLE, MOODLE_34_STABLE
-
MDL-60738-master -
This is a typical problem in the mobile app that needs addressing.
Sometimes the "theme" and "lang" fields in the user and course tables in the database are set to incorrect values (uninstalled or non-existent themes and language packs). This makes Web Services functions to fail because the WS server validate the returned data using the validate_param function that clean parameters.
Typical error is:
{"exception":"invalid_response_exception","errorcode":"invalidresponse","message":"Invalid response value v\u00e1lido","debuginfo":"theme => Invalid response value: Invalid external api response: the value is \"binarius\", the server was expecting \"theme\" type" }It usually happens in sites upgraded from old Moodle sites where themes or language packs were uninstalled or in sites where some data (like user profile fields) is sync with external systems (LDAP or database).
The only way to fix this is not trusting the data coming from DB and clean the theme and lang parameters before they are returned by the WS (so the validate_param function doesn't throw an exception)