summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/api.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2017-12-07 13:30:55 +0100
committerSimon Rettberg2017-12-07 13:30:55 +0100
commit477ff83eadf4118e8a5531fff7a6b6043e824fd1 (patch)
tree74a8396964d86831e4d413d30e5f48766ce4083f /modules-available/locationinfo/api.inc.php
parent[sysconfig] Improve UI (diff)
downloadslx-admin-477ff83eadf4118e8a5531fff7a6b6043e824fd1.tar.gz
slx-admin-477ff83eadf4118e8a5531fff7a6b6043e824fd1.tar.xz
slx-admin-477ff83eadf4118e8a5531fff7a6b6043e824fd1.zip
[locationinfo] Fix handling of invalid backends, remove dummy-backend in production
Diffstat (limited to 'modules-available/locationinfo/api.inc.php')
-rw-r--r--modules-available/locationinfo/api.inc.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules-available/locationinfo/api.inc.php b/modules-available/locationinfo/api.inc.php
index a89f16ed..ceaf04c0 100644
--- a/modules-available/locationinfo/api.inc.php
+++ b/modules-available/locationinfo/api.inc.php
@@ -175,10 +175,10 @@ function getCalendar($idList)
foreach ($serverList as $serverid => $server) {
$serverInstance = CourseBackend::getInstance($server['type']);
if ($serverInstance === false) {
- EventLog::warning('Cannot fetch schedule for locationid ' . $server['locationid']
+ EventLog::warning('Cannot fetch schedule for location (' . implode(', ', $server['idlist']) . ')'
. ': Backend type ' . $server['type'] . ' unknown. Disabling location.');
- Database::exec("UPDATE locationinfo_locationconfig SET serverid = 0 WHERE locationid = :lid",
- array('lid' => $server['locationid']));
+ Database::exec("UPDATE locationinfo_locationconfig SET serverid = NULL WHERE locationid IN (:lid)",
+ array('lid' => $server['idlist']));
continue;
}
$credentialsOk = $serverInstance->setCredentials($serverid, $server['credentials']);