From: Hypolite Petovan Date: Fri, 5 Jul 2019 17:40:33 +0000 (-0400) Subject: Ensure $link_item variable type when calling get_responses() in mod/photos X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f92752c9b481cf7bad9cded6cd9e2a3dd56a873c;p=friendica.git Ensure $link_item variable type when calling get_responses() in mod/photos - Addresses https://github.com/friendica/friendica/issues/7297#issuecomment-508622668 --- diff --git a/mod/photos.php b/mod/photos.php index b904abe311..8b8402847f 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -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); }