From f8f3689a0d7fa0c2ed886646dde8d284233e923f Mon Sep 17 00:00:00 2001 From: Philipp Date: Sun, 1 Jan 2023 22:34:01 +0100 Subject: [PATCH] Fix https://github.com/friendica/friendica/issues/12486#issuecomment-1368540088 --- mod/photos.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/photos.php b/mod/photos.php index 36d97bdfcd..a1aebfac66 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -31,6 +31,7 @@ use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\Core\System; use Friendica\Database\DBA; +use Friendica\Database\DBStructure; use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\Item; @@ -923,7 +924,7 @@ function photos_content(App $a) if ($order_field === 'created') { $params = ['order' => [$order_field]]; - } elseif (!empty($order_field)) { + } elseif (!empty($order_field) && DBStructure::existsColumn('photo', [$order_field])) { $params = ['order' => [$order_field => true]]; } else { $params = [];