Page MenuHomePhabricator

Most complex variation of "column" transaction type in "maniphest.edit" fails to validate
Open, LowPublic

Description

See https://discourse.phabricator-community.org/t/manifest-edit-column-transaction-type-powerful-form-fails-validation/4745/.

PhabricatorColumnsEditField is emitting a PhabricatorDatasourceEditType, which is emitting a default ConduitPHIDListParameterType. The desired parameter type is the one PhabricatorColumnsEditField emits directly, ConduitColumnsParameterType.

A possible fix is something like this:

diff --git a/src/applications/transactions/editfield/PhabricatorPHIDListEditField.php b/src/applications/transactions/editfield/PhabricatorPHIDListEditField.php
index d2b647b9aa..0dbf4f0333 100644
--- a/src/applications/transactions/editfield/PhabricatorPHIDListEditField.php
+++ b/src/applications/transactions/editfield/PhabricatorPHIDListEditField.php
@@ -111,7 +111,8 @@ abstract class PhabricatorPHIDListEditField
 
     return id(new PhabricatorDatasourceEditType())
       ->setIsSingleValue($this->getIsSingleValue())
-      ->setIsNullable($this->getIsNullable());
+      ->setIsNullable($this->getIsNullable())
+      ->setConduitParameterType($this->getConduitParameterType());
   }
 
   protected function newBulkEditTypes() {

However, this general interaction seems somewhat questionable -- presumably there should be some implied relationship between EditType and EditField in their responsibility for selecting a ParameterType? I suspect newConduitParamterType() on EditField may predate EditType, and the most sensible implementation now would be for EditField to default to emitting null, and EditType to default to the value emitted by EditField if it is not null.