Merge pull request #10843 from annando/issue-10837
Issue 10837: Display the public item when the personal one does not exist
This commit is contained in:
commit
ba511c3b52
|
@ -173,7 +173,7 @@ function display_content(App $a, $update = false, $update_uid = 0)
|
||||||
|
|
||||||
if ($update) {
|
if ($update) {
|
||||||
$uri_id = $_REQUEST['uri_id'];
|
$uri_id = $_REQUEST['uri_id'];
|
||||||
$item = Post::selectFirst(['uid', 'parent-uri-id'], ['uri-id' => $uri_id, 'uid' => [0, $update_uid]]);
|
$item = Post::selectFirst(['uid', 'parent-uri-id'], ['uri-id' => $uri_id, 'uid' => [0, $update_uid]], ['order' => ['uid' => true]]);
|
||||||
if (!empty($item)) {
|
if (!empty($item)) {
|
||||||
if ($item['uid'] != 0) {
|
if ($item['uid'] != 0) {
|
||||||
$a->setProfileOwner($item['uid']);
|
$a->setProfileOwner($item['uid']);
|
||||||
|
@ -190,8 +190,8 @@ function display_content(App $a, $update = false, $update_uid = 0)
|
||||||
$fields = ['uri-id', 'parent-uri-id', 'uid'];
|
$fields = ['uri-id', 'parent-uri-id', 'uid'];
|
||||||
|
|
||||||
if (local_user()) {
|
if (local_user()) {
|
||||||
$condition = ['guid' => DI::args()->getArgv()[1], 'uid' => local_user()];
|
$condition = ['guid' => DI::args()->getArgv()[1], 'uid' => [0, local_user()]];
|
||||||
$item = Post::selectFirstForUser(local_user(), $fields, $condition);
|
$item = Post::selectFirstForUser(local_user(), $fields, $condition, ['order' => ['uid' => true]]);
|
||||||
if (DBA::isResult($item)) {
|
if (DBA::isResult($item)) {
|
||||||
$uri_id = $item['uri-id'];
|
$uri_id = $item['uri-id'];
|
||||||
$parent_uri_id = $item['parent-uri-id'];
|
$parent_uri_id = $item['parent-uri-id'];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user