Merge pull request #10139 from annando/notice

Fix notices
This commit is contained in:
Hypolite Petovan 2021-04-10 12:51:13 -04:00 committed by GitHub
commit dc36d070c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View File

@ -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;

View File

@ -359,6 +359,9 @@ class Community extends BaseModule
$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)) {