diff --git a/src/aphront/AphrontRequest.php b/src/aphront/AphrontRequest.php index 42c80f5f6f..4da973156b 100644 --- a/src/aphront/AphrontRequest.php +++ b/src/aphront/AphrontRequest.php @@ -372,7 +372,7 @@ final class AphrontRequest { * @return dict Original request parameters. */ public function getPassthroughRequestParameters() { - return self::flattenData($this->getPassthruRequestData()); + return self::flattenData($this->getPassthroughRequestData()); } /** diff --git a/src/applications/pholio/controller/PholioMockCommentController.php b/src/applications/pholio/controller/PholioMockCommentController.php index e711a05877..af0b1b6e73 100644 --- a/src/applications/pholio/controller/PholioMockCommentController.php +++ b/src/applications/pholio/controller/PholioMockCommentController.php @@ -44,21 +44,24 @@ final class PholioMockCommentController extends PholioController { )); $xactions = array(); - $xactions[] = id(new PholioTransaction()) - ->setTransactionType(PhabricatorTransactions::TYPE_COMMENT) - ->attachComment( - id(new PholioTransactionComment()) - ->setContent($comment)); - $inlineComments = id(new PholioTransactionComment())->loadAllWhere( + $inline_comments = id(new PholioTransactionComment())->loadAllWhere( 'authorphid = %s AND transactionphid IS NULL AND imageid IN (%Ld)', $user->getPHID(), mpull($mock->getImages(), 'getID')); - foreach ($inlineComments as $inlineComment) { + if (!$inline_comments || strlen($comment)) { + $xactions[] = id(new PholioTransaction()) + ->setTransactionType(PhabricatorTransactions::TYPE_COMMENT) + ->attachComment( + id(new PholioTransactionComment()) + ->setContent($comment)); + } + + foreach ($inline_comments as $inline_comment) { $xactions[] = id(new PholioTransaction()) ->setTransactionType(PholioTransactionType::TYPE_INLINE) - ->attachComment($inlineComment); + ->attachComment($inline_comment); } $editor = id(new PholioMockEditor())