From 666da6e11db6f41b5362822018a962126c515c88 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sun, 16 Apr 2023 13:47:49 -0700 Subject: [PATCH] tq: check categoryid exists (fix #572) Signed-off-by: Varun Patil --- lib/Db/TimelineQueryDays.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/Db/TimelineQueryDays.php b/lib/Db/TimelineQueryDays.php index 09e448a6..8d73222c 100644 --- a/lib/Db/TimelineQueryDays.php +++ b/lib/Db/TimelineQueryDays.php @@ -209,17 +209,21 @@ trait TimelineQueryDays $row['dayid'] = (int) $row['dayid']; $row['w'] = (int) $row['w']; $row['h'] = (int) $row['h']; + + // Optional fields if (!$row['isvideo']) { unset($row['isvideo'], $row['video_duration']); } - if ($row['categoryid']) { - $row['isfavorite'] = 1; - } - unset($row['categoryid']); if (!$row['liveid']) { unset($row['liveid']); } + // Favorite field, may not be present + if (\array_key_exists('categoryid', $row) && $row['categoryid']) { + $row['isfavorite'] = 1; + } + unset($row['categoryid']); + // All cluster transformations ClustersBackend\Manager::applyDayPostTransforms($this->request, $row);