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

Refactor PhabricatorBadgesEditRecipientsController to remove dead code

Summary: `$form` in `$dialog = id(new AphrontDialogView())->appendForm($form)` is only defined when `if ($can_edit)` was `true` beforehand. But that was always true. Thus add a variable definition (and remove some unused variables like `$form_box`).

Test Plan:
Visit the page /badges/recipients/1/ or also directly /badges/recipients/1/add/ and add some recipients. It still works as before.

Visit the page without enough permissions. It does not allow to edit them, as before.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25744

+9 -20
+9 -20
src/applications/badges/controller/PhabricatorBadgesEditRecipientsController.php
··· 49 49 ->setURI($view_uri); 50 50 } 51 51 52 - $can_edit = PhabricatorPolicyFilter::hasCapability( 53 - $viewer, 54 - $badge, 55 - PhabricatorPolicyCapability::CAN_EDIT); 56 - 57 - $form_box = null; 58 - $title = pht('Add Recipient'); 59 - if ($can_edit) { 60 - $header_name = pht('Edit Recipients'); 61 - 62 - $form = new AphrontFormView(); 63 - $form 64 - ->setUser($viewer) 65 - ->setFullWidth(true) 66 - ->appendControl( 67 - id(new AphrontFormTokenizerControl()) 68 - ->setName('phids') 69 - ->setLabel(pht('Recipients')) 70 - ->setDatasource(new PhabricatorPeopleDatasource())); 71 - } 52 + $form = new AphrontFormView(); 53 + $form 54 + ->setUser($viewer) 55 + ->setFullWidth(true) 56 + ->appendControl( 57 + id(new AphrontFormTokenizerControl()) 58 + ->setName('phids') 59 + ->setLabel(pht('Recipients')) 60 + ->setDatasource(new PhabricatorPeopleDatasource())); 72 61 73 62 $dialog = id(new AphrontDialogView()) 74 63 ->setUser($viewer)