1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-03-20 16:20:09 +01:00

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
This commit is contained in:
epriestley 2013-03-05 13:23:56 -08:00
parent bd6bb8a3ea
commit aab0fb0e74
2 changed files with 12 additions and 9 deletions

View file

@ -372,7 +372,7 @@ final class AphrontRequest {
* @return dict<string, string> Original request parameters. * @return dict<string, string> Original request parameters.
*/ */
public function getPassthroughRequestParameters() { public function getPassthroughRequestParameters() {
return self::flattenData($this->getPassthruRequestData()); return self::flattenData($this->getPassthroughRequestData());
} }
/** /**

View file

@ -44,21 +44,24 @@ final class PholioMockCommentController extends PholioController {
)); ));
$xactions = array(); $xactions = array();
$inline_comments = id(new PholioTransactionComment())->loadAllWhere(
'authorphid = %s AND transactionphid IS NULL AND imageid IN (%Ld)',
$user->getPHID(),
mpull($mock->getImages(), 'getID'));
if (!$inline_comments || strlen($comment)) {
$xactions[] = id(new PholioTransaction()) $xactions[] = id(new PholioTransaction())
->setTransactionType(PhabricatorTransactions::TYPE_COMMENT) ->setTransactionType(PhabricatorTransactions::TYPE_COMMENT)
->attachComment( ->attachComment(
id(new PholioTransactionComment()) id(new PholioTransactionComment())
->setContent($comment)); ->setContent($comment));
}
$inlineComments = id(new PholioTransactionComment())->loadAllWhere( foreach ($inline_comments as $inline_comment) {
'authorphid = %s AND transactionphid IS NULL AND imageid IN (%Ld)',
$user->getPHID(),
mpull($mock->getImages(), 'getID'));
foreach ($inlineComments as $inlineComment) {
$xactions[] = id(new PholioTransaction()) $xactions[] = id(new PholioTransaction())
->setTransactionType(PholioTransactionType::TYPE_INLINE) ->setTransactionType(PholioTransactionType::TYPE_INLINE)
->attachComment($inlineComment); ->attachComment($inline_comment);
} }
$editor = id(new PholioMockEditor()) $editor = id(new PholioMockEditor())