Page MenuHomePhabricator

D18876.diff
No OneTemporary

D18876.diff

diff --git a/src/applications/transactions/editengine/PhabricatorEditEngine.php b/src/applications/transactions/editengine/PhabricatorEditEngine.php
--- a/src/applications/transactions/editengine/PhabricatorEditEngine.php
+++ b/src/applications/transactions/editengine/PhabricatorEditEngine.php
@@ -2169,6 +2169,8 @@
->setTransactionType(PhabricatorTransactions::TYPE_CREATE);
}
+ $is_strict = $request->getIsStrictlyTyped();
+
foreach ($xactions as $xaction) {
$type = $types[$xaction['type']];
@@ -2179,10 +2181,10 @@
$parameter_type->setViewer($viewer);
try {
- $xaction['value'] = $parameter_type->getValue(
- $xaction,
- 'value',
- $request->getIsStrictlyTyped());
+ $value = $xaction['value'];
+ $value = $parameter_type->getValue($xaction, 'value', $is_strict);
+ $value = $type->getTransactionValueFromConduit($value);
+ $xaction['value'] = $value;
} catch (Exception $ex) {
throw new PhutilProxyException(
pht(
@@ -2498,6 +2500,10 @@
// but it's possible that this isn't the case.
$xaction['type'] = $edit_type->getTransactionType();
+ $value = $xaction['value'];
+ $value = $edit_type->getTransactionValueFromBulkEdit($value);
+ $xaction['value'] = $value;
+
$xaction_objects = $edit_type->generateTransactions(
clone $template,
$xaction);
diff --git a/src/applications/transactions/edittype/PhabricatorEditType.php b/src/applications/transactions/edittype/PhabricatorEditType.php
--- a/src/applications/transactions/edittype/PhabricatorEditType.php
+++ b/src/applications/transactions/edittype/PhabricatorEditType.php
@@ -91,6 +91,10 @@
return $this->editField;
}
+ protected function getTransactionValueFromValue($value) {
+ return $value;
+ }
+
/* -( Bulk )--------------------------------------------------------------- */
@@ -114,6 +118,10 @@
return $this->newBulkParameterType();
}
+ public function getTransactionValueFromBulkEdit($value) {
+ return $this->getTransactionValueFromValue($value);
+ }
+
/* -( Conduit )------------------------------------------------------------ */
@@ -192,4 +200,8 @@
return $this->conduitDocumentation;
}
+ public function getTransactionValueFromConduit($value) {
+ return $this->getTransactionValueFromValue($value);
+ }
+
}
diff --git a/src/infrastructure/customfield/editor/PhabricatorCustomFieldEditType.php b/src/infrastructure/customfield/editor/PhabricatorCustomFieldEditType.php
--- a/src/infrastructure/customfield/editor/PhabricatorCustomFieldEditType.php
+++ b/src/infrastructure/customfield/editor/PhabricatorCustomFieldEditType.php
@@ -40,4 +40,14 @@
return array($xaction);
}
+ protected function getTransactionValueFromValue($value) {
+ $field = $this->getCustomField();
+
+ // Avoid changing the value of the field itself, since later calls would
+ // incorrectly reflect the new value.
+ $clone = clone $field;
+ $clone->setValueFromApplicationTransactions($value);
+ return $clone->getNewValueForApplicationTransactions();
+ }
+
}

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 10, 6:44 PM (6 d, 18 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6720065
Default Alt Text
D18876.diff (3 KB)

Event Timeline