Skip to content

Commit

Permalink
Fix notices
Browse files Browse the repository at this point in the history
  • Loading branch information
annando committed Apr 10, 2021
1 parent 43c6563 commit 5d61599
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 7 additions & 5 deletions mod/display.php
Expand Up @@ -188,12 +188,14 @@ function display_content(App $a, $update = false, $update_uid = 0)
if ($update) {
$uri_id = $_REQUEST['uri_id'];
$item = Post::selectFirst(['uid', 'parent-uri-id'], ['uri-id' => $uri_id, 'uid' => $update_uid]);
if ($item['uid'] != 0) {
$a->profile = ['uid' => intval($item['uid'])];
} else {
$a->profile = ['uid' => intval($update_uid)];
if (!empty($item)) {
if ($item['uid'] != 0) {
$a->profile = ['uid' => intval($item['uid'])];
} else {
$a->profile = ['uid' => intval($update_uid)];
}
$parent_uri_id = $item['parent-uri-id'];
}
$parent_uri_id = $item['parent-uri-id'];
} else {
$uri_id = (($a->argc > 2) ? $a->argv[2] : 0);
$parent_uri_id = $uri_id;
Expand Down
3 changes: 3 additions & 0 deletions src/Module/Conversation/Community.php
Expand Up @@ -359,6 +359,9 @@ private static function selectItems($min_id, $max_id, $item_id, $itemspage)
$r = Post::selectThreadForUser(0, ['uri-id', 'commented', 'author-link'], $condition, $params);

$items = Post::toArray($r);
if (empty($items)) {
return [];
}

// Previous page case: once we get the relevant items closest to min_id, we need to restore the expected display order
if (empty($item_id) && isset($min_id) && !isset($max_id)) {
Expand Down

0 comments on commit 5d61599

Please sign in to comment.