]> git.mxchange.org Git - friendica.git/commitdiff
Fix https://github.com/friendica/friendica/issues/12486#issuecomment-1368540088
authorPhilipp <admin@philipp.info>
Sun, 1 Jan 2023 21:34:01 +0000 (22:34 +0100)
committerPhilipp <admin@philipp.info>
Sun, 1 Jan 2023 21:34:01 +0000 (22:34 +0100)
mod/photos.php

index 36d97bdfcd4002fbf4a4e62ec5e060b3c309d326..a1aebfac6686f1ee59d1edd002c8c5319b883404 100644 (file)
@@ -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 = [];