Page MenuHomePhabricator

D14812.diff
No OneTemporary

D14812.diff

diff --git a/src/applications/policy/editor/PhabricatorPolicyEditEngineExtension.php b/src/applications/policy/editor/PhabricatorPolicyEditEngineExtension.php
--- a/src/applications/policy/editor/PhabricatorPolicyEditEngineExtension.php
+++ b/src/applications/policy/editor/PhabricatorPolicyEditEngineExtension.php
@@ -101,6 +101,7 @@
->setLabel(pht('Space'))
->setEditTypeKey('space')
->setIsCopyable(true)
+ ->setIsLockable(false)
->setIsReorderable(false)
->setAliases(array('space', 'policy.space'))
->setTransactionType($type_space)
@@ -111,6 +112,7 @@
->setValue($object->getSpacePHID());
$fields[] = $space_field;
+ $space_field->setPolicyField($policy_field);
$policy_field->setSpaceField($space_field);
}
}
diff --git a/src/applications/transactions/editfield/PhabricatorSpaceEditField.php b/src/applications/transactions/editfield/PhabricatorSpaceEditField.php
--- a/src/applications/transactions/editfield/PhabricatorSpaceEditField.php
+++ b/src/applications/transactions/editfield/PhabricatorSpaceEditField.php
@@ -3,6 +3,17 @@
final class PhabricatorSpaceEditField
extends PhabricatorEditField {
+ private $policyField;
+
+ public function setPolicyField(PhabricatorPolicyEditField $policy_field) {
+ $this->policyField = $policy_field;
+ return $this;
+ }
+
+ public function getPolicyField() {
+ return $this->policyField;
+ }
+
protected function newControl() {
// NOTE: This field doesn't do anything on its own, it just serves as a
// companion to the associated View Policy field.
@@ -17,4 +28,13 @@
return new ConduitPHIDParameterType();
}
+
+ public function shouldReadValueFromRequest() {
+ return $this->getPolicyField()->shouldReadValueFromRequest();
+ }
+
+ public function shouldReadValueFromSubmit() {
+ return $this->getPolicyField()->shouldReadValueFromSubmit();
+ }
+
}

File Metadata

Mime Type
text/plain
Expires
Sun, Oct 20, 12:56 PM (4 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6736488
Default Alt Text
D14812.diff (1 KB)

Event Timeline