@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.

Fix control state for custom application policies with template types

Summary:
Fixes T9118. When populating some policy controls like "Default Can View" for repositories, we do some special logic to add object policies which are valid for the target object type.

For example, it's OK to set the default policy for an object which has subscribers to "Subscribers".

However, this logic incorrectly //removed// custom policies, so the form input ended up blank.

Instead, provide both object policies and custom policies.

Test Plan:
- Set default view policy to a custom policy.
- Hit "Edit" again, saw control correctly reflect custom policy after change.
- Set default edit policy to a different custom policy.
- Saved, edited, verified both policies stuck.
- Set both policies back.
- Checked some other object types to make sure object policies still work properly.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9118

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

+6 -1
+6 -1
src/applications/meta/controller/PhabricatorApplicationEditController.php
··· 145 145 ->setViewer($user) 146 146 ->setObject($template_object) 147 147 ->execute(); 148 - $control->setPolicies($template_policies); 148 + 149 + // NOTE: We want to expose both any object template policies 150 + // (like "Subscribers") and any custom policy. 151 + $all_policies = $template_policies + $policies; 152 + 153 + $control->setPolicies($all_policies); 149 154 $control->setTemplateObject($template_object); 150 155 } 151 156 }