mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-29 04:28:12 +01:00
Fix handling of Phriction conduit edits
Summary: See https://discourse.phabricator-community.org/t/conduit-method-phriction-edit-requires-title-while-the-docs-say-its-optional/2176. Make code consistent with documentation by not requiring either `content` or `title`. Test Plan: Hit the method via the UI and no longer got an error on missing `content` or `title` fields. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D19862
This commit is contained in:
parent
bf6c534b56
commit
00a7071e2d
1 changed files with 13 additions and 6 deletions
|
@ -41,12 +41,19 @@ final class PhrictionEditConduitAPIMethod extends PhrictionConduitAPIMethod {
|
||||||
}
|
}
|
||||||
|
|
||||||
$xactions = array();
|
$xactions = array();
|
||||||
$xactions[] = id(new PhrictionTransaction())
|
if ($request->getValue('title')) {
|
||||||
->setTransactionType(PhrictionDocumentTitleTransaction::TRANSACTIONTYPE)
|
$xactions[] = id(new PhrictionTransaction())
|
||||||
->setNewValue($request->getValue('title'));
|
->setTransactionType(
|
||||||
$xactions[] = id(new PhrictionTransaction())
|
PhrictionDocumentTitleTransaction::TRANSACTIONTYPE)
|
||||||
->setTransactionType(PhrictionDocumentContentTransaction::TRANSACTIONTYPE)
|
->setNewValue($request->getValue('title'));
|
||||||
->setNewValue($request->getValue('content'));
|
}
|
||||||
|
|
||||||
|
if ($request->getValue('content')) {
|
||||||
|
$xactions[] = id(new PhrictionTransaction())
|
||||||
|
->setTransactionType(
|
||||||
|
PhrictionDocumentContentTransaction::TRANSACTIONTYPE)
|
||||||
|
->setNewValue($request->getValue('content'));
|
||||||
|
}
|
||||||
|
|
||||||
$editor = id(new PhrictionTransactionEditor())
|
$editor = id(new PhrictionTransactionEditor())
|
||||||
->setActor($request->getUser())
|
->setActor($request->getUser())
|
||||||
|
|
Loading…
Add table
Reference in a new issue