@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+13 -8
+13 -8
src/applications/phriction/controller/PhrictionDocumentController.php
··· 377 377 $page_content->setCurtain($curtain); 378 378 } 379 379 380 - $timeline = $this->buildTransactionTimeline( 381 - $document, 382 - new PhrictionTransactionQuery()); 380 + if ($document->getPHID()) { 381 + $timeline = $this->buildTransactionTimeline( 382 + $document, 383 + new PhrictionTransactionQuery()); 383 384 384 - $edit_engine = id(new PhrictionDocumentEditEngine()) 385 - ->setViewer($viewer) 386 - ->setTargetObject($document); 385 + $edit_engine = id(new PhrictionDocumentEditEngine()) 386 + ->setViewer($viewer) 387 + ->setTargetObject($document); 387 388 388 - $comment_view = $edit_engine 389 - ->buildEditEngineCommentView($document); 389 + $comment_view = $edit_engine 390 + ->buildEditEngineCommentView($document); 391 + } else { 392 + $timeline = null; 393 + $comment_view = null; 394 + } 390 395 391 396 return $this->newPage() 392 397 ->setTitle($page_title)