Page MenuHomePhabricator

D18280.diff
No OneTemporary

D18280.diff

diff --git a/resources/sql/autopatches/20170725.legalpad.date.01.sql b/resources/sql/autopatches/20170725.legalpad.date.01.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20170725.legalpad.date.01.sql
@@ -0,0 +1,2 @@
+UPDATE {$NAMESPACE}_legalpad.legalpad_documentbody
+ SET dateCreated = dateModified;
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,18 +45,23 @@
}
if ($is_contribution) {
+ $text = $object->getDocumentBody()->getText();
+ $title = $object->getDocumentBody()->getTitle();
$object->setVersions($object->getVersions() + 1);
- $body = $object->getDocumentBody();
+
+ $body = new LegalpadDocumentBody();
+ $body->setCreatorPHID($this->getActingAsPHID());
+ $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())
+ ->addEdge($this->getActingAsPHID(), $type, $object->getPHID())
->save();
$type = PhabricatorObjectHasContributorEdgeType::EDGECONST;

File Metadata

Mime Type
text/plain
Expires
Mon, May 13, 11:16 PM (2 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6293779
Default Alt Text
D18280.diff (1 KB)

Event Timeline