@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Support Conduit application of most CustomField transactions in EditEngine

Summary:
Ref T9132. Give most standard custom fields reasonable Conduit support so you can use the new `application.x` endpoints to set them.

Major missing field type is dates, again.

Test Plan: Used Conduit to set various custom fields on a package.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14635

+44 -5
+4
src/applications/transactions/editengine/PhabricatorEditEngineAPIMethod.php
··· 179 179 $type->getEditType()); 180 180 181 181 $value_type = $type->getValueType(); 182 + if (!strlen($value_type)) { 183 + $value_type = '?'; 184 + } 185 + 182 186 $value_description = $type->getValueDescription(); 183 187 184 188 $table = array();
+15 -3
src/infrastructure/customfield/editor/PhabricatorCustomFieldEditField.php
··· 36 36 } 37 37 38 38 protected function newEditType() { 39 - return id(new PhabricatorCustomFieldEditType()) 39 + $type = id(new PhabricatorCustomFieldEditType()) 40 40 ->setCustomField($this->getCustomField()); 41 + 42 + $http_type = $this->getHTTPParameterType(); 43 + if ($http_type) { 44 + $type->setValueType($http_type->getTypeName()); 45 + } 46 + 47 + return $type; 41 48 } 42 49 43 50 public function getValueForTransaction() { ··· 65 72 } 66 73 67 74 public function getConduitEditTypes() { 68 - // TODO: For now, don't support custom fields over Conduit. 69 - return array(); 75 + $field = $this->getCustomField(); 76 + 77 + if (!$field->shouldAppearInConduitTransactions()) { 78 + return array(); 79 + } 80 + 81 + return parent::getConduitEditTypes(); 70 82 } 71 83 72 84 protected function newHTTPParameterType() {
+7 -2
src/infrastructure/customfield/editor/PhabricatorCustomFieldEditType.php
··· 4 4 extends PhabricatorEditType { 5 5 6 6 private $customField; 7 + private $valueType; 7 8 8 9 public function setCustomField(PhabricatorCustomField $custom_field) { 9 10 $this->customField = $custom_field; ··· 14 15 return $this->customField; 15 16 } 16 17 18 + public function setValueType($value_type) { 19 + $this->valueType = $value_type; 20 + return $this; 21 + } 22 + 17 23 public function getValueType() { 18 - // TODO: Improve. 19 - return 'custom'; 24 + return $this->valueType; 20 25 } 21 26 22 27 public function getMetadata() {
+8
src/infrastructure/customfield/field/PhabricatorCustomField.php
··· 1323 1323 } 1324 1324 1325 1325 1326 + public function shouldAppearInConduitTransactions() { 1327 + if ($this->proxy) { 1328 + return $this->proxy->shouldAppearInConduitDictionary(); 1329 + } 1330 + return false; 1331 + } 1332 + 1333 + 1326 1334 /* -( Herald )------------------------------------------------------------- */ 1327 1335 1328 1336
+4
src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php
··· 433 433 ->setEditTypeKey($short); 434 434 } 435 435 436 + public function shouldAppearInConduitTransactions() { 437 + return true; 438 + } 439 + 436 440 }
+6
src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php
··· 191 191 } 192 192 } 193 193 194 + public function shouldAppearInConduitTransactions() { 195 + // TODO: Dates are complicated and we don't yet support handling them from 196 + // Conduit. 197 + return false; 198 + } 199 + 194 200 }