From 477ff83eadf4118e8a5531fff7a6b6043e824fd1 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 7 Dec 2017 13:30:55 +0100 Subject: [locationinfo] Fix handling of invalid backends, remove dummy-backend in production --- modules-available/locationinfo/api.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules-available/locationinfo/api.inc.php') 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']); -- cgit v1.2.3-55-g7522