-
Improvement
-
Resolution: Fixed
-
Minor
-
4.2
-
MOODLE_402_STABLE
-
MOODLE_403_STABLE
-
At present it is not possible to return NULL from WS method becauseĀ
external_api::clean_returnvalue() does not allow it forĀ single and multiple structure.
This is a problem because in cases such as \core_message_external::get_conversation_between_users() where developers incorrectly throw exception instead of returning NULL indicating that no data was found.
if ($conversation) { |
return $conversation; |
} else { |
// We have to throw an exception here because the external functions annoyingly |
// don't accept null to be returned for a single structure. |
throw new \moodle_exception('errorconversationdoesnotexist', 'message'); |
}
|
At the same time we could optionally allow NULLs in WS parameters instead of single and multiple structure.
This should be fully backwards compatible.
- has a non-specific relationship to
-
MDL-77273 improved behat error detection
-
- Open
-