@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.

Replace "loadDraftComments()" with a Query

Summary: Ref T13513. Take another step toward coherent query pathways for inlines.

Test Plan:
- Created, previewed, and submitted inlines in Diffusion.
- Got a (mostly) appropriate draft state.
- Got proper comment peristence, preview behavior, and submission behavior.

Maniphest Tasks: T13513

Differential Revision: https://secure.phabricator.com/D21229

+11 -29
-21
src/applications/audit/storage/PhabricatorAuditInlineComment.php
··· 55 55 return head(self::buildProxies($inlines)); 56 56 } 57 57 58 - public static function loadDraftComments( 59 - PhabricatorUser $viewer, 60 - $commit_phid, 61 - $raw = false) { 62 - 63 - $inlines = id(new DiffusionDiffInlineCommentQuery()) 64 - ->setViewer($viewer) 65 - ->withAuthorPHIDs(array($viewer->getPHID())) 66 - ->withCommitPHIDs(array($commit_phid)) 67 - ->withHasTransaction(false) 68 - ->withIsDeleted(false) 69 - ->needReplyToComments(true) 70 - ->execute(); 71 - 72 - if ($raw) { 73 - return $inlines; 74 - } 75 - 76 - return self::buildProxies($inlines); 77 - } 78 - 79 58 public static function loadPublishedComments( 80 59 PhabricatorUser $viewer, 81 60 $commit_phid) {
+6 -4
src/applications/diffusion/editor/DiffusionCommitEditEngine.php
··· 128 128 $viewer = $this->getViewer(); 129 129 $xactions = array(); 130 130 131 - $inlines = PhabricatorAuditInlineComment::loadDraftComments( 132 - $viewer, 133 - $object->getPHID(), 134 - $raw = true); 131 + $inlines = id(new DiffusionDiffInlineCommentQuery()) 132 + ->setViewer($viewer) 133 + ->withObjectPHIDs(array($object->getPHID())) 134 + ->withPublishableComments(true) 135 + ->needReplyToComments(true) 136 + ->execute(); 135 137 $inlines = msort($inlines, 'getID'); 136 138 137 139 $editor = $object->getApplicationTransactionEditor()
+5 -4
src/applications/diffusion/engine/DiffusionCommitDraftEngine.php
··· 7 7 $viewer = $this->getViewer(); 8 8 $commit = $this->getObject(); 9 9 10 - $inlines = PhabricatorAuditInlineComment::loadDraftComments( 11 - $viewer, 12 - $commit->getPHID(), 13 - $raw = true); 10 + $inlines = id(new DiffusionDiffInlineCommentQuery()) 11 + ->setViewer($viewer) 12 + ->withCommitPHIDs(array($commit->getPHID())) 13 + ->withPublishableComments(true) 14 + ->execute(); 14 15 15 16 return (bool)$inlines; 16 17 }