mirror of
https://github.com/moodle/moodle.git
synced 2025-08-02 15:49:43 +02:00
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 <ruslan.kabalin@luns.net.uk>
This commit is contained in:
parent
298925d4d1
commit
72e6af0344
1 changed files with 8 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue