Fix Phriction status not set property on new document
Summary: I deleted too many lines of code here and TYPE_MOVE was always being applied when CONTENT was set. This should fix on next document save, but should I write some migration tool anyways? Test Plan: Create a new document, see document with correct status. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D17960
This commit is contained in:
@@ -164,6 +164,8 @@ final class PhrictionTransactionEditor
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case PhrictionTransaction::TYPE_CONTENT:
|
||||
$object->setStatus(PhrictionDocumentStatus::STATUS_EXISTS);
|
||||
return;
|
||||
case PhrictionTransaction::TYPE_MOVE_AWAY:
|
||||
$object->setStatus(PhrictionDocumentStatus::STATUS_MOVED);
|
||||
return;
|
||||
@@ -241,10 +243,10 @@ final class PhrictionTransactionEditor
|
||||
foreach ($xactions as $xaction) {
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case PhrictionDocumentTitleTransaction::TRANSACTIONTYPE:
|
||||
case PhrictionDocumentMoveToTransaction::TRANSACTIONTYPE:
|
||||
case PhrictionTransaction::TYPE_CONTENT:
|
||||
case PhrictionTransaction::TYPE_DELETE:
|
||||
case PhrictionTransaction::TYPE_MOVE_AWAY:
|
||||
case PhrictionDocumentMoveToTransaction::TRANSACTIONTYPE:
|
||||
$save_content = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -14,6 +14,9 @@ final class PhrictionDocumentTitleTransaction
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$object->setStatus(PhrictionDocumentStatus::STATUS_EXISTS);
|
||||
}
|
||||
|
||||
public function applyExternalEffects($object, $value) {
|
||||
$this->getEditor()->getNewContent()->setTitle($value);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user