1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-03-12 12:24:50 +01:00

(stable) Fix Phriction rendering for initial install and 404 pages

Summary:
Depends on D19682. Ref T13202. We currently fatal when trying to render a timeline if:

  - an install is fresh, so there are no pages yet, and you look at "/w/"; or
  - you're looking at a Phriction page which doesn't exist (yet) like "/w/aadsflknadsflnf/".

Rendering a timeline and comment area doesn't make sense in these cases, so don't render them.

Test Plan: Hit both cases described above, got "new/empty page" prompts instead of fatals.

Reviewers: amckinley

Maniphest Tasks: T13202

Differential Revision: https://secure.phabricator.com/D19683
This commit is contained in:
epriestley 2018-09-17 15:16:00 -07:00
parent f2d9d93626
commit 8ab7859d85

View file

@ -377,6 +377,7 @@ final class PhrictionDocumentController
$page_content->setCurtain($curtain);
}
if ($document->getPHID()) {
$timeline = $this->buildTransactionTimeline(
$document,
new PhrictionTransactionQuery());
@ -387,6 +388,10 @@ final class PhrictionDocumentController
$comment_view = $edit_engine
->buildEditEngineCommentView($document);
} else {
$timeline = null;
$comment_view = null;
}
return $this->newPage()
->setTitle($page_title)