Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14151035
D20481.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D20481.diff
View Options
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
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 5, 6:58 PM (16 h, 21 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6828512
Default Alt Text
D20481.diff (2 KB)
Attached To
Mode
D20481: Apply custom fields implemented using edges to apply validation logic
Attached
Detach File
Event Timeline
Log In to Comment