Page MenuHomePhabricator

D18280.id43963.diff
No OneTemporary

D18280.id43963.diff

diff --git a/src/applications/legalpad/editor/LegalpadDocumentEditor.php b/src/applications/legalpad/editor/LegalpadDocumentEditor.php
--- a/src/applications/legalpad/editor/LegalpadDocumentEditor.php
+++ b/src/applications/legalpad/editor/LegalpadDocumentEditor.php
@@ -45,15 +45,22 @@
}
if ($is_contribution) {
+ $actor = $this->getActor();
+
+ $text = $object->getDocumentBody()->getText();
+ $title = $object->getDocumentBody()->getTitle();
$object->setVersions($object->getVersions() + 1);
- $body = $object->getDocumentBody();
+
+ $body = new LegalpadDocumentBody();
+ $body->setCreatorPHID($actor->getPHID());
+ $body->setText($text);
+ $body->setTitle($title);
$body->setVersion($object->getVersions());
$body->setDocumentPHID($object->getPHID());
$body->save();
$object->setDocumentBodyPHID($body->getPHID());
- $actor = $this->getActor();
$type = PhabricatorContributedToObjectEdgeType::EDGECONST;
id(new PhabricatorEdgeEditor())
->addEdge($actor->getPHID(), $type, $object->getPHID())

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 15, 12:26 AM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7677918
Default Alt Text
D18280.id43963.diff (1 KB)

Event Timeline