Merge pull request #12208 from MrPetovan/bug/12059-display-not-found

Improve error message when conversation isn't available in Module\Item\Display
This commit is contained in:
Philipp 2022-11-19 19:59:40 +01:00 committed by GitHub
commit 5a2a8db21f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 6 deletions

View File

@ -136,7 +136,7 @@ class Display extends BaseModule
} }
if ($item['gravity'] != Item::GRAVITY_PARENT) { if ($item['gravity'] != Item::GRAVITY_PARENT) {
$parent = Post::selectFirstForUser($itemUid, $fields, [ $parent = Post::selectFirst($fields, [
'uid' => [0, $itemUid], 'uid' => [0, $itemUid],
'uri-id' => $item['parent-uri-id'] 'uri-id' => $item['parent-uri-id']
], ['order' => ['uid' => true]]); ], ['order' => ['uid' => true]]);
@ -249,7 +249,15 @@ class Display extends BaseModule
$item = Post::selectFirstForUser($pageUid, $fields, $condition); $item = Post::selectFirstForUser($pageUid, $fields, $condition);
if (empty($item)) { if (empty($item)) {
throw new HTTPException\NotFoundException($this->t('The requested item doesn\'t exist or has been deleted.')); $this->page['aside'] = '';
throw new HTTPException\NotFoundException($this->t('Unfortunately, the requested conversation isn\'t available to you.</p>
<p>Possible reasons include:</p>
<ul>
<li>The top-level post isn\'t visible.</li>
<li>The top-level post was deleted.</li>
<li>The node has blocked the top-level author or the author of the shared post.</li>
<li>You have ignored or blocked the top-level author or the author of the shared post.</li>
</ul><p>'));
} }
$item['uri-id'] = $item['parent-uri-id']; $item['uri-id'] = $item['parent-uri-id'];

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 2022.12-dev\n" "Project-Id-Version: 2022.12-dev\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-11-19 07:52-0500\n" "POT-Creation-Date: 2022-11-19 12:01-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -7089,11 +7089,24 @@ msgid ""
"<a href=\"/settings/display\">Theme Customization settings</a>." "<a href=\"/settings/display\">Theme Customization settings</a>."
msgstr "" msgstr ""
#: src/Module/Item/Display.php:135 src/Module/Item/Display.php:252 #: src/Module/Item/Display.php:135 src/Module/Update/Display.php:55
#: src/Module/Update/Display.php:55
msgid "The requested item doesn't exist or has been deleted." msgid "The requested item doesn't exist or has been deleted."
msgstr "" msgstr ""
#: src/Module/Item/Display.php:253
msgid ""
"Unfortunately, the requested conversation isn't available to you.</p>\n"
"<p>Possible reasons include:</p>\n"
"<ul>\n"
"\t<li>The top-level post isn't visible.</li>\n"
"\t<li>The top-level post was deleted.</li>\n"
"\t<li>The node has blocked the top-level author or the author of the shared "
"post.</li>\n"
"\t<li>You have ignored or blocked the top-level author or the author of the "
"shared post.</li>\n"
"</ul><p>"
msgstr ""
#: src/Module/Item/Feed.php:86 #: src/Module/Item/Feed.php:86
msgid "The feed for this item is unavailable." msgid "The feed for this item is unavailable."
msgstr "" msgstr ""

View File

@ -1,7 +1,7 @@
<div id="exception" class="generic-page-wrapper"> <div id="exception" class="generic-page-wrapper">
<img class="hare" src="images/friendica-404_svg_flexy-o-hare.png"/> <img class="hare" src="images/friendica-404_svg_flexy-o-hare.png"/>
<h1>{{$title}}</h1> <h1>{{$title}}</h1>
<p>{{$message}}</p> <p>{{$message nofilter}}</p>
{{if $thrown}} {{if $thrown}}
<pre>{{$thrown}} <pre>{{$thrown}}
{{$stack_trace}} {{$stack_trace}}