@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 scope of "Accept" when you don't check all the "Force Accept" boxes

Summary:
Ref T12272. I wrote this correctly, then broke it by adding the simplification which treats "accept the defaults" as "accept everything".

This simplification lets us render "epriestley accepted this revision." instead of "epriestley accepted this revision onbehalf of: long, list, of, every, default, reviewer, they, have, authority, over." so it's a good thing, but make it only affect the reviewers it's supposed to affect.

Test Plan:
- Did an accept with a force-accept available but unchecked.
- Before patch: incorrectly accepted all possible reviewers.
- After patch: accepted only checked reviewers.
- Also checked the force-accept box, accepted, got a proper force-accept.

Reviewers: chad, lvital

Reviewed By: lvital

Maniphest Tasks: T12272

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

+13 -2
+13 -2
src/applications/differential/xaction/DifferentialRevisionReviewTransaction.php
··· 183 183 // In all cases, you affect yourself. 184 184 $map[$viewer->getPHID()] = $status; 185 185 186 - // If the user has submitted a specific list of reviewers to act as (by 187 - // unchecking some checkboxes under "Accept"), only affect those reviewers. 186 + // If we're applying an "accept the defaults" transaction, and this 187 + // transaction type uses checkboxes, replace the value with the list of 188 + // defaults. 189 + if (!is_array($value)) { 190 + list($options, $default) = $this->getActionOptions($viewer, $revision); 191 + if ($options) { 192 + $value = $default; 193 + } 194 + } 195 + 196 + // If we have a specific list of reviewers to act on, usually because the 197 + // user has submitted a specific list of reviewers to act as by 198 + // unchecking some checkboxes under "Accept", only affect those reviewers. 188 199 if (is_array($value)) { 189 200 $map = array_select_keys($map, $value); 190 201 }