MDL-44342 Airnotifier: Bug in retrieving user prefs (fixes fail in unit test)

This commit is contained in:
Damyon Wiese 2014-04-10 13:16:40 +08:00
parent 2bb01d13cb
commit 0734383d63

View File

@ -156,12 +156,12 @@ class message_airnotifier_external extends external_api {
// First get forced settings.
if ($forcedpref = get_config('message', $prefname)) {
$prefstocheck = explode(',', $forcedpref);
$prefstocheck = array_merge($prefstocheck, explode(',', $forcedpref));
}
// Then get user settings.
if ($userpref = get_user_preferences($prefname, '', $user->id)) {
$prefstocheck += explode(',', $userpref);
$prefstocheck = array_merge($prefstocheck, explode(',', $userpref));
}
if (in_array('airnotifier', $prefstocheck)) {
@ -212,4 +212,4 @@ class message_airnotifier_external extends external_api {
);
}
}
}