diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index abc2a2d16d..ad5f8f8c3e 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -238,6 +238,7 @@ phutil_register_library_map(array( 'ConduitMethodDoesNotExistException' => 'applications/conduit/protocol/exception/ConduitMethodDoesNotExistException.php', 'ConduitMethodNotFoundException' => 'applications/conduit/protocol/exception/ConduitMethodNotFoundException.php', 'ConduitPHIDListParameterType' => 'applications/conduit/parametertype/ConduitPHIDListParameterType.php', + 'ConduitPHIDParameterType' => 'applications/conduit/parametertype/ConduitPHIDParameterType.php', 'ConduitParameterType' => 'applications/conduit/parametertype/ConduitParameterType.php', 'ConduitPingConduitAPIMethod' => 'applications/conduit/method/ConduitPingConduitAPIMethod.php', 'ConduitProjectListParameterType' => 'applications/conduit/parametertype/ConduitProjectListParameterType.php', @@ -248,6 +249,7 @@ phutil_register_library_map(array( 'ConduitStringParameterType' => 'applications/conduit/parametertype/ConduitStringParameterType.php', 'ConduitTokenGarbageCollector' => 'applications/conduit/garbagecollector/ConduitTokenGarbageCollector.php', 'ConduitUserListParameterType' => 'applications/conduit/parametertype/ConduitUserListParameterType.php', + 'ConduitWildParameterType' => 'applications/conduit/parametertype/ConduitWildParameterType.php', 'ConpherenceColumnViewController' => 'applications/conpherence/controller/ConpherenceColumnViewController.php', 'ConpherenceConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceConduitAPIMethod.php', 'ConpherenceConfigOptions' => 'applications/conpherence/config/ConpherenceConfigOptions.php', @@ -4103,6 +4105,7 @@ phutil_register_library_map(array( 'ConduitMethodDoesNotExistException' => 'ConduitMethodNotFoundException', 'ConduitMethodNotFoundException' => 'ConduitException', 'ConduitPHIDListParameterType' => 'ConduitListParameterType', + 'ConduitPHIDParameterType' => 'ConduitListParameterType', 'ConduitParameterType' => 'Phobject', 'ConduitPingConduitAPIMethod' => 'ConduitAPIMethod', 'ConduitProjectListParameterType' => 'ConduitListParameterType', @@ -4113,6 +4116,7 @@ phutil_register_library_map(array( 'ConduitStringParameterType' => 'ConduitListParameterType', 'ConduitTokenGarbageCollector' => 'PhabricatorGarbageCollector', 'ConduitUserListParameterType' => 'ConduitListParameterType', + 'ConduitWildParameterType' => 'ConduitListParameterType', 'ConpherenceColumnViewController' => 'ConpherenceController', 'ConpherenceConduitAPIMethod' => 'ConduitAPIMethod', 'ConpherenceConfigOptions' => 'PhabricatorApplicationConfigOptions', diff --git a/src/applications/conduit/parametertype/ConduitPHIDParameterType.php b/src/applications/conduit/parametertype/ConduitPHIDParameterType.php new file mode 100644 index 0000000000..c10aa2a791 --- /dev/null +++ b/src/applications/conduit/parametertype/ConduitPHIDParameterType.php @@ -0,0 +1,35 @@ +raiseValidationException( + $request, + $key, + pht('Expected PHID, got something else.')); + } + + return $value; + } + + protected function getParameterTypeName() { + return 'phid'; + } + + protected function getParameterFormatDescriptions() { + return array( + pht('A PHID.'), + ); + } + + protected function getParameterExamples() { + return array( + '"PHID-WXYZ-1111222233334444"', + ); + } + +} diff --git a/src/applications/conduit/parametertype/ConduitWildParameterType.php b/src/applications/conduit/parametertype/ConduitWildParameterType.php new file mode 100644 index 0000000000..c2e43a14e9 --- /dev/null +++ b/src/applications/conduit/parametertype/ConduitWildParameterType.php @@ -0,0 +1,22 @@ +setKey('parent') ->setLabel(pht('Parent Task')) ->setDescription(pht('Task to make this a subtask of.')) + ->setConduitDescription(pht('Create as a subtask of another task.')) + ->setConduitTypeDescription(pht('PHID of the parent task.')) ->setAliases(array('parentPHID')) ->setTransactionType(ManiphestTransaction::TYPE_PARENT) ->setHandleParameterType(new ManiphestTaskListHTTPParameterType()) @@ -87,6 +89,8 @@ final class ManiphestEditEngine ->setKey('column') ->setLabel(pht('Column')) ->setDescription(pht('Workboard column to create this task into.')) + ->setConduitDescription(pht('Create into a workboard column.')) + ->setConduitTypeDescription(pht('PHID of workboard column.')) ->setAliases(array('columnPHID')) ->setTransactionType(ManiphestTransaction::TYPE_COLUMN) ->setSingleValue(null) @@ -98,6 +102,8 @@ final class ManiphestEditEngine ->setKey('title') ->setLabel(pht('Title')) ->setDescription(pht('Name of the task.')) + ->setConduitDescription(pht('Rename the task.')) + ->setConduitTypeDescription(pht('New task name.')) ->setTransactionType(ManiphestTransaction::TYPE_TITLE) ->setIsRequired(true) ->setValue($object->getTitle()), @@ -106,6 +112,9 @@ final class ManiphestEditEngine ->setAliases(array('ownerPHID', 'assign', 'assigned')) ->setLabel(pht('Assigned To')) ->setDescription(pht('User who is responsible for the task.')) + ->setConduitDescription(pht('Reassign the task.')) + ->setConduitTypeDescription( + pht('New task owner, or `null` to unassign.')) ->setTransactionType(ManiphestTransaction::TYPE_OWNER) ->setIsCopyable(true) ->setSingleValue($object->getOwnerPHID()) @@ -115,6 +124,8 @@ final class ManiphestEditEngine ->setKey('status') ->setLabel(pht('Status')) ->setDescription(pht('Status of the task.')) + ->setConduitDescription(pht('Change the task status.')) + ->setConduitTypeDescription(pht('New task status constant.')) ->setTransactionType(ManiphestTransaction::TYPE_STATUS) ->setIsCopyable(true) ->setValue($object->getStatus()) @@ -125,6 +136,8 @@ final class ManiphestEditEngine ->setKey('priority') ->setLabel(pht('Priority')) ->setDescription(pht('Priority of the task.')) + ->setConduitDescription(pht('Change the priority of the task.')) + ->setConduitTypeDescription(pht('New task priority constant.')) ->setTransactionType(ManiphestTransaction::TYPE_PRIORITY) ->setIsCopyable(true) ->setValue($object->getPriority()) @@ -134,6 +147,8 @@ final class ManiphestEditEngine ->setKey('description') ->setLabel(pht('Description')) ->setDescription(pht('Task description.')) + ->setConduitDescription(pht('Update the task description.')) + ->setConduitTypeDescription(pht('New task description.')) ->setTransactionType(ManiphestTransaction::TYPE_DESCRIPTION) ->setValue($object->getDescription()), ); diff --git a/src/applications/owners/editor/PhabricatorOwnersPackageEditEngine.php b/src/applications/owners/editor/PhabricatorOwnersPackageEditEngine.php index 65dc42062e..943552b20f 100644 --- a/src/applications/owners/editor/PhabricatorOwnersPackageEditEngine.php +++ b/src/applications/owners/editor/PhabricatorOwnersPackageEditEngine.php @@ -122,9 +122,12 @@ EOTEXT id(new PhabricatorConduitEditField()) ->setKey('paths.set') ->setLabel(pht('Paths')) - ->setDescription(pht('Set paths for this package.')) ->setIsConduitOnly(true) ->setTransactionType(PhabricatorOwnersPackageTransaction::TYPE_PATHS) + ->setConduitDescription( + pht('Overwrite existing package paths with new paths.')) + ->setConduitTypeDescription( + pht('List of dictionaries, each describing a path.')) ->setConduitDocumentation($paths_help), ); } diff --git a/src/applications/paste/editor/PhabricatorPasteEditEngine.php b/src/applications/paste/editor/PhabricatorPasteEditEngine.php index 972c46b099..55ae92a194 100644 --- a/src/applications/paste/editor/PhabricatorPasteEditEngine.php +++ b/src/applications/paste/editor/PhabricatorPasteEditEngine.php @@ -59,38 +59,46 @@ final class PhabricatorPasteEditEngine id(new PhabricatorTextEditField()) ->setKey('title') ->setLabel(pht('Title')) - ->setDescription(pht('Name of the paste.')) ->setTransactionType(PhabricatorPasteTransaction::TYPE_TITLE) + ->setDescription(pht('The title of the paste.')) + ->setConduitDescription(pht('Retitle the paste.')) + ->setConduitTypeDescription(pht('New paste title.')) ->setValue($object->getTitle()), id(new PhabricatorSelectEditField()) ->setKey('language') ->setLabel(pht('Language')) + ->setTransactionType(PhabricatorPasteTransaction::TYPE_LANGUAGE) + ->setAliases(array('lang')) + ->setIsCopyable(true) + ->setOptions($langs) ->setDescription( pht( - 'Programming language to interpret the paste as for syntax '. - 'highlighting. By default, the language is inferred from the '. - 'title.')) - ->setAliases(array('lang')) - ->setTransactionType(PhabricatorPasteTransaction::TYPE_LANGUAGE) - ->setIsCopyable(true) - ->setValue($object->getLanguage()) - ->setOptions($langs), + 'Language used for syntax highlighting. By default, inferred '. + 'from the title.')) + ->setConduitDescription( + pht('Change language used for syntax highlighting.')) + ->setConduitTypeDescription(pht('New highlighting language.')) + ->setValue($object->getLanguage()), id(new PhabricatorTextAreaEditField()) ->setKey('text') ->setLabel(pht('Text')) - ->setDescription(pht('The main body text of the paste.')) ->setTransactionType(PhabricatorPasteTransaction::TYPE_CONTENT) ->setMonospaced(true) ->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL) + ->setDescription(pht('The main body text of the paste.')) + ->setConduitDescription(pht('Change the paste content.')) + ->setConduitTypeDescription(pht('New body content.')) ->setValue($object->getRawContent()), id(new PhabricatorSelectEditField()) ->setKey('status') ->setLabel(pht('Status')) - ->setDescription(pht('Active or archive the paste.')) ->setTransactionType(PhabricatorPasteTransaction::TYPE_STATUS) ->setIsConduitOnly(true) - ->setValue($object->getStatus()) - ->setOptions(PhabricatorPaste::getStatusNameMap()), + ->setOptions(PhabricatorPaste::getStatusNameMap()) + ->setDescription(pht('Active or archived status.')) + ->setConduitDescription(pht('Active or archive the paste.')) + ->setConduitTypeDescription(pht('New paste status constant.')) + ->setValue($object->getStatus()), ); } diff --git a/src/applications/policy/editor/PhabricatorPolicyEditEngineExtension.php b/src/applications/policy/editor/PhabricatorPolicyEditEngineExtension.php index 57720b3ba7..ce534195a5 100644 --- a/src/applications/policy/editor/PhabricatorPolicyEditEngineExtension.php +++ b/src/applications/policy/editor/PhabricatorPolicyEditEngineExtension.php @@ -81,13 +81,14 @@ final class PhabricatorPolicyEditEngineExtension $policy_field = id(new PhabricatorPolicyEditField()) ->setKey($key) ->setLabel($label) - ->setDescription($description) ->setAliases($aliases) ->setIsCopyable(true) ->setCapability($capability) ->setPolicies($policies) ->setTransactionType($type) ->setEditTypeKey($edit) + ->setConduitDescription($description) + ->setConduitTypeDescription(pht('New policy PHID or constant.')) ->setValue($object->getPolicy($capability)); $fields[] = $policy_field; @@ -99,12 +100,14 @@ final class PhabricatorPolicyEditEngineExtension ->setKey('spacePHID') ->setLabel(pht('Space')) ->setEditTypeKey('space') - ->setDescription( - pht('Shifts the object in the Spaces application.')) ->setIsCopyable(true) ->setIsReorderable(false) ->setAliases(array('space', 'policy.space')) ->setTransactionType($type_space) + ->setDescription(pht('Select a space for the object.')) + ->setConduitDescription( + pht('Shift the object between spaces.')) + ->setConduitTypeDescription(pht('New space PHID.')) ->setValue($object->getSpacePHID()); $fields[] = $space_field; diff --git a/src/applications/project/engineextension/PhabricatorProjectsEditEngineExtension.php b/src/applications/project/engineextension/PhabricatorProjectsEditEngineExtension.php index 0775b24464..ccb29d86ef 100644 --- a/src/applications/project/engineextension/PhabricatorProjectsEditEngineExtension.php +++ b/src/applications/project/engineextension/PhabricatorProjectsEditEngineExtension.php @@ -46,19 +46,27 @@ final class PhabricatorProjectsEditEngineExtension ->setKey('projectPHIDs') ->setLabel(pht('Projects')) ->setEditTypeKey('projects') - ->setDescription(pht('Add or remove associated projects.')) ->setAliases(array('project', 'projects')) ->setIsCopyable(true) ->setUseEdgeTransactions(true) - ->setEdgeTransactionDescriptions( - pht('Add projects.'), - pht('Remove projects.'), - pht('Set associated projects, overwriting current value.')) ->setCommentActionLabel(pht('Change Projects')) + ->setDescription(pht('Select projects for the object.')) ->setTransactionType($edge_type) ->setMetadataValue('edge:type', $project_edge_type) ->setValue($project_phids); + $projects_field->setViewer($engine->getViewer()); + + $edit_add = $projects_field->getConduitEditType('projects.add') + ->setConduitDescription(pht('Add projects.')); + + $edit_set = $projects_field->getConduitEditType('projects.set') + ->setConduitDescription( + pht('Set projects, overwriting current value.')); + + $edit_rem = $projects_field->getConduitEditType('projects.remove') + ->setConduitDescription(pht('Remove projects.')); + return array( $projects_field, ); diff --git a/src/applications/subscriptions/engineextension/PhabricatorSubscriptionsEditEngineExtension.php b/src/applications/subscriptions/engineextension/PhabricatorSubscriptionsEditEngineExtension.php index ae67caee12..2898c1202a 100644 --- a/src/applications/subscriptions/engineextension/PhabricatorSubscriptionsEditEngineExtension.php +++ b/src/applications/subscriptions/engineextension/PhabricatorSubscriptionsEditEngineExtension.php @@ -41,18 +41,25 @@ final class PhabricatorSubscriptionsEditEngineExtension ->setKey('subscriberPHIDs') ->setLabel(pht('Subscribers')) ->setEditTypeKey('subscribers') - ->setDescription(pht('Manage subscribers.')) ->setAliases(array('subscriber', 'subscribers')) ->setIsCopyable(true) ->setUseEdgeTransactions(true) - ->setEdgeTransactionDescriptions( - pht('Add subscribers.'), - pht('Remove subscribers.'), - pht('Set subscribers, overwriting current value.')) ->setCommentActionLabel(pht('Change Subscribers')) ->setTransactionType($subscribers_type) ->setValue($sub_phids); + $subscribers_field->setViewer($engine->getViewer()); + + $edit_add = $subscribers_field->getConduitEditType('subscribers.add') + ->setConduitDescription(pht('Add subscribers.')); + + $edit_set = $subscribers_field->getConduitEditType('subscribers.set') + ->setConduitDescription( + pht('Set subscribers, overwriting current value.')); + + $edit_rem = $subscribers_field->getConduitEditType('subscribers.remove') + ->setConduitDescription(pht('Remove subscribers.')); + return array( $subscribers_field, ); diff --git a/src/applications/transactions/editengine/PhabricatorEditEngine.php b/src/applications/transactions/editengine/PhabricatorEditEngine.php index 02e226d7b4..3e2ee9bba9 100644 --- a/src/applications/transactions/editengine/PhabricatorEditEngine.php +++ b/src/applications/transactions/editengine/PhabricatorEditEngine.php @@ -64,6 +64,10 @@ abstract class PhabricatorEditEngine abstract public function getEngineApplicationClass(); abstract protected function buildCustomEditFields($object); + protected function didBuildCustomEditFields($object, array $fields) { + return; + } + public function getFieldsForConfig( PhabricatorEditEngineConfiguration $config) { @@ -82,6 +86,15 @@ abstract class PhabricatorEditEngine $fields = $this->buildCustomEditFields($object); + foreach ($fields as $field) { + $field + ->setViewer($viewer) + ->setObject($object); + } + + $fields = mpull($fields, null, 'getKey'); + $this->didBuildCustomEditFields($object, $fields); + $extensions = PhabricatorEditEngineExtension::getAllEnabledExtensions(); foreach ($extensions as $extension) { $extension->setViewer($viewer); @@ -96,19 +109,22 @@ abstract class PhabricatorEditEngine assert_instances_of($extension_fields, 'PhabricatorEditField'); foreach ($extension_fields as $field) { - $fields[] = $field; + $field + ->setViewer($viewer) + ->setObject($object); + } + + $extension_fields = mpull($extension_fields, null, 'getKey'); + $extension->didBuildCustomEditFields($this, $object, $extension_fields); + + foreach ($extension_fields as $key => $field) { + $fields[$key] = $field; } } $config = $this->getEditEngineConfiguration(); $fields = $config->applyConfigurationToFields($this, $object, $fields); - foreach ($fields as $field) { - $field - ->setViewer($viewer) - ->setObject($object); - } - return $fields; } @@ -1595,6 +1611,11 @@ abstract class PhabricatorEditEngine foreach ($xactions as $xaction) { $type = $types[$xaction['type']]; + // Let the parameter type interpret the value. This allows you to + // use usernames in list fields, for example. + $parameter_type = $type->getConduitParameterType(); + $xaction['value'] = $parameter_type->getValue($xaction, 'value'); + $type_xactions = $type->generateTransactions( clone $template, $xaction); diff --git a/src/applications/transactions/editengine/PhabricatorEditEngineAPIMethod.php b/src/applications/transactions/editengine/PhabricatorEditEngineAPIMethod.php index b5146e6eb3..d29ec1c4ac 100644 --- a/src/applications/transactions/editengine/PhabricatorEditEngineAPIMethod.php +++ b/src/applications/transactions/editengine/PhabricatorEditEngineAPIMethod.php @@ -146,17 +146,16 @@ EOTEXT ); $key = pht('Key'); - $summary = pht('Summary'); $description = pht('Description'); $head_type = pht('Type'); $table = array(); - $table[] = "| {$key} | {$summary} |"; + $table[] = "| {$key} | {$description} |"; $table[] = '|--------|----------------|'; foreach ($types as $type) { $edit_type = $type->getEditType(); - $edit_summary = $type->getSummary(); - $table[] = "| `{$edit_type}` | {$edit_summary} |"; + $edit_description = $type->getConduitDescription(); + $table[] = "| `{$edit_type}` | {$edit_description} |"; } $out[] = implode("\n", $table); @@ -166,7 +165,7 @@ EOTEXT $section[] = pht('Edit Type: %s', $type->getEditType()); $section[] = '---------'; $section[] = null; - $section[] = $type->getDescription(); + $section[] = $type->getConduitDescription(); $section[] = null; $section[] = pht( 'This edit generates transactions of type `%s` internally.', @@ -183,12 +182,8 @@ EOTEXT 'Use `%s` to select this edit type.', $type->getEditType()); - $value_type = $type->getValueType(); - if (!strlen($value_type)) { - $value_type = '?'; - } - - $value_description = $type->getValueDescription(); + $value_type = $type->getConduitType(); + $value_description = $type->getConduitTypeDescription(); $table = array(); $table[] = "| {$key} | {$head_type} | {$description} |"; diff --git a/src/applications/transactions/editengineextension/PhabricatorCommentEditEngineExtension.php b/src/applications/transactions/editengineextension/PhabricatorCommentEditEngineExtension.php index 125ac32b33..a0a303bdc7 100644 --- a/src/applications/transactions/editengineextension/PhabricatorCommentEditEngineExtension.php +++ b/src/applications/transactions/editengineextension/PhabricatorCommentEditEngineExtension.php @@ -41,13 +41,15 @@ final class PhabricatorCommentEditEngineExtension $comment_field = id(new PhabricatorCommentEditField()) ->setKey('comment') ->setLabel(pht('Comments')) - ->setDescription(pht('Add comments.')) ->setAliases(array('comments')) ->setIsHidden(true) ->setIsReorderable(false) ->setIsDefaultable(false) ->setIsLockable(false) ->setTransactionType($comment_type) + ->setConduitDescription(pht('Make comments.')) + ->setConduitTypeDescription( + pht('Comment to add, formatted as remarkup.')) ->setValue(null); return array( diff --git a/src/applications/transactions/editengineextension/PhabricatorEditEngineExtension.php b/src/applications/transactions/editengineextension/PhabricatorEditEngineExtension.php index 9a799d4e5b..d4ff06bb40 100644 --- a/src/applications/transactions/editengineextension/PhabricatorEditEngineExtension.php +++ b/src/applications/transactions/editengineextension/PhabricatorEditEngineExtension.php @@ -32,6 +32,13 @@ abstract class PhabricatorEditEngineExtension extends Phobject { PhabricatorEditEngine $engine, PhabricatorApplicationTransactionInterface $object); + public function didBuildCustomEditFields( + PhabricatorEditEngine $engine, + PhabricatorApplicationTransactionInterface $object, + array $fields) { + return; + } + final public static function getAllExtensions() { return id(new PhutilClassMapQuery()) ->setAncestorClass(__CLASS__) diff --git a/src/applications/transactions/editfield/PhabricatorCommentEditField.php b/src/applications/transactions/editfield/PhabricatorCommentEditField.php index 1ed9e57d43..5d9c2b54da 100644 --- a/src/applications/transactions/editfield/PhabricatorCommentEditField.php +++ b/src/applications/transactions/editfield/PhabricatorCommentEditField.php @@ -11,6 +11,10 @@ final class PhabricatorCommentEditField return new PhabricatorCommentEditType(); } + protected function newConduitParameterType() { + return new ConduitStringParameterType(); + } + public function shouldGenerateTransactionsFromSubmit() { return false; } diff --git a/src/applications/transactions/editfield/PhabricatorConduitEditField.php b/src/applications/transactions/editfield/PhabricatorConduitEditField.php index 4a8af48abb..9fd433ec04 100644 --- a/src/applications/transactions/editfield/PhabricatorConduitEditField.php +++ b/src/applications/transactions/editfield/PhabricatorConduitEditField.php @@ -11,4 +11,8 @@ final class PhabricatorConduitEditField return null; } + protected function newConduitParameterType() { + return new ConduitWildParameterType(); + } + } diff --git a/src/applications/transactions/editfield/PhabricatorEditField.php b/src/applications/transactions/editfield/PhabricatorEditField.php index db69e493a3..7ca483c2b9 100644 --- a/src/applications/transactions/editfield/PhabricatorEditField.php +++ b/src/applications/transactions/editfield/PhabricatorEditField.php @@ -12,10 +12,13 @@ abstract class PhabricatorEditField extends Phobject { private $object; private $transactionType; private $metadata = array(); - private $description; private $editTypeKey; private $isRequired; + + private $description; + private $conduitDescription; private $conduitDocumentation; + private $conduitTypeDescription; private $commentActionLabel; private $commentActionValue; @@ -35,6 +38,8 @@ abstract class PhabricatorEditField extends Phobject { private $isCopyable = false; private $isConduitOnly = false; + private $conduitEditTypes; + public function setKey($key) { $this->key = $key; return $this; @@ -80,15 +85,6 @@ abstract class PhabricatorEditField extends Phobject { return $this->object; } - public function setDescription($description) { - $this->description = $description; - return $this; - } - - public function getDescription() { - return $this->description; - } - public function setIsLocked($is_locked) { $this->isLocked = $is_locked; return $this; @@ -125,6 +121,45 @@ abstract class PhabricatorEditField extends Phobject { return $this->isConduitOnly; } + public function setDescription($description) { + $this->description = $description; + return $this; + } + + public function getDescription() { + return $this->description; + } + + public function setConduitDescription($conduit_description) { + $this->conduitDescription = $conduit_description; + return $this; + } + + public function getConduitDescription() { + if ($this->conduitDescription === null) { + return $this->getDescription(); + } + return $this->conduitDescription; + } + + public function setConduitDocumentation($conduit_documentation) { + $this->conduitDocumentation = $conduit_documentation; + return $this; + } + + public function getConduitDocumentation() { + return $this->conduitDocumentation; + } + + public function setConduitTypeDescription($conduit_type_description) { + $this->conduitTypeDescription = $conduit_type_description; + return $this; + } + + public function getConduitTypeDescription() { + return $this->conduitTypeDescription; + } + public function setIsEditDefaults($is_edit_defaults) { $this->isEditDefaults = $is_edit_defaults; return $this; @@ -516,6 +551,20 @@ abstract class PhabricatorEditField extends Phobject { return new AphrontStringHTTPParameterType(); } + public function getConduitParameterType() { + $type = $this->newConduitParameterType(); + + if (!$type) { + return null; + } + + $type->setViewer($this->getViewer()); + + return $type; + } + + abstract protected function newConduitParameterType(); + public function setEditTypeKey($edit_type_key) { $this->editTypeKey = $edit_type_key; return $this; @@ -529,16 +578,13 @@ abstract class PhabricatorEditField extends Phobject { } protected function newEditType() { - // TODO: This could be a little cleaner. - $http_type = $this->getHTTPParameterType(); - if ($http_type) { - $value_type = $http_type->getTypeName(); - } else { - $value_type = 'wild'; + $parameter_type = $this->getConduitParameterType(); + if (!$parameter_type) { + return null; } return id(new PhabricatorSimpleEditType()) - ->setValueType($value_type); + ->setConduitParameterType($parameter_type); } protected function getEditType() { @@ -549,19 +595,49 @@ abstract class PhabricatorEditField extends Phobject { } $type_key = $this->getEditTypeKey(); + $edit_type = $this->newEditType(); + if (!$edit_type) { + return null; + } - return $this->newEditType() + return $edit_type ->setEditType($type_key) ->setTransactionType($transaction_type) - ->setDescription($this->getDescription()) - ->setMetadata($this->getMetadata()) - ->setConduitDocumentation($this->getConduitDocumentation()); + ->setMetadata($this->getMetadata()); } - public function getConduitEditTypes() { + final public function getConduitEditTypes() { + if ($this->conduitEditTypes === null) { + $edit_types = $this->newConduitEditTypes(); + $edit_types = mpull($edit_types, null, 'getEditType'); + + foreach ($edit_types as $edit_type) { + $edit_type->setEditField($this); + } + + $this->conduitEditTypes = $edit_types; + } + + return $this->conduitEditTypes; + } + + final public function getConduitEditType($key) { + $edit_types = $this->getConduitEditTypes(); + + if (empty($edit_types[$key])) { + throw new Exception( + pht( + 'This EditField does not provide a Conduit EditType with key "%s".', + $key)); + } + + return $edit_types[$key]; + } + + protected function newConduitEditTypes() { $edit_type = $this->getEditType(); - if ($edit_type === null) { + if (!$edit_type) { return array(); } @@ -679,13 +755,8 @@ abstract class PhabricatorEditField extends Phobject { return $edit_type->generateTransactions($template, $spec); } - public function setConduitDocumentation($conduit_documentation) { - $this->conduitDocumentation = $conduit_documentation; - return $this; - } - public function getConduitDocumentation() { - return $this->conduitDocumentation; - } + + } diff --git a/src/applications/transactions/editfield/PhabricatorInstructionsEditField.php b/src/applications/transactions/editfield/PhabricatorInstructionsEditField.php index 02014148ae..67613c4d7f 100644 --- a/src/applications/transactions/editfield/PhabricatorInstructionsEditField.php +++ b/src/applications/transactions/editfield/PhabricatorInstructionsEditField.php @@ -11,4 +11,8 @@ final class PhabricatorInstructionsEditField return null; } + protected function newConduitParameterType() { + return null; + } + } diff --git a/src/applications/transactions/editfield/PhabricatorPHIDListEditField.php b/src/applications/transactions/editfield/PhabricatorPHIDListEditField.php index f2663d2063..b0eee2d465 100644 --- a/src/applications/transactions/editfield/PhabricatorPHIDListEditField.php +++ b/src/applications/transactions/editfield/PhabricatorPHIDListEditField.php @@ -4,7 +4,6 @@ abstract class PhabricatorPHIDListEditField extends PhabricatorEditField { private $useEdgeTransactions; - private $transactionDescriptions = array(); private $isSingleValue; public function setUseEdgeTransactions($use_edge_transactions) { @@ -16,15 +15,6 @@ abstract class PhabricatorPHIDListEditField return $this->useEdgeTransactions; } - public function setEdgeTransactionDescriptions($add, $rem, $set) { - $this->transactionDescriptions = array( - '+' => $add, - '-' => $rem, - '=' => $set, - ); - return $this; - } - public function setSingleValue($value) { if ($value === null) { $value = array(); @@ -44,6 +34,10 @@ abstract class PhabricatorPHIDListEditField return new AphrontPHIDListHTTPParameterType(); } + protected function newConduitParameterType() { + return new ConduitPHIDListParameterType(); + } + protected function getValueFromRequest(AphrontRequest $request, $key) { $value = parent::getValueFromRequest($request, $key); if ($this->getIsSingleValue()) { @@ -105,9 +99,9 @@ abstract class PhabricatorPHIDListEditField return $type; } - public function getConduitEditTypes() { + protected function newConduitEditTypes() { if (!$this->getUseEdgeTransactions()) { - return parent::getConduitEditTypes(); + return parent::newConduitEditTypes(); } $transaction_type = $this->getTransactionType(); @@ -116,27 +110,26 @@ abstract class PhabricatorPHIDListEditField } $type_key = $this->getEditTypeKey(); - $strings = $this->transactionDescriptions; $base = $this->getEditType(); $add = id(clone $base) ->setEditType($type_key.'.add') ->setEdgeOperation('+') - ->setDescription(idx($strings, '+')) - ->setValueDescription(pht('List of PHIDs to add.')); + ->setConduitTypeDescription(pht('List of PHIDs to add.')) + ->setConduitParameterType($this->getConduitParameterType()); $rem = id(clone $base) ->setEditType($type_key.'.remove') ->setEdgeOperation('-') - ->setDescription(idx($strings, '-')) - ->setValueDescription(pht('List of PHIDs to remove.')); + ->setConduitTypeDescription(pht('List of PHIDs to remove.')) + ->setConduitParameterType($this->getConduitParameterType()); $set = id(clone $base) ->setEditType($type_key.'.set') ->setEdgeOperation('=') - ->setDescription(idx($strings, '=')) - ->setValueDescription(pht('List of PHIDs to set.')); + ->setConduitTypeDescription(pht('List of PHIDs to set.')) + ->setConduitParameterType($this->getConduitParameterType()); return array( $add, diff --git a/src/applications/transactions/editfield/PhabricatorPolicyEditField.php b/src/applications/transactions/editfield/PhabricatorPolicyEditField.php index a4457e9fe6..fbe967b4e3 100644 --- a/src/applications/transactions/editfield/PhabricatorPolicyEditField.php +++ b/src/applications/transactions/editfield/PhabricatorPolicyEditField.php @@ -55,4 +55,9 @@ final class PhabricatorPolicyEditField return new AphrontPHIDHTTPParameterType(); } + protected function newConduitParameterType() { + return new ConduitStringParameterType(); + } + + } diff --git a/src/applications/transactions/editfield/PhabricatorProjectsEditField.php b/src/applications/transactions/editfield/PhabricatorProjectsEditField.php index 60e497b4d2..a29e89f1ff 100644 --- a/src/applications/transactions/editfield/PhabricatorProjectsEditField.php +++ b/src/applications/transactions/editfield/PhabricatorProjectsEditField.php @@ -11,4 +11,8 @@ final class PhabricatorProjectsEditField return new AphrontProjectListHTTPParameterType(); } + protected function newConduitParameterType() { + return new ConduitProjectListParameterType(); + } + } diff --git a/src/applications/transactions/editfield/PhabricatorRemarkupEditField.php b/src/applications/transactions/editfield/PhabricatorRemarkupEditField.php index ff0621830f..bb221a0de1 100644 --- a/src/applications/transactions/editfield/PhabricatorRemarkupEditField.php +++ b/src/applications/transactions/editfield/PhabricatorRemarkupEditField.php @@ -7,4 +7,8 @@ final class PhabricatorRemarkupEditField return new PhabricatorRemarkupControl(); } + protected function newConduitParameterType() { + return new ConduitStringParameterType(); + } + } diff --git a/src/applications/transactions/editfield/PhabricatorSelectEditField.php b/src/applications/transactions/editfield/PhabricatorSelectEditField.php index 921e5b3d11..d8e99d610c 100644 --- a/src/applications/transactions/editfield/PhabricatorSelectEditField.php +++ b/src/applications/transactions/editfield/PhabricatorSelectEditField.php @@ -31,4 +31,8 @@ final class PhabricatorSelectEditField ->setOptions($this->getOptions()); } + protected function newConduitParameterType() { + return new ConduitStringParameterType(); + } + } diff --git a/src/applications/transactions/editfield/PhabricatorSpaceEditField.php b/src/applications/transactions/editfield/PhabricatorSpaceEditField.php index 124f0c2ddf..6ad1e27831 100644 --- a/src/applications/transactions/editfield/PhabricatorSpaceEditField.php +++ b/src/applications/transactions/editfield/PhabricatorSpaceEditField.php @@ -13,4 +13,8 @@ final class PhabricatorSpaceEditField return new AphrontPHIDHTTPParameterType(); } + protected function newConduitParameterType() { + return new ConduitPHIDParameterType(); + } + } diff --git a/src/applications/transactions/editfield/PhabricatorSubscribersEditField.php b/src/applications/transactions/editfield/PhabricatorSubscribersEditField.php index 5ead1f23d5..2fdd1e1066 100644 --- a/src/applications/transactions/editfield/PhabricatorSubscribersEditField.php +++ b/src/applications/transactions/editfield/PhabricatorSubscribersEditField.php @@ -13,4 +13,8 @@ final class PhabricatorSubscribersEditField return new AphrontUserListHTTPParameterType(); } + protected function newConduitParameterType() { + return new ConduitUserListParameterType(); + } + } diff --git a/src/applications/transactions/editfield/PhabricatorTextAreaEditField.php b/src/applications/transactions/editfield/PhabricatorTextAreaEditField.php index 6b560c4c9a..2c7b2daa98 100644 --- a/src/applications/transactions/editfield/PhabricatorTextAreaEditField.php +++ b/src/applications/transactions/editfield/PhabricatorTextAreaEditField.php @@ -39,4 +39,8 @@ final class PhabricatorTextAreaEditField return $control; } + protected function newConduitParameterType() { + return new ConduitStringParameterType(); + } + } diff --git a/src/applications/transactions/editfield/PhabricatorTextEditField.php b/src/applications/transactions/editfield/PhabricatorTextEditField.php index 25659d5710..342b0c7157 100644 --- a/src/applications/transactions/editfield/PhabricatorTextEditField.php +++ b/src/applications/transactions/editfield/PhabricatorTextEditField.php @@ -7,4 +7,8 @@ final class PhabricatorTextEditField return new AphrontFormTextControl(); } + protected function newConduitParameterType() { + return new ConduitStringParameterType(); + } + } diff --git a/src/applications/transactions/editfield/PhabricatorUsersEditField.php b/src/applications/transactions/editfield/PhabricatorUsersEditField.php index 0f5cb6dcbe..472d84141e 100644 --- a/src/applications/transactions/editfield/PhabricatorUsersEditField.php +++ b/src/applications/transactions/editfield/PhabricatorUsersEditField.php @@ -11,4 +11,8 @@ final class PhabricatorUsersEditField return new AphrontUserListHTTPParameterType(); } + protected function newConduitParameterType() { + return new ConduitUserListParameterType(); + } + } diff --git a/src/applications/transactions/edittype/PhabricatorCommentEditType.php b/src/applications/transactions/edittype/PhabricatorCommentEditType.php index ee3d840015..2ab24677f7 100644 --- a/src/applications/transactions/edittype/PhabricatorCommentEditType.php +++ b/src/applications/transactions/edittype/PhabricatorCommentEditType.php @@ -2,8 +2,8 @@ final class PhabricatorCommentEditType extends PhabricatorEditType { - public function getValueType() { - return id(new AphrontStringHTTPParameterType())->getTypeName(); + protected function newConduitParameterType() { + return new ConduitStringParameterType(); } public function generateTransactions( @@ -19,8 +19,4 @@ final class PhabricatorCommentEditType extends PhabricatorEditType { return array($xaction); } - public function getValueDescription() { - return pht('Comment to add, formated as remarkup.'); - } - } diff --git a/src/applications/transactions/edittype/PhabricatorEdgeEditType.php b/src/applications/transactions/edittype/PhabricatorEdgeEditType.php index da0be7731f..0c376423cd 100644 --- a/src/applications/transactions/edittype/PhabricatorEdgeEditType.php +++ b/src/applications/transactions/edittype/PhabricatorEdgeEditType.php @@ -34,13 +34,4 @@ final class PhabricatorEdgeEditType return array($xaction); } - public function setValueDescription($value_description) { - $this->valueDescription = $value_description; - return $this; - } - - public function getValueDescription() { - return $this->valueDescription; - } - } diff --git a/src/applications/transactions/edittype/PhabricatorEditType.php b/src/applications/transactions/edittype/PhabricatorEditType.php index b6940f4601..298238aeb1 100644 --- a/src/applications/transactions/edittype/PhabricatorEditType.php +++ b/src/applications/transactions/edittype/PhabricatorEditType.php @@ -3,34 +3,16 @@ abstract class PhabricatorEditType extends Phobject { private $editType; + private $editField; private $transactionType; private $label; private $field; - private $description; - private $summary; private $metadata = array(); + + private $conduitDescription; private $conduitDocumentation; - - public function setDescription($description) { - $this->description = $description; - return $this; - } - - public function getDescription() { - return $this->description; - } - - public function setSummary($summary) { - $this->summary = $summary; - return $this; - } - - public function getSummary() { - if ($this->summary === null) { - return $this->getDescription(); - } - return $this->summary; - } + private $conduitTypeDescription; + private $conduitParameterType; public function setLabel($label) { $this->label = $label; @@ -59,15 +41,6 @@ abstract class PhabricatorEditType extends Phobject { return $this->editType; } - public function setConduitDocumentation($conduit_documentation) { - $this->conduitDocumentation = $conduit_documentation; - return $this; - } - - public function getConduitDocumentation() { - return $this->conduitDocumentation; - } - public function setMetadata($metadata) { $this->metadata = $metadata; return $this; @@ -90,9 +63,6 @@ abstract class PhabricatorEditType extends Phobject { PhabricatorApplicationTransaction $template, array $spec); - abstract public function getValueType(); - abstract public function getValueDescription(); - protected function newTransaction( PhabricatorApplicationTransaction $template) { @@ -106,4 +76,83 @@ abstract class PhabricatorEditType extends Phobject { return $xaction; } + public function setEditField(PhabricatorEditField $edit_field) { + $this->editField = $edit_field; + return $this; + } + + public function getEditField() { + return $this->editField; + } + +/* -( Conduit )------------------------------------------------------------ */ + + + protected function newConduitParameterType() { + if ($this->conduitParameterType) { + return clone $this->conduitParameterType; + } + + return null; + } + + public function setConduitParameterType(ConduitParameterType $type) { + $this->conduitParameterType = $type; + return $this; + } + + public function getConduitParameterType() { + return $this->newConduitParameterType(); + } + + public function getConduitType() { + $parameter_type = $this->getConduitParameterType(); + return $parameter_type->getTypeName(); + } + + public function setConduitTypeDescription($conduit_type_description) { + $this->conduitTypeDescription = $conduit_type_description; + return $this; + } + + public function getConduitTypeDescription() { + if ($this->conduitTypeDescription === null) { + if ($this->getEditField()) { + return $this->getEditField()->getConduitTypeDescription(); + } + } + + return $this->conduitTypeDescription; + } + + public function setConduitDescription($conduit_description) { + $this->conduitDescription = $conduit_description; + return $this; + } + + public function getConduitDescription() { + if ($this->conduitDescription === null) { + if ($this->getEditField()) { + return $this->getEditField()->getConduitDescription(); + } + } + + return $this->conduitDescription; + } + + public function setConduitDocumentation($conduit_documentation) { + $this->conduitDocumentation = $conduit_documentation; + return $this; + } + + public function getConduitDocumentation() { + if ($this->conduitDocumentation === null) { + if ($this->getEditField()) { + return $this->getEditField()->getConduitDocumentation(); + } + } + + return $this->conduitDocumentation; + } + } diff --git a/src/applications/transactions/edittype/PhabricatorPHIDListEditType.php b/src/applications/transactions/edittype/PhabricatorPHIDListEditType.php index 742daff0df..eb728a6808 100644 --- a/src/applications/transactions/edittype/PhabricatorPHIDListEditType.php +++ b/src/applications/transactions/edittype/PhabricatorPHIDListEditType.php @@ -42,4 +42,17 @@ abstract class PhabricatorPHIDListEditType } } + protected function newConduitParameterType() { + $default = parent::newConduitParameterType(); + if ($default) { + return $default; + } + + if ($this->getIsSingleValue()) { + return new ConduitPHIDParameterType(); + } else { + return new ConduitPHIDListParameterType(); + } + } + } diff --git a/src/applications/transactions/edittype/PhabricatorSimpleEditType.php b/src/applications/transactions/edittype/PhabricatorSimpleEditType.php index d41d33f5c3..2d8a31f96c 100644 --- a/src/applications/transactions/edittype/PhabricatorSimpleEditType.php +++ b/src/applications/transactions/edittype/PhabricatorSimpleEditType.php @@ -2,20 +2,6 @@ final class PhabricatorSimpleEditType extends PhabricatorEditType { - private $valueType; - private $valueDescription; - private $phuixControlType; - private $phuixControlSpecification = array(); - - public function setValueType($value_type) { - $this->valueType = $value_type; - return $this; - } - - public function getValueType() { - return $this->valueType; - } - public function generateTransactions( PhabricatorApplicationTransaction $template, array $spec) { @@ -26,13 +12,4 @@ final class PhabricatorSimpleEditType extends PhabricatorEditType { return array($edit); } - public function setValueDescription($value_description) { - $this->valueDescription = $value_description; - return $this; - } - - public function getValueDescription() { - return $this->valueDescription; - } - } diff --git a/src/infrastructure/customfield/editor/PhabricatorCustomFieldEditField.php b/src/infrastructure/customfield/editor/PhabricatorCustomFieldEditField.php index e585853a13..8d448f624b 100644 --- a/src/infrastructure/customfield/editor/PhabricatorCustomFieldEditField.php +++ b/src/infrastructure/customfield/editor/PhabricatorCustomFieldEditField.php @@ -5,6 +5,7 @@ final class PhabricatorCustomFieldEditField private $customField; private $httpParameterType; + private $conduitParameterType; public function setCustomField(PhabricatorCustomField $custom_field) { $this->customField = $custom_field; @@ -25,6 +26,16 @@ final class PhabricatorCustomFieldEditField return $this->httpParameterType; } + public function setCustomFieldConduitParameterType( + ConduitParameterType $type) { + $this->conduitParameterType = $type; + return $this; + } + + public function getCustomFieldConduitParameterType() { + return $this->conduitParameterType; + } + protected function buildControl() { $field = $this->getCustomField(); $clone = clone $field; @@ -36,14 +47,15 @@ final class PhabricatorCustomFieldEditField } protected function newEditType() { - $type = id(new PhabricatorCustomFieldEditType()) - ->setCustomField($this->getCustomField()); - - $http_type = $this->getHTTPParameterType(); - if ($http_type) { - $type->setValueType($http_type->getTypeName()); + $conduit_type = $this->newConduitParameterType(); + if (!$conduit_type) { + return null; } + $type = id(new PhabricatorCustomFieldEditType()) + ->setCustomField($this->getCustomField()) + ->setConduitParameterType($conduit_type); + return $type; } @@ -71,14 +83,14 @@ final class PhabricatorCustomFieldEditField return $clone->getNewValueForApplicationTransactions(); } - public function getConduitEditTypes() { + protected function newConduitEditTypes() { $field = $this->getCustomField(); if (!$field->shouldAppearInConduitTransactions()) { return array(); } - return parent::getConduitEditTypes(); + return parent::newConduitEditTypes(); } protected function newHTTPParameterType() { @@ -91,6 +103,16 @@ final class PhabricatorCustomFieldEditField return null; } + protected function newConduitParameterType() { + $type = $this->getCustomFieldConduitParameterType(); + + if ($type) { + return clone $type; + } + + return null; + } + public function getAllReadValueFromRequestKeys() { $keys = array(); diff --git a/src/infrastructure/customfield/editor/PhabricatorCustomFieldEditType.php b/src/infrastructure/customfield/editor/PhabricatorCustomFieldEditType.php index a247f50d9b..2f8008c699 100644 --- a/src/infrastructure/customfield/editor/PhabricatorCustomFieldEditType.php +++ b/src/infrastructure/customfield/editor/PhabricatorCustomFieldEditType.php @@ -4,7 +4,6 @@ final class PhabricatorCustomFieldEditType extends PhabricatorEditType { private $customField; - private $valueType; public function setCustomField(PhabricatorCustomField $custom_field) { $this->customField = $custom_field; @@ -15,25 +14,11 @@ final class PhabricatorCustomFieldEditType return $this->customField; } - public function setValueType($value_type) { - $this->valueType = $value_type; - return $this; - } - - public function getValueType() { - return $this->valueType; - } - public function getMetadata() { $field = $this->getCustomField(); return parent::getMetadata() + $field->getApplicationTransactionMetadata(); } - public function getValueDescription() { - $field = $this->getCustomField(); - return $field->getFieldDescription(); - } - public function generateTransactions( PhabricatorApplicationTransaction $template, array $spec) { diff --git a/src/infrastructure/customfield/field/PhabricatorCustomField.php b/src/infrastructure/customfield/field/PhabricatorCustomField.php index e0062e6fac..8b4c167d6d 100644 --- a/src/infrastructure/customfield/field/PhabricatorCustomField.php +++ b/src/infrastructure/customfield/field/PhabricatorCustomField.php @@ -1106,6 +1106,11 @@ abstract class PhabricatorCustomField extends Phobject { $field->setCustomFieldHTTPParameterType($http_type); } + $conduit_type = $this->getConduitEditParameterType(); + if ($conduit_type) { + $field->setCustomFieldConduitParameterType($conduit_type); + } + return $field; } @@ -1348,6 +1353,17 @@ abstract class PhabricatorCustomField extends Phobject { return null; } + public function getConduitEditParameterType() { + return $this->newConduitEditParameterType(); + } + + protected function newConduitEditParameterType() { + if ($this->proxy) { + return $this->proxy->newConduitEditParameterType(); + } + return null; + } + /* -( Herald )------------------------------------------------------------- */ diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldBool.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldBool.php index 04ac3ac822..b1fc7f7a9b 100644 --- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldBool.php +++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldBool.php @@ -136,4 +136,9 @@ final class PhabricatorStandardCustomFieldBool protected function newConduitSearchParameterType() { return new ConduitBoolParameterType(); } + + protected function newConduitEditParameterType() { + return new ConduitBoolParameterType(); + } + } diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php index 1114284acf..e208d6d386 100644 --- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php +++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php @@ -202,4 +202,8 @@ final class PhabricatorStandardCustomFieldDate return null; } + protected function newConduitEditParameterType() { + return new ConduitEpochParameterType(); + } + } diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php index ac569ee8bc..4a3e45d757 100644 --- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php +++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php @@ -120,4 +120,8 @@ final class PhabricatorStandardCustomFieldInt return new ConduitIntParameterType(); } + protected function newConduitEditParameterType() { + return new ConduitIntParameterType(); + } + } diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldLink.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldLink.php index 524aaa56e4..904a457616 100644 --- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldLink.php +++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldLink.php @@ -87,4 +87,9 @@ final class PhabricatorStandardCustomFieldLink protected function newConduitSearchParameterType() { return new ConduitStringListParameterType(); } + + protected function newConduitEditParameterType() { + return new ConduitStringParameterType(); + } + } diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldSelect.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldSelect.php index bf835eacc2..db84fc82e8 100644 --- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldSelect.php +++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldSelect.php @@ -143,4 +143,9 @@ final class PhabricatorStandardCustomFieldSelect protected function newConduitSearchParameterType() { return new ConduitStringListParameterType(); } + + protected function newConduitEditParameterType() { + return new ConduitStringParameterType(); + } + } diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldUsers.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldUsers.php index 7625298f39..17f555f7c4 100644 --- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldUsers.php +++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldUsers.php @@ -19,4 +19,8 @@ final class PhabricatorStandardCustomFieldUsers return new ConduitUserListParameterType(); } + protected function newConduitEditParameterType() { + return new ConduitUserListParameterType(); + } + }