mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-20 08:10: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:
parent
bd6bb8a3ea
commit
aab0fb0e74
2 changed files with 12 additions and 9 deletions
|
@ -372,7 +372,7 @@ final class AphrontRequest {
|
|||
* @return dict<string, string> Original request parameters.
|
||||
*/
|
||||
public function getPassthroughRequestParameters() {
|
||||
return self::flattenData($this->getPassthruRequestData());
|
||||
return self::flattenData($this->getPassthroughRequestData());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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())
|
||||
|
|
Loading…
Add table
Reference in a new issue