mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-27 14:09:11 +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:
parent
fdf00f6df4
commit
c9889e3d55
2 changed files with 9 additions and 6 deletions
|
@ -69,6 +69,11 @@ final class PhrictionTransactionEditor
|
||||||
return $this->processContentVersionError;
|
return $this->processContentVersionError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setMoveAwayDocument(PhrictionDocument $document) {
|
||||||
|
$this->moveAwayDocument = $document;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
public function getEditorApplicationClass() {
|
public function getEditorApplicationClass() {
|
||||||
return 'PhabricatorPhrictionApplication';
|
return 'PhabricatorPhrictionApplication';
|
||||||
}
|
}
|
||||||
|
@ -116,11 +121,6 @@ final class PhrictionTransactionEditor
|
||||||
case PhrictionTransaction::TYPE_CONTENT:
|
case PhrictionTransaction::TYPE_CONTENT:
|
||||||
case PhrictionTransaction::TYPE_DELETE:
|
case PhrictionTransaction::TYPE_DELETE:
|
||||||
return $xaction->getNewValue();
|
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:
|
case PhrictionTransaction::TYPE_MOVE_AWAY:
|
||||||
$document = $xaction->getNewValue();
|
$document = $xaction->getNewValue();
|
||||||
$dict = array(
|
$dict = array(
|
||||||
|
|
|
@ -17,12 +17,15 @@ final class PhrictionDocumentMoveToTransaction
|
||||||
'content' => $document->getContent()->getContent(),
|
'content' => $document->getContent()->getContent(),
|
||||||
'title' => $document->getContent()->getTitle(),
|
'title' => $document->getContent()->getTitle(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$editor = $this->getEditor();
|
||||||
|
$editor->setMoveAwayDocument($document);
|
||||||
|
|
||||||
return $dict;
|
return $dict;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applyInternalEffects($object, $value) {
|
public function applyInternalEffects($object, $value) {
|
||||||
$object->setStatus(PhrictionDocumentStatus::STATUS_EXISTS);
|
$object->setStatus(PhrictionDocumentStatus::STATUS_EXISTS);
|
||||||
$this->getEditor()->getNewContent()->setTitle($value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applyExternalEffects($object, $value) {
|
public function applyExternalEffects($object, $value) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue