diff --git a/resources/sql/autopatches/20180828.phriction.01.contentphid.sql b/resources/sql/autopatches/20180828.phriction.01.contentphid.sql new file mode 100644 index 0000000000..cf3d78ebdf --- /dev/null +++ b/resources/sql/autopatches/20180828.phriction.01.contentphid.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_phriction.phriction_document + ADD contentPHID VARBINARY(64) NOT NULL; diff --git a/resources/sql/autopatches/20180828.phriction.02.documentphid.sql b/resources/sql/autopatches/20180828.phriction.02.documentphid.sql new file mode 100644 index 0000000000..c15b4b17b8 --- /dev/null +++ b/resources/sql/autopatches/20180828.phriction.02.documentphid.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_phriction.phriction_content + ADD documentPHID VARBINARY(64) NOT NULL; diff --git a/resources/sql/autopatches/20180828.phriction.03.editedepoch.sql b/resources/sql/autopatches/20180828.phriction.03.editedepoch.sql new file mode 100644 index 0000000000..eae31fc0ba --- /dev/null +++ b/resources/sql/autopatches/20180828.phriction.03.editedepoch.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_phriction.phriction_document + ADD editedEpoch INT UNSIGNED NOT NULL; diff --git a/resources/sql/autopatches/20180828.phriction.04.migrate.php b/resources/sql/autopatches/20180828.phriction.04.migrate.php new file mode 100644 index 0000000000..461eae2dad --- /dev/null +++ b/resources/sql/autopatches/20180828.phriction.04.migrate.php @@ -0,0 +1,57 @@ +establishConnection('w'); + +$document_iterator = new LiskRawMigrationIterator( + $conn, + $document_table->getTableName()); +foreach ($document_iterator as $row) { + $content_id = $row['contentID']; + + $content_row = queryfx_one( + $conn, + 'SELECT phid, dateCreated FROM %T WHERE id = %d', + $content_table->getTableName(), + $content_id); + + if (!$content_row) { + continue; + } + + queryfx( + $conn, + 'UPDATE %T SET contentPHID = %s, editedEpoch = %d WHERE id = %d', + $document_table->getTableName(), + $content_row['phid'], + $content_row['dateCreated'], + $row['id']); +} + +$content_iterator = new LiskRawMigrationIterator( + $conn, + $content_table->getTableName()); +foreach ($content_iterator as $row) { + $document_id = $row['documentID']; + + $document_row = queryfx_one( + $conn, + 'SELECT phid FROM %T WHERE id = %d', + $document_table->getTableName(), + $document_id); + if (!$document_row) { + continue; + } + + queryfx( + $conn, + 'UPDATE %T SET documentPHID = %s WHERE id = %d', + $content_table->getTableName(), + $document_row['phid'], + $row['id']); +} diff --git a/resources/sql/autopatches/20180828.phriction.05.contentid.sql b/resources/sql/autopatches/20180828.phriction.05.contentid.sql new file mode 100644 index 0000000000..d6cba741a3 --- /dev/null +++ b/resources/sql/autopatches/20180828.phriction.05.contentid.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_phriction.phriction_document + DROP contentID; diff --git a/resources/sql/autopatches/20180828.phriction.06.documentid.sql b/resources/sql/autopatches/20180828.phriction.06.documentid.sql new file mode 100644 index 0000000000..2323154b3e --- /dev/null +++ b/resources/sql/autopatches/20180828.phriction.06.documentid.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_phriction.phriction_content + DROP documentID; diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 284980bcc5..191522d8fb 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -5036,6 +5036,7 @@ phutil_register_library_map(array( 'PhrictionDocumentTitleHeraldField' => 'applications/phriction/herald/PhrictionDocumentTitleHeraldField.php', 'PhrictionDocumentTitleTransaction' => 'applications/phriction/xaction/PhrictionDocumentTitleTransaction.php', 'PhrictionDocumentTransactionType' => 'applications/phriction/xaction/PhrictionDocumentTransactionType.php', + 'PhrictionDocumentVersionTransaction' => 'applications/phriction/xaction/PhrictionDocumentVersionTransaction.php', 'PhrictionEditConduitAPIMethod' => 'applications/phriction/conduit/PhrictionEditConduitAPIMethod.php', 'PhrictionEditController' => 'applications/phriction/controller/PhrictionEditController.php', 'PhrictionHistoryConduitAPIMethod' => 'applications/phriction/conduit/PhrictionHistoryConduitAPIMethod.php', @@ -11129,17 +11130,17 @@ phutil_register_library_map(array( ), 'PhrictionDocumentAuthorHeraldField' => 'PhrictionDocumentHeraldField', 'PhrictionDocumentContentHeraldField' => 'PhrictionDocumentHeraldField', - 'PhrictionDocumentContentTransaction' => 'PhrictionDocumentTransactionType', + 'PhrictionDocumentContentTransaction' => 'PhrictionDocumentVersionTransaction', 'PhrictionDocumentController' => 'PhrictionController', 'PhrictionDocumentDatasource' => 'PhabricatorTypeaheadDatasource', - 'PhrictionDocumentDeleteTransaction' => 'PhrictionDocumentTransactionType', + 'PhrictionDocumentDeleteTransaction' => 'PhrictionDocumentVersionTransaction', 'PhrictionDocumentFerretEngine' => 'PhabricatorFerretEngine', 'PhrictionDocumentFulltextEngine' => 'PhabricatorFulltextEngine', 'PhrictionDocumentHeraldAdapter' => 'HeraldAdapter', 'PhrictionDocumentHeraldField' => 'HeraldField', 'PhrictionDocumentHeraldFieldGroup' => 'HeraldFieldGroup', - 'PhrictionDocumentMoveAwayTransaction' => 'PhrictionDocumentTransactionType', - 'PhrictionDocumentMoveToTransaction' => 'PhrictionDocumentTransactionType', + 'PhrictionDocumentMoveAwayTransaction' => 'PhrictionDocumentVersionTransaction', + 'PhrictionDocumentMoveToTransaction' => 'PhrictionDocumentVersionTransaction', 'PhrictionDocumentPHIDType' => 'PhabricatorPHIDType', 'PhrictionDocumentPathHeraldField' => 'PhrictionDocumentHeraldField', 'PhrictionDocumentPolicyCodex' => 'PhabricatorPolicyCodex', @@ -11148,8 +11149,9 @@ phutil_register_library_map(array( 'PhrictionDocumentSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhrictionDocumentStatus' => 'PhabricatorObjectStatus', 'PhrictionDocumentTitleHeraldField' => 'PhrictionDocumentHeraldField', - 'PhrictionDocumentTitleTransaction' => 'PhrictionDocumentTransactionType', + 'PhrictionDocumentTitleTransaction' => 'PhrictionDocumentVersionTransaction', 'PhrictionDocumentTransactionType' => 'PhabricatorModularTransactionType', + 'PhrictionDocumentVersionTransaction' => 'PhrictionDocumentTransactionType', 'PhrictionEditConduitAPIMethod' => 'PhrictionConduitAPIMethod', 'PhrictionEditController' => 'PhrictionController', 'PhrictionHistoryConduitAPIMethod' => 'PhrictionConduitAPIMethod', diff --git a/src/applications/phriction/controller/PhrictionDiffController.php b/src/applications/phriction/controller/PhrictionDiffController.php index f443ad657b..c81a90a3df 100644 --- a/src/applications/phriction/controller/PhrictionDiffController.php +++ b/src/applications/phriction/controller/PhrictionDiffController.php @@ -65,8 +65,8 @@ final class PhrictionDiffController extends PhrictionController { $slug = $document->getSlug(); - $revert_l = $this->renderRevertButton($content_l, $current); - $revert_r = $this->renderRevertButton($content_r, $current); + $revert_l = $this->renderRevertButton($document, $content_l, $current); + $revert_r = $this->renderRevertButton($document, $content_r, $current); $crumbs = $this->buildApplicationCrumbs(); $crumb_views = $this->renderBreadcrumbs($slug); @@ -179,10 +179,11 @@ final class PhrictionDiffController extends PhrictionController { } private function renderRevertButton( + PhrictionDocument $document, PhrictionContent $content, PhrictionContent $current) { - $document_id = $content->getDocumentID(); + $document_id = $document->getID(); $version = $content->getVersion(); $hidden_statuses = array( diff --git a/src/applications/phriction/controller/PhrictionDocumentController.php b/src/applications/phriction/controller/PhrictionDocumentController.php index fce2c066f7..0018ca229a 100644 --- a/src/applications/phriction/controller/PhrictionDocumentController.php +++ b/src/applications/phriction/controller/PhrictionDocumentController.php @@ -78,7 +78,7 @@ final class PhrictionDocumentController return new Aphront404Response(); } - if ($content->getID() != $document->getContentID()) { + if ($content->getPHID() != $document->getContentPHID()) { $version_note = id(new PHUIInfoView()) ->setSeverity(PHUIInfoView::SEVERITY_NOTICE) ->appendChild( diff --git a/src/applications/phriction/controller/PhrictionHistoryController.php b/src/applications/phriction/controller/PhrictionHistoryController.php index 432b1dfdef..2a3afc9769 100644 --- a/src/applications/phriction/controller/PhrictionHistoryController.php +++ b/src/applications/phriction/controller/PhrictionHistoryController.php @@ -52,7 +52,7 @@ final class PhrictionHistoryController } $vs_head = null; - if ($content->getID() != $document->getContentID()) { + if ($content->getPHID() != $document->getContentPHID()) { $vs_head = $diff_uri ->alter('l', $content->getVersion()) ->alter('r', $current->getVersion()); diff --git a/src/applications/phriction/editor/PhrictionTransactionEditor.php b/src/applications/phriction/editor/PhrictionTransactionEditor.php index b9f2c0e2ca..d91165ab1d 100644 --- a/src/applications/phriction/editor/PhrictionTransactionEditor.php +++ b/src/applications/phriction/editor/PhrictionTransactionEditor.php @@ -93,29 +93,13 @@ final class PhrictionTransactionEditor return $types; } - protected function shouldApplyInitialEffects( - PhabricatorLiskDAO $object, - array $xactions) { - - foreach ($xactions as $xaction) { - switch ($xaction->getTransactionType()) { - case PhrictionDocumentTitleTransaction::TRANSACTIONTYPE: - case PhrictionDocumentContentTransaction::TRANSACTIONTYPE: - case PhrictionDocumentDeleteTransaction::TRANSACTIONTYPE: - case PhrictionDocumentMoveToTransaction::TRANSACTIONTYPE: - case PhrictionDocumentMoveAwayTransaction::TRANSACTIONTYPE: - return true; - } - } - return parent::shouldApplyInitialEffects($object, $xactions); - } - - protected function applyInitialEffects( + protected function expandTransactions( PhabricatorLiskDAO $object, array $xactions) { $this->setOldContent($object->getContent()); - $this->setNewContent($this->buildNewContentTemplate($object)); + + return parent::expandTransactions($object, $xactions); } protected function expandTransaction( @@ -148,7 +132,6 @@ final class PhrictionTransactionEditor break; default: break; - } return $xactions; @@ -158,29 +141,12 @@ final class PhrictionTransactionEditor PhabricatorLiskDAO $object, array $xactions) { - $save_content = false; - foreach ($xactions as $xaction) { - switch ($xaction->getTransactionType()) { - case PhrictionDocumentTitleTransaction::TRANSACTIONTYPE: - case PhrictionDocumentMoveToTransaction::TRANSACTIONTYPE: - case PhrictionDocumentMoveAwayTransaction::TRANSACTIONTYPE: - case PhrictionDocumentDeleteTransaction::TRANSACTIONTYPE: - case PhrictionDocumentContentTransaction::TRANSACTIONTYPE: - $save_content = true; - break; - default: - break; - } - } + if ($this->hasNewDocumentContent()) { + $content = $this->getNewDocumentContent($object); - if ($save_content) { - $content = $this->getNewContent(); - $content->setDocumentID($object->getID()); - $content->save(); - - $object->setContentID($content->getID()); - $object->save(); - $object->attachContent($content); + $content + ->setDocumentPHID($object->getPHID()) + ->save(); } if ($this->getIsNewObject() && !$this->getSkipAncestorCheck()) { @@ -535,24 +501,47 @@ final class PhrictionTransactionEditor ->setDocument($object); } - private function buildNewContentTemplate( - PhrictionDocument $document) { + private function hasNewDocumentContent() { + return (bool)$this->newContent; + } - $new_content = id(new PhrictionContent()) + public function getNewDocumentContent(PhrictionDocument $document) { + if (!$this->hasNewDocumentContent()) { + $content = $this->newDocumentContent($document); + + // Generate a PHID now so we can populate "contentPHID" before saving + // the document to the database: the column is not nullable so we need + // a value. + $content_phid = $content->generatePHID(); + + $content->setPHID($content_phid); + + $document->setContentPHID($content_phid); + $document->attachContent($content); + $document->setEditedEpoch(PhabricatorTime::getNow()); + + $this->newContent = $content; + } + + return $this->newContent; + } + + private function newDocumentContent(PhrictionDocument $document) { + $content = id(new PhrictionContent()) ->setSlug($document->getSlug()) - ->setAuthorPHID($this->getActor()->getPHID()) + ->setAuthorPHID($this->getActingAsPHID()) ->setChangeType(PhrictionChangeType::CHANGE_EDIT) ->setTitle($this->getOldContent()->getTitle()) ->setContent($this->getOldContent()->getContent()) ->setDescription(''); if (strlen($this->getDescription())) { - $new_content->setDescription($this->getDescription()); + $content->setDescription($this->getDescription()); } - $new_content->setVersion($this->getOldContent()->getVersion() + 1); + $content->setVersion($this->getOldContent()->getVersion() + 1); - return $new_content; + return $content; } protected function getCustomWorkerState() { diff --git a/src/applications/phriction/query/PhrictionContentQuery.php b/src/applications/phriction/query/PhrictionContentQuery.php index 053f40cf9c..6efab5e1c6 100644 --- a/src/applications/phriction/query/PhrictionContentQuery.php +++ b/src/applications/phriction/query/PhrictionContentQuery.php @@ -76,7 +76,7 @@ final class PhrictionContentQuery if ($this->shouldJoinDocumentTable()) { $joins[] = qsprintf( $conn, - 'JOIN %T d ON d.id = c.documentID', + 'JOIN %T d ON d.phid = c.documentPHID', id(new PhrictionDocument())->getTableName()); } @@ -84,19 +84,19 @@ final class PhrictionContentQuery } protected function willFilterPage(array $contents) { - $document_ids = mpull($contents, 'getDocumentID'); + $document_phids = mpull($contents, 'getDocumentPHID'); $documents = id(new PhrictionDocumentQuery()) ->setViewer($this->getViewer()) ->setParentQuery($this) - ->withIDs($document_ids) + ->withPHIDs($document_phids) ->execute(); - $documents = mpull($documents, null, 'getID'); + $documents = mpull($documents, null, 'getPHID'); foreach ($contents as $key => $content) { - $document_id = $content->getDocumentID(); + $document_phid = $content->getDocumentPHID(); - $document = idx($documents, $document_id); + $document = idx($documents, $document_phid); if (!$document) { unset($contents[$key]); $this->didRejectResult($content); diff --git a/src/applications/phriction/query/PhrictionDocumentQuery.php b/src/applications/phriction/query/PhrictionDocumentQuery.php index 0c6a2c23bc..8a0fa325ae 100644 --- a/src/applications/phriction/query/PhrictionDocumentQuery.php +++ b/src/applications/phriction/query/PhrictionDocumentQuery.php @@ -151,17 +151,17 @@ final class PhrictionDocumentQuery $contents = id(new PhrictionContentQuery()) ->setViewer($this->getViewer()) ->setParentQuery($this) - ->withIDs(mpull($documents, 'getContentID')) + ->withPHIDs(mpull($documents, 'getContentPHID')) ->execute(); - $contents = mpull($contents, null, 'getID'); + $contents = mpull($contents, null, 'getPHID'); foreach ($documents as $key => $document) { - $content_id = $document->getContentID(); - if (empty($contents[$content_id])) { + $content_phid = $document->getContentPHID(); + if (empty($contents[$content_phid])) { unset($documents[$key]); continue; } - $document->attachContent($contents[$content_id]); + $document->attachContent($contents[$content_phid]); } } @@ -175,7 +175,7 @@ final class PhrictionDocumentQuery $content_dao = new PhrictionContent(); $joins[] = qsprintf( $conn, - 'JOIN %T c ON d.contentID = c.id', + 'JOIN %T c ON d.contentPHID = c.phid', $content_dao->getTableName()); } @@ -321,7 +321,7 @@ final class PhrictionDocumentQuery public function getBuiltinOrders() { return parent::getBuiltinOrders() + array( self::ORDER_HIERARCHY => array( - 'vector' => array('depth', 'title', 'updated'), + 'vector' => array('depth', 'title', 'updated', 'id'), 'name' => pht('Hierarchy'), ), ); @@ -343,9 +343,9 @@ final class PhrictionDocumentQuery ), 'updated' => array( 'table' => 'd', - 'column' => 'contentID', + 'column' => 'editedEpoch', 'type' => 'int', - 'unique' => true, + 'unique' => false, ), ); } @@ -356,7 +356,7 @@ final class PhrictionDocumentQuery $map = array( 'id' => $document->getID(), 'depth' => $document->getDepth(), - 'updated' => $document->getContentID(), + 'updated' => $document->getEditedEpoch(), ); foreach ($keys as $key) { diff --git a/src/applications/phriction/storage/PhrictionContent.php b/src/applications/phriction/storage/PhrictionContent.php index 515fc6b7d5..287974715f 100644 --- a/src/applications/phriction/storage/PhrictionContent.php +++ b/src/applications/phriction/storage/PhrictionContent.php @@ -7,7 +7,7 @@ final class PhrictionContent PhabricatorDestructibleInterface, PhabricatorConduitResultInterface { - protected $documentID; + protected $documentPHID; protected $version; protected $authorPHID; @@ -35,7 +35,7 @@ final class PhrictionContent ), self::CONFIG_KEY_SCHEMA => array( 'documentID' => array( - 'columns' => array('documentID', 'version'), + 'columns' => array('documentPHID', 'version'), 'unique' => true, ), 'authorPHID' => array( diff --git a/src/applications/phriction/storage/PhrictionDocument.php b/src/applications/phriction/storage/PhrictionDocument.php index 6edb516e6e..0e260c2e40 100644 --- a/src/applications/phriction/storage/PhrictionDocument.php +++ b/src/applications/phriction/storage/PhrictionDocument.php @@ -17,12 +17,13 @@ final class PhrictionDocument extends PhrictionDAO protected $slug; protected $depth; - protected $contentID; + protected $contentPHID; protected $status; protected $mailKey; protected $viewPolicy; protected $editPolicy; protected $spacePHID; + protected $editedEpoch; private $contentObject = self::ATTACHABLE; private $ancestors = array(); @@ -34,16 +35,11 @@ final class PhrictionDocument extends PhrictionDAO self::CONFIG_COLUMN_SCHEMA => array( 'slug' => 'sort128', 'depth' => 'uint32', - 'contentID' => 'id?', 'status' => 'text32', 'mailKey' => 'bytes20', + 'editedEpoch' => 'epoch', ), self::CONFIG_KEY_SCHEMA => array( - 'key_phid' => null, - 'phid' => array( - 'columns' => array('phid'), - 'unique' => true, - ), 'slug' => array( 'columns' => array('slug'), 'unique' => true, @@ -56,17 +52,16 @@ final class PhrictionDocument extends PhrictionDAO ) + parent::getConfiguration(); } - public function generatePHID() { - return PhabricatorPHID::generateNewPHID( - PhrictionDocumentPHIDType::TYPECONST); + public function getPHIDType() { + return PhrictionDocumentPHIDType::TYPECONST; } public static function initializeNewDocument(PhabricatorUser $actor, $slug) { - $document = new PhrictionDocument(); - $document->setSlug($slug); + $document = id(new self()) + ->setSlug($slug); - $content = new PhrictionContent(); - $content->setSlug($slug); + $content = id(new PhrictionContent()) + ->setSlug($slug); $default_title = PhabricatorSlug::getDefaultTitle($slug); $content->setTitle($default_title); @@ -95,6 +90,8 @@ final class PhrictionDocument extends PhrictionDAO ->setSpacePHID($actor->getDefaultSpacePHID()); } + $document->setEditedEpoch(PhabricatorTime::getNow()); + return $document; } diff --git a/src/applications/phriction/xaction/PhrictionDocumentContentTransaction.php b/src/applications/phriction/xaction/PhrictionDocumentContentTransaction.php index a051546824..759121dd65 100644 --- a/src/applications/phriction/xaction/PhrictionDocumentContentTransaction.php +++ b/src/applications/phriction/xaction/PhrictionDocumentContentTransaction.php @@ -1,7 +1,7 @@ setStatus(PhrictionDocumentStatus::STATUS_EXISTS); - } - public function applyExternalEffects($object, $value) { - $this->getEditor()->getNewContent()->setContent($value); + $content = $this->getNewDocumentContent($object); + $content->setContent($value); } public function shouldHide() { diff --git a/src/applications/phriction/xaction/PhrictionDocumentDeleteTransaction.php b/src/applications/phriction/xaction/PhrictionDocumentDeleteTransaction.php index 25cc7c2b28..b1d894b96c 100644 --- a/src/applications/phriction/xaction/PhrictionDocumentDeleteTransaction.php +++ b/src/applications/phriction/xaction/PhrictionDocumentDeleteTransaction.php @@ -1,7 +1,7 @@ setStatus(PhrictionDocumentStatus::STATUS_DELETED); - } - public function applyExternalEffects($object, $value) { - $this->getEditor()->getNewContent()->setContent(''); - $this->getEditor()->getNewContent()->setChangeType( - PhrictionChangeType::CHANGE_DELETE); + $content = $this->getNewDocumentContent($object); + + $content->setContent(''); + $content->setChangeType(PhrictionChangeType::CHANGE_DELETE); } public function getActionStrength() { diff --git a/src/applications/phriction/xaction/PhrictionDocumentMoveAwayTransaction.php b/src/applications/phriction/xaction/PhrictionDocumentMoveAwayTransaction.php index 3cd45f73b7..09ec56dd25 100644 --- a/src/applications/phriction/xaction/PhrictionDocumentMoveAwayTransaction.php +++ b/src/applications/phriction/xaction/PhrictionDocumentMoveAwayTransaction.php @@ -1,7 +1,7 @@ setStatus(PhrictionDocumentStatus::STATUS_MOVED); - } - public function applyExternalEffects($object, $value) { - $dict = $value; - $this->getEditor()->getNewContent()->setContent(''); - $this->getEditor()->getNewContent()->setChangeType( - PhrictionChangeType::CHANGE_MOVE_AWAY); - $this->getEditor()->getNewContent()->setChangeRef($dict['id']); + $content = $this->getNewDocumentContent($object); + + $content->setContent(''); + $content->setChangeType(PhrictionChangeType::CHANGE_MOVE_AWAY); + $content->setChangeRef($value['id']); } public function getActionName() { diff --git a/src/applications/phriction/xaction/PhrictionDocumentMoveToTransaction.php b/src/applications/phriction/xaction/PhrictionDocumentMoveToTransaction.php index bdf2c5d8fc..180c263942 100644 --- a/src/applications/phriction/xaction/PhrictionDocumentMoveToTransaction.php +++ b/src/applications/phriction/xaction/PhrictionDocumentMoveToTransaction.php @@ -1,7 +1,7 @@ $document->getID(), 'phid' => $document->getPHID(), @@ -26,15 +27,13 @@ final class PhrictionDocumentMoveToTransaction public function applyInternalEffects($object, $value) { $object->setStatus(PhrictionDocumentStatus::STATUS_EXISTS); - } - public function applyExternalEffects($object, $value) { - $dict = $value; - $this->getEditor()->getNewContent()->setContent($dict['content']); - $this->getEditor()->getNewContent()->setTitle($dict['title']); - $this->getEditor()->getNewContent()->setChangeType( - PhrictionChangeType::CHANGE_MOVE_HERE); - $this->getEditor()->getNewContent()->setChangeRef($dict['id']); + $content = $this->getNewDocumentContent($object); + + $content->setContent($value['content']); + $content->setTitle($value['title']); + $content->setChangeType(PhrictionChangeType::CHANGE_MOVE_HERE); + $content->setChangeRef($value['id']); } public function getActionStrength() { diff --git a/src/applications/phriction/xaction/PhrictionDocumentTitleTransaction.php b/src/applications/phriction/xaction/PhrictionDocumentTitleTransaction.php index 5c97d1bec8..25a77efffe 100644 --- a/src/applications/phriction/xaction/PhrictionDocumentTitleTransaction.php +++ b/src/applications/phriction/xaction/PhrictionDocumentTitleTransaction.php @@ -1,7 +1,7 @@ setStatus(PhrictionDocumentStatus::STATUS_EXISTS); - } - public function applyExternalEffects($object, $value) { - $this->getEditor()->getNewContent()->setTitle($value); + $content = $this->getNewDocumentContent($object); + + $content->setTitle($value); } public function getActionStrength() { diff --git a/src/applications/phriction/xaction/PhrictionDocumentVersionTransaction.php b/src/applications/phriction/xaction/PhrictionDocumentVersionTransaction.php new file mode 100644 index 0000000000..005e617e3b --- /dev/null +++ b/src/applications/phriction/xaction/PhrictionDocumentVersionTransaction.php @@ -0,0 +1,10 @@ +getEditor()->getNewDocumentContent($object); + } + +}