@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Prevent "Spaces" field from being set to inconsistent values

Summary:
At least for now, the "Space" field is just a subfield of the "Visible To" field, so:

- it doesn't get any separate settings; and
- it always uses the "Visible To" settings.

Test Plan:
- Created a form with a hidden view policy field.
- Created stuff with no "you must pick a space" errors.
- Created stuff with a normal form.
- Prefilled "Space" on a noraml form.
- Verified that trying to prefill "Space" on a form with "Visible To" hidden does nothing.

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D14812

+22
+2
src/applications/policy/editor/PhabricatorPolicyEditEngineExtension.php
··· 101 101 ->setLabel(pht('Space')) 102 102 ->setEditTypeKey('space') 103 103 ->setIsCopyable(true) 104 + ->setIsLockable(false) 104 105 ->setIsReorderable(false) 105 106 ->setAliases(array('space', 'policy.space')) 106 107 ->setTransactionType($type_space) ··· 111 112 ->setValue($object->getSpacePHID()); 112 113 $fields[] = $space_field; 113 114 115 + $space_field->setPolicyField($policy_field); 114 116 $policy_field->setSpaceField($space_field); 115 117 } 116 118 }
+20
src/applications/transactions/editfield/PhabricatorSpaceEditField.php
··· 3 3 final class PhabricatorSpaceEditField 4 4 extends PhabricatorEditField { 5 5 6 + private $policyField; 7 + 8 + public function setPolicyField(PhabricatorPolicyEditField $policy_field) { 9 + $this->policyField = $policy_field; 10 + return $this; 11 + } 12 + 13 + public function getPolicyField() { 14 + return $this->policyField; 15 + } 16 + 6 17 protected function newControl() { 7 18 // NOTE: This field doesn't do anything on its own, it just serves as a 8 19 // companion to the associated View Policy field. ··· 15 26 16 27 protected function newConduitParameterType() { 17 28 return new ConduitPHIDParameterType(); 29 + } 30 + 31 + 32 + public function shouldReadValueFromRequest() { 33 + return $this->getPolicyField()->shouldReadValueFromRequest(); 34 + } 35 + 36 + public function shouldReadValueFromSubmit() { 37 + return $this->getPolicyField()->shouldReadValueFromSubmit(); 18 38 } 19 39 20 40 }