summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2025-07-31 14:38:10 +0200
committerSimon Rettberg2025-07-31 14:38:10 +0200
commit6e55ff13b26f7bb7956b7b3666c92e1fe99f5b67 (patch)
tree66f85b8d2671a49d35376905e13f03cdb0a967ee
parent[locationinfo] Make sure older browsers work by using proper JavaScript (diff)
downloadslx-admin-6e55ff13b26f7bb7956b7b3666c92e1fe99f5b67.tar.gz
slx-admin-6e55ff13b26f7bb7956b7b3666c92e1fe99f5b67.tar.xz
slx-admin-6e55ff13b26f7bb7956b7b3666c92e1fe99f5b67.zip
[locationinfo] Don't fetch ALL calendars when using cache
-rw-r--r--modules-available/locationinfo/inc/locationinfo.inc.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules-available/locationinfo/inc/locationinfo.inc.php b/modules-available/locationinfo/inc/locationinfo.inc.php
index 2da79fcd..1775dce5 100644
--- a/modules-available/locationinfo/inc/locationinfo.inc.php
+++ b/modules-available/locationinfo/inc/locationinfo.inc.php
@@ -372,9 +372,13 @@ class LocationInfo
$resultArray = array();
- if ($deadline !== null && $deadline <= time() + 1) {
+ if ($deadline !== null && $deadline <= time()) {
+ // Deadline in the past, use cached data exclusively
$res = Database::simpleQuery("SELECT locationid, calendar FROM locationinfo_locationconfig
- WHERE Length(calendar) > 10 AND lastcalendarupdate > UNIX_TIMESTAMP() - 86400*3");
+ WHERE Length(calendar) > 10
+ AND lastcalendarupdate > UNIX_TIMESTAMP() - 86400*3
+ AND locationid IN (:lid)",
+ ['lid' => $idList]);
foreach ($res as $row) {
$resultArray[] = [
'id' => (int)$row['locationid'],