@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 HTTP 400 / 500 errors in Pholio

Summary:
Ref T2650. Possible fix for that issue.

- "Passthru" got renamed to "passthrough" but a site was missed.
- Don't try to post an empty comment if the text is empty but we have inlines; this avoids popping a "you can't post an empty comment" error.

Test Plan: Made an empty comment with an inline in Pholio.

Reviewers: chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T2650

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

+12 -9
+1 -1
src/aphront/AphrontRequest.php
··· 372 372 * @return dict<string, string> Original request parameters. 373 373 */ 374 374 public function getPassthroughRequestParameters() { 375 - return self::flattenData($this->getPassthruRequestData()); 375 + return self::flattenData($this->getPassthroughRequestData()); 376 376 } 377 377 378 378 /**
+11 -8
src/applications/pholio/controller/PholioMockCommentController.php
··· 44 44 )); 45 45 46 46 $xactions = array(); 47 - $xactions[] = id(new PholioTransaction()) 48 - ->setTransactionType(PhabricatorTransactions::TYPE_COMMENT) 49 - ->attachComment( 50 - id(new PholioTransactionComment()) 51 - ->setContent($comment)); 52 47 53 - $inlineComments = id(new PholioTransactionComment())->loadAllWhere( 48 + $inline_comments = id(new PholioTransactionComment())->loadAllWhere( 54 49 'authorphid = %s AND transactionphid IS NULL AND imageid IN (%Ld)', 55 50 $user->getPHID(), 56 51 mpull($mock->getImages(), 'getID')); 57 52 58 - foreach ($inlineComments as $inlineComment) { 53 + if (!$inline_comments || strlen($comment)) { 54 + $xactions[] = id(new PholioTransaction()) 55 + ->setTransactionType(PhabricatorTransactions::TYPE_COMMENT) 56 + ->attachComment( 57 + id(new PholioTransactionComment()) 58 + ->setContent($comment)); 59 + } 60 + 61 + foreach ($inline_comments as $inline_comment) { 59 62 $xactions[] = id(new PholioTransaction()) 60 63 ->setTransactionType(PholioTransactionType::TYPE_INLINE) 61 - ->attachComment($inlineComment); 64 + ->attachComment($inline_comment); 62 65 } 63 66 64 67 $editor = id(new PholioMockEditor())