Skip to content
Snippets Groups Projects
Commit 853987cf authored by Thomas Hackl's avatar Thomas Hackl
Browse files

bugfix: correctly handle empty IGNORE_SUBJECT_IDS

parent 00bc195f
Branches
Tags v2.14.1
No related merge requests found
...@@ -767,7 +767,7 @@ class MessageController extends AuthenticatedController { ...@@ -767,7 +767,7 @@ class MessageController extends AuthenticatedController {
dgettext('garuda', 'Ihre Nachricht an %u Personen wurde gespeichert.'), dgettext('garuda', 'Ihre Nachricht an %u Personen wurde gespeichert.'),
count($this->flash['users']))); count($this->flash['users'])));
} else { } else {
PageLayout::postSuccess(sprintf( PageLayout::postError(sprintf(
dgettext('garuda', 'Ihre Nachricht an %u Personen konnte nicht gespeichert werden.'), dgettext('garuda', 'Ihre Nachricht an %u Personen konnte nicht gespeichert werden.'),
count($this->flash['users']))); count($this->flash['users'])));
} }
......
...@@ -256,7 +256,7 @@ class GarudaModel { ...@@ -256,7 +256,7 @@ class GarudaModel {
JOIN `auth_user_md5` a USING (`user_id`) JOIN `auth_user_md5` a USING (`user_id`)
WHERE s.`fach_id` NOT IN (:ignored) WHERE s.`fach_id` NOT IN (:ignored)
AND a.`visible` != 'never'", AND a.`visible` != 'never'",
['ignored' => Config::get()->GARUDA_IGNORE_SUBJECT_IDS] ['ignored' => Config::get()->GARUDA_IGNORE_SUBJECT_IDS ?: ['']]
); );
} else { } else {
$query = "SELECT DISTINCT `user_id` FROM `user_studiengang`"; $query = "SELECT DISTINCT `user_id` FROM `user_studiengang`";
...@@ -273,15 +273,13 @@ class GarudaModel { ...@@ -273,15 +273,13 @@ class GarudaModel {
$parameters[] = $entry['fach_id']; $parameters[] = $entry['fach_id'];
} }
$where .= " AND `fach_id` NOT IN (?)"; $where .= " AND `fach_id` NOT IN (?)";
$parameters[] = Config::get()->GARUDA_IGNORE_SUBJECT_IDS; $parameters[] = Config::get()->GARUDA_IGNORE_SUBJECT_IDS ?: [''];
$query .= $where; $query .= $where;
return DBManager::get()->fetchFirst($query, $parameters); return DBManager::get()->fetchFirst($query, $parameters);
} else { } else {
return []; return [];
} }
return DBManager::get()->fetchFirst($query, $parameters);
} }
return array();
} }
public static function getAllEmployees($userId, $config) public static function getAllEmployees($userId, $config)
......
pluginname=Garuda pluginname=Garuda
pluginclassname=GarudaPlugin pluginclassname=GarudaPlugin
origin=intelec origin=intelec
version=2.14 version=2.14.1
description=Allows mail sending to selectable target audiences. description=Allows mail sending to selectable target audiences.
studipMinVersion=5.3 studipMinVersion=5.3
studipMaxVersion=5.9.99 studipMaxVersion=5.9.99
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment