From: Hypolite Petovan Date: Tue, 18 Jul 2023 02:55:46 +0000 (-0400) Subject: Fix DisplayNotFound page X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=63f5d94a02cda0fde6d8d494314d02b4e634f51f;p=friendica.git Fix DisplayNotFound page - Add another condition earlier in Module\Item\Display - Separate reasons in individual translation strings --- diff --git a/src/Module/Item/Display.php b/src/Module/Item/Display.php index 21046628fe..714598a8e6 100644 --- a/src/Module/Item/Display.php +++ b/src/Module/Item/Display.php @@ -133,7 +133,9 @@ class Display extends BaseModule } if (empty($item)) { - throw new HTTPException\NotFoundException($this->t('The requested item doesn\'t exist or has been deleted.')); + $this->page['aside'] = ''; + $displayNotFound = new DisplayNotFound($this->l10n, $this->baseUrl, $this->args, $this->logger, $this->profiler, $this->response, $this->server, $this->parameters); + return $displayNotFound->content(); } if ($item['gravity'] != Item::GRAVITY_PARENT) { diff --git a/src/Module/Special/DisplayNotFound.php b/src/Module/Special/DisplayNotFound.php index d66ececdd0..009c3241f9 100644 --- a/src/Module/Special/DisplayNotFound.php +++ b/src/Module/Special/DisplayNotFound.php @@ -31,18 +31,20 @@ class DisplayNotFound extends \Friendica\BaseModule { protected function content(array $request = []): string { + $reasons = [ + $this->t("The top-level post isn't visible."), + $this->t('The top-level post was deleted.'), + $this->t('This node has blocked the top-level author or the author of the shared post.'), + $this->t('You have ignored or blocked the top-level author or the author of the shared post.'), + ]; + $tpl = Renderer::getMarkupTemplate('special/displaynotfound.tpl'); return Renderer::replaceMacros($tpl, [ '$l10n' => [ - 'title' => $this->t('Not Found'), - 'message' => $this->t("

Unfortunately, the requested conversation isn't available to you.

-

Possible reasons include:

-"), + 'title' => $this->t('Conversation Not Found'), + 'desc1' => $this->t("Unfortunately, the requested conversation isn't available to you."), + 'desc2' => $this->t('Possible reasons include:'), + 'reasons' => $reasons, ] ]); } diff --git a/view/templates/special/displaynotfound.tpl b/view/templates/special/displaynotfound.tpl index 48e7b5166d..a690f87c4d 100644 --- a/view/templates/special/displaynotfound.tpl +++ b/view/templates/special/displaynotfound.tpl @@ -1,5 +1,11 @@
-

{{$title}}

- {{$message nofilter}} +

{{$l10n.title}}

+

{{$l10n.desc1}}

+

{{$l10n.desc2}}

+