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

In Applications, always redirect back to the detail page after edits

Summary:
Ref T12685. When you edit an application's policies but don't make any changes, you currently get stuck on the same page. This isn't how other edit screens work, and I think it's a holdover from eras long ago.

Make it consistent with other applications.

Also, fix a missing `pht()`.

Test Plan:
- Edited an application configuation.
- Clicked "Save" without making changes.
- After patch, was redirected back to detail page like in other applications.

Reviewers: chad, amckinley

Reviewed By: chad

Maniphest Tasks: T12685

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

+15 -20
+15 -20
src/applications/meta/controller/PhabricatorApplicationEditController.php
··· 32 32 if ($request->isFormPost()) { 33 33 $xactions = array(); 34 34 35 - $result = array(); 36 35 $template = $application->getApplicationTransactionTemplate(); 37 36 foreach ($application->getCapabilities() as $capability) { 38 37 if (!$application->isCapabilityEditable($capability)) { ··· 47 46 continue; 48 47 } 49 48 50 - $result[$capability] = $new; 51 - 52 49 $xactions[] = id(clone $template) 53 50 ->setTransactionType( 54 51 PhabricatorApplicationPolicyChangeTransaction::TRANSACTIONTYPE) ··· 58 55 ->setNewValue($new); 59 56 } 60 57 61 - if ($result) { 62 - $editor = id(new PhabricatorApplicationEditor()) 63 - ->setActor($user) 64 - ->setContentSourceFromRequest($request) 65 - ->setContinueOnNoEffect(true) 66 - ->setContinueOnMissingFields(true); 58 + $editor = id(new PhabricatorApplicationEditor()) 59 + ->setActor($user) 60 + ->setContentSourceFromRequest($request) 61 + ->setContinueOnNoEffect(true) 62 + ->setContinueOnMissingFields(true); 67 63 68 - try { 69 - $editor->applyTransactions($application, $xactions); 70 - return id(new AphrontRedirectResponse())->setURI($view_uri); 71 - } catch (PhabricatorApplicationTransactionValidationException $ex) { 72 - $validation_exception = $ex; 73 - } 64 + try { 65 + $editor->applyTransactions($application, $xactions); 66 + return id(new AphrontRedirectResponse())->setURI($view_uri); 67 + } catch (PhabricatorApplicationTransactionValidationException $ex) { 68 + $validation_exception = $ex; 69 + } 74 70 75 - return $this->newDialog() 76 - ->setTitle('Validation Failed') 77 - ->setValidationException($validation_exception) 78 - ->addCancelButton($view_uri); 79 - } 71 + return $this->newDialog() 72 + ->setTitle(pht('Validation Failed')) 73 + ->setValidationException($validation_exception) 74 + ->addCancelButton($view_uri); 80 75 } 81 76 82 77 $descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions(