From de9a0806d5345a9b24b76b9113c4b563aed8d9e6 Mon Sep 17 00:00:00 2001 From: Sergey Mosin Date: Sat, 23 Nov 2024 11:20:54 -0500 Subject: [PATCH] fix: Internal Server Error: fastQuery returns Postgresql blob as resource instead of string - #563 --- lib/Backend/BCSabreImpl.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Backend/BCSabreImpl.php b/lib/Backend/BCSabreImpl.php index 23264cdd..df135b67 100644 --- a/lib/Backend/BCSabreImpl.php +++ b/lib/Backend/BCSabreImpl.php @@ -1346,10 +1346,15 @@ private function fastQuery(array $calIds, int $startTs, int $endTs, array $propF if (empty($additionalColumns)) { while ($row = $result->fetch()) { - yield $row['calendardata']; + $cdata = $row['calendardata']; + yield is_resource($cdata) ? stream_get_contents($cdata) : $cdata; } } else { while ($row = $result->fetch()) { + $cdata = $row['calendardata']; + if (is_resource($cdata)) { + $row['calendardata'] = stream_get_contents($cdata); + } yield $row; } }