Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13183203
D21817.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
D21817.diff
View Options
diff --git a/src/applications/paste/xaction/PhabricatorPasteContentTransaction.php b/src/applications/paste/xaction/PhabricatorPasteContentTransaction.php
--- a/src/applications/paste/xaction/PhabricatorPasteContentTransaction.php
+++ b/src/applications/paste/xaction/PhabricatorPasteContentTransaction.php
@@ -5,6 +5,8 @@
const TRANSACTIONTYPE = 'paste.create';
+ private $filePHID;
+
public function generateOldValue($object) {
return $object->getFilePHID();
}
@@ -14,7 +16,8 @@
}
public function extractFilePHIDs($object, $value) {
- return array($value);
+ $file_phid = $this->getFilePHID($object, $value);
+ return array($file_phid);
}
public function validateTransactions($object, array $xactions) {
@@ -31,6 +34,18 @@
}
public function generateNewValue($object, $value) {
+ return $this->getFilePHID($object, $value);
+ }
+
+ private function getFilePHID($object, $value) {
+ if ($this->filePHID === null) {
+ $this->filePHID = $this->newFilePHID($object, $value);
+ }
+
+ return $this->filePHID;
+ }
+
+ private function newFilePHID($object, $value) {
// If this transaction does not really change the paste content, return
// the current file PHID so this transaction no-ops.
$old_content = $object->getRawContent();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
May 11 2024, 7:32 AM (4 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6285108
Default Alt Text
D21817.diff (1 KB)
Attached To
Mode
D21817: Adjust paste content transaction to support earlier file PHID extraction
Attached
Detach File
Event Timeline
Log In to Comment