Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14005377
D19909.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D19909.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,8 +5,6 @@
const TRANSACTIONTYPE = 'paste.create';
- private $fileName;
-
public function generateOldValue($object) {
return $object->getFilePHID();
}
@@ -32,26 +30,6 @@
return array($error);
}
- public function willApplyTransactions($object, array $xactions) {
- // Find the most user-friendly filename we can by examining the title of
- // the paste and the pending transactions. We'll use this if we create a
- // new file to store raw content later.
-
- $name = $object->getTitle();
- if (!strlen($name)) {
- $name = 'paste.raw';
- }
-
- $type_title = PhabricatorPasteTitleTransaction::TRANSACTIONTYPE;
- foreach ($xactions as $xaction) {
- if ($xaction->getTransactionType() == $type_title) {
- $name = $xaction->getNewValue();
- }
- }
-
- $this->fileName = $name;
- }
-
public function generateNewValue($object, $value) {
// If this transaction does not really change the paste content, return
// the current file PHID so this transaction no-ops.
@@ -66,16 +44,16 @@
$editor = $this->getEditor();
$actor = $editor->getActor();
- $file = $this->newFileForPaste($actor, $this->fileName, $value);
+ $file = $this->newFileForPaste($actor, $value);
return $file->getPHID();
}
- private function newFileForPaste(PhabricatorUser $actor, $name, $data) {
+ private function newFileForPaste(PhabricatorUser $actor, $data) {
return PhabricatorFile::newFromFileData(
$data,
array(
- 'name' => $name,
+ 'name' => 'raw.txt',
'mime-type' => 'text/plain; charset=utf-8',
'authorPHID' => $actor->getPHID(),
'viewPolicy' => PhabricatorPolicies::POLICY_NOONE,
diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
--- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
+++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
@@ -1026,8 +1026,6 @@
$xactions = $this->filterTransactions($object, $xactions);
if (!$is_preview) {
- $this->willApplyTransactions($object, $xactions);
-
$this->hasRequiredMFA = true;
if ($this->getShouldRequireMFA()) {
$this->requireMFA($object, $xactions);
@@ -4374,19 +4372,6 @@
return idx($types, $type);
}
- private function willApplyTransactions($object, array $xactions) {
- foreach ($xactions as $xaction) {
- $type = $xaction->getTransactionType();
-
- $xtype = $this->getModularTransactionType($type);
- if (!$xtype) {
- continue;
- }
-
- $xtype->willApplyTransactions($object, $xactions);
- }
- }
-
public function getCreateObjectTitle($author, $object) {
return pht('%s created this object.', $author);
}
diff --git a/src/applications/transactions/storage/PhabricatorModularTransaction.php b/src/applications/transactions/storage/PhabricatorModularTransaction.php
--- a/src/applications/transactions/storage/PhabricatorModularTransaction.php
+++ b/src/applications/transactions/storage/PhabricatorModularTransaction.php
@@ -69,11 +69,6 @@
->generateNewValue($object, $this->getNewValue());
}
- final public function willApplyTransactions($object, array $xactions) {
- return $this->getTransactionImplementation()
- ->willApplyTransactions($object, $xactions);
- }
-
final public function applyInternalEffects($object) {
return $this->getTransactionImplementation()
->applyInternalEffects($object);
diff --git a/src/applications/transactions/storage/PhabricatorModularTransactionType.php b/src/applications/transactions/storage/PhabricatorModularTransactionType.php
--- a/src/applications/transactions/storage/PhabricatorModularTransactionType.php
+++ b/src/applications/transactions/storage/PhabricatorModularTransactionType.php
@@ -23,10 +23,6 @@
return array();
}
- public function willApplyTransactions($object, array $xactions) {
- return;
- }
-
public function applyInternalEffects($object, $value) {
return;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Oct 28, 12:21 PM (3 w, 19 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6736007
Default Alt Text
D19909.diff (4 KB)
Attached To
Mode
D19909: Remove the "willApplyTransactions()" hook from ApplicationTransactionEditor
Attached
Detach File
Event Timeline
Log In to Comment