MDL-27171 messages: fix static variable filtering bug in get_message_processors
Static $processors should contain the full list of processors only, when filtering is required, the $processors variable should not be updated. Lambda function refactoring is made as well. Signed-off-by: Ruslan Kabalin <[email protected]>
This commit is contained in:
+8
-2
@@ -2286,8 +2286,14 @@ function get_message_processors($ready = false) {
|
||||
}
|
||||
}
|
||||
if ($ready) {
|
||||
// Filter out enabled, available and system_configured processors only.
|
||||
$processors = array_filter($processors, create_function('$a', 'return $a->enabled && $a->configured;'));
|
||||
// Filter out enabled and system_configured processors
|
||||
$readyprocessors = $processors;
|
||||
foreach ($readyprocessors as $readyprocessor) {
|
||||
if (!($readyprocessor->enabled && $readyprocessor->configured)) {
|
||||
unset($readyprocessors[$readyprocessor->name]);
|
||||
}
|
||||
}
|
||||
return $readyprocessors;
|
||||
}
|
||||
|
||||
return $processors;
|
||||
|
||||
Reference in New Issue
Block a user