Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15463978
D14635.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
D14635.diff
View Options
diff --git a/src/applications/transactions/editengine/PhabricatorEditEngineAPIMethod.php b/src/applications/transactions/editengine/PhabricatorEditEngineAPIMethod.php
--- a/src/applications/transactions/editengine/PhabricatorEditEngineAPIMethod.php
+++ b/src/applications/transactions/editengine/PhabricatorEditEngineAPIMethod.php
@@ -179,6 +179,10 @@
$type->getEditType());
$value_type = $type->getValueType();
+ if (!strlen($value_type)) {
+ $value_type = '?';
+ }
+
$value_description = $type->getValueDescription();
$table = array();
diff --git a/src/infrastructure/customfield/editor/PhabricatorCustomFieldEditField.php b/src/infrastructure/customfield/editor/PhabricatorCustomFieldEditField.php
--- a/src/infrastructure/customfield/editor/PhabricatorCustomFieldEditField.php
+++ b/src/infrastructure/customfield/editor/PhabricatorCustomFieldEditField.php
@@ -36,8 +36,15 @@
}
protected function newEditType() {
- return id(new PhabricatorCustomFieldEditType())
+ $type = id(new PhabricatorCustomFieldEditType())
->setCustomField($this->getCustomField());
+
+ $http_type = $this->getHTTPParameterType();
+ if ($http_type) {
+ $type->setValueType($http_type->getTypeName());
+ }
+
+ return $type;
}
public function getValueForTransaction() {
@@ -65,8 +72,13 @@
}
public function getConduitEditTypes() {
- // TODO: For now, don't support custom fields over Conduit.
- return array();
+ $field = $this->getCustomField();
+
+ if (!$field->shouldAppearInConduitTransactions()) {
+ return array();
+ }
+
+ return parent::getConduitEditTypes();
}
protected function newHTTPParameterType() {
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
@@ -4,6 +4,7 @@
extends PhabricatorEditType {
private $customField;
+ private $valueType;
public function setCustomField(PhabricatorCustomField $custom_field) {
$this->customField = $custom_field;
@@ -14,9 +15,13 @@
return $this->customField;
}
+ public function setValueType($value_type) {
+ $this->valueType = $value_type;
+ return $this;
+ }
+
public function getValueType() {
- // TODO: Improve.
- return 'custom';
+ return $this->valueType;
}
public function getMetadata() {
diff --git a/src/infrastructure/customfield/field/PhabricatorCustomField.php b/src/infrastructure/customfield/field/PhabricatorCustomField.php
--- a/src/infrastructure/customfield/field/PhabricatorCustomField.php
+++ b/src/infrastructure/customfield/field/PhabricatorCustomField.php
@@ -1323,6 +1323,14 @@
}
+ public function shouldAppearInConduitTransactions() {
+ if ($this->proxy) {
+ return $this->proxy->shouldAppearInConduitDictionary();
+ }
+ return false;
+ }
+
+
/* -( Herald )------------------------------------------------------------- */
diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php
--- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php
+++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php
@@ -433,4 +433,8 @@
->setEditTypeKey($short);
}
+ public function shouldAppearInConduitTransactions() {
+ return true;
+ }
+
}
diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php
--- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php
+++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php
@@ -191,4 +191,10 @@
}
}
+ public function shouldAppearInConduitTransactions() {
+ // TODO: Dates are complicated and we don't yet support handling them from
+ // Conduit.
+ return false;
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 3, 5:11 AM (2 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7707630
Default Alt Text
D14635.diff (4 KB)
Attached To
Mode
D14635: Support Conduit application of most CustomField transactions in EditEngine
Attached
Detach File
Event Timeline
Log In to Comment