]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #7342 from MrPetovan/bug/fatal-errors
authorMichael Vogel <icarus@dabo.de>
Sat, 6 Jul 2019 06:16:06 +0000 (08:16 +0200)
committerGitHub <noreply@github.com>
Sat, 6 Jul 2019 06:16:06 +0000 (08:16 +0200)
Ensure $link_item variable type when calling get_responses() in mod/photos

mod/photos.php

index b904abe311da1f428c22182dd36b89b6a6033430..8b8402847fea7f18eacbe25850ebbad4af1891e2 100644 (file)
@@ -1320,6 +1320,7 @@ function photos_content(App $a)
 
                if (DBA::isResult($linked_items)) {
                        // This is a workaround to not being forced to rewrite the while $sql_extra handling
+                       // @TODO: On old photo items without a matching thread record, this sets $link_item to false
                        $link_item = Item::selectFirst([], ['id' => $linked_items[0]['id']]);
 
                        $condition = ["`parent` = ? AND `parent` != `id`",  $link_item['parent']];
@@ -1538,7 +1539,7 @@ function photos_content(App $a)
                        }
                        $response_verbs = ['like'];
                        $response_verbs[] = 'dislike';
-                       $responses = get_responses($conv_responses, $response_verbs, $link_item);
+                       $responses = get_responses($conv_responses, $response_verbs, $link_item ?: []);
 
                        $paginate = $pager->renderFull($total);
                }