diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php --- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php +++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php @@ -2552,6 +2552,36 @@ idx($groups, $field->getFieldKey(), array())); } break; + + case PhabricatorTransactions::TYPE_EDGE: + if (!$object instanceof PhabricatorCustomFieldInterface) { + break; + } + + $groups = array(); + foreach ($xactions as $xaction) { + $groups[$xaction->getMetadataValue('edge:type')][] = $xaction; + } + + $field_list = PhabricatorCustomField::getObjectFields( + $object, + PhabricatorCustomField::ROLE_EDIT); + $field_list->setViewer($this->getActor()); + + $role_xactions = PhabricatorCustomField::ROLE_APPLICATIONTRANSACTIONS; + foreach ($field_list->getFields() as $field) { + if (!$field->shouldEnableForRole($role_xactions)) { + continue; + } + $errors[] = $field->validateApplicationTransactions( + $this, + $type, + idx( + $groups, + $field->getApplicationTransactionEdgeConstant(), + array())); + } + break; } return array_mergev($errors); 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 @@ -862,6 +862,32 @@ return array(); } + /** + * @task appxaction + */ + public function getApplicationTransactionEdgeType() { + if ($this->proxy) { + return $this->proxy->getApplicationTransactionEdgeType(); + } + return null; + } + + /** + * @task appxaction + */ + final public function getApplicationTransactionEdgeConstant() { + if ($this->proxy) { + return $this->proxy->getApplicationTransactionEdgeConstant(); + } + + $edge = $this->getApplicationTransactionEdgeType(); + if ($edge === null) { + return null; + } + + return $edge->getEdgeConstant(); + } + /** * @task appxaction