1
0
Fork 0

Fix SQL Error if no items where found + Fix setting to null

This commit is contained in:
Jonny Tischbein 2018-11-17 13:22:32 +01:00
commit 56406b9910
2 changed files with 17 additions and 2 deletions

View file

@ -346,7 +346,11 @@ function networkConversation(App $a, $items, Pager $pager, $mode, $update, $orde
// Set this so that the conversation function can find out contact info for our wall-wall items
$a->page_contact = $a->contact;
$items = (empty($items) ? [] : $items);
if (!is_array($items)){
Logger::log("Expecting items to be an array. Got " . print_r($items, true));
$items = [];
}
$o = conversation($a, $items, $pager, $mode, $update, false, $ordering, local_user());
if (!$update) {
@ -390,6 +394,10 @@ function network_content(App $a, $update = 0, $parent = 0)
$o = networkThreadedView($a, $update, $parent);
}
if ($o === ''){
info("No items found");
}
return $o;
}
@ -464,6 +472,9 @@ function networkFlatView(App $a, $update = 0)
}
DBA::close($result);
if (count($posts) == 0){
return '';
}
$condition = ['uid' => local_user(), 'id' => $posts];
} else {
$condition = ['uid' => local_user()];