Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15388321
D18280.id43964.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D18280.id43964.diff
View Options
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,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
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 16, 3:39 AM (1 w, 23 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7705525
Default Alt Text
D18280.id43964.diff (1 KB)
Attached To
Mode
D18280: Properly version Legalpad documents
Attached
Detach File
Event Timeline
Log In to Comment