1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 00:32:42 +01:00

Fix an issue in Phriction where moving a document just copied it instead

Summary: Ref T12732. See D17918. With modular transactions, `getCustomTransactionNewValue()` isn't actually called.

Test Plan: Moved document `/x/` to `/y/`, saw document gone at `/x/` instead of copied.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12732

Differential Revision: https://secure.phabricator.com/D17963
This commit is contained in:
epriestley 2017-05-19 12:41:46 -07:00
parent fdf00f6df4
commit c9889e3d55
2 changed files with 9 additions and 6 deletions

View file

@ -69,6 +69,11 @@ final class PhrictionTransactionEditor
return $this->processContentVersionError;
}
public function setMoveAwayDocument(PhrictionDocument $document) {
$this->moveAwayDocument = $document;
return $this;
}
public function getEditorApplicationClass() {
return 'PhabricatorPhrictionApplication';
}
@ -116,11 +121,6 @@ final class PhrictionTransactionEditor
case PhrictionTransaction::TYPE_CONTENT:
case PhrictionTransaction::TYPE_DELETE:
return $xaction->getNewValue();
case PhrictionDocumentMoveToTransaction::TRANSACTIONTYPE:
$document = $xaction->getNewValue();
// grab the real object now for the sub-editor to come
$this->moveAwayDocument = $document;
return;
case PhrictionTransaction::TYPE_MOVE_AWAY:
$document = $xaction->getNewValue();
$dict = array(

View file

@ -17,12 +17,15 @@ final class PhrictionDocumentMoveToTransaction
'content' => $document->getContent()->getContent(),
'title' => $document->getContent()->getTitle(),
);
$editor = $this->getEditor();
$editor->setMoveAwayDocument($document);
return $dict;
}
public function applyInternalEffects($object, $value) {
$object->setStatus(PhrictionDocumentStatus::STATUS_EXISTS);
$this->getEditor()->getNewContent()->setTitle($value);
}
public function applyExternalEffects($object, $value) {