-
Bug
-
Resolution: Fixed
-
Minor
-
3.8.4, 3.8.5
-
MOODLE_38_STABLE
-
MOODLE_38_STABLE, MOODLE_39_STABLE
-
MDL-69663-master -
The override_webservice_execution callback is broken if there are multiple implementors in different types of plugin.
Specifically the problem is this code:
foreach ($callbacks as $plugintype => $plugins) {
|
foreach ($plugins as $plugin => $callback) {
|
$result = $callback($externalfunctioninfo, $params);
|
if ($result !== false) {
|
break;
|
}
|
}
|
}
|
Note that the 'break' line only breaks out of the inner loop.
An example scenario is:
- A theme implements a callback function, checks the function name is core_xxx, if so does something, if not returns false
- A local plugin implements a callback function, checks the function name is core_yyy, if so does something, if not returns false
- Webservice call occurs with function core_xxx. The theme callback returns a modified result, but the code then goes on to call the local plugin which returns false, and therefore the 'original' standard function call is used.