1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-29 10:12:41 +01:00

Herald Rule Creation Page: fix Back button in some cases

Summary:
If you want to create a new Herald Rule, sometime,
like for new "Object" Herald Rules, the Back button just
sends you to the very same page you already were.

The risk is that an employee could receive a specific
instruction, such as "Hey Alfreda, Go back, now"
and at this point Alfreda goes into an incredible loop
continuing to click the Back button until the duration
of the universe (since Phorge is so stable that it's able
to handle that "Back spike" forever - really).

https://we.phorge.it/T15184

Note that this also tries to avoid to change the base URI
to just go Back. For example, before this change, the Back
button was trying to send from /create/ to /new/, but
apparently they are just aliases.

Closes T15184

Test Plan:
- Visit the page /herald/create/?adapter=commit
- Click on "Object"
- Click on "Back"
- Verify that you only went back one screen, and not just forward in time

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15184

Differential Revision: https://we.phorge.it/D25087
This commit is contained in:
Valerio Bozzolan 2023-03-27 20:51:34 +02:00
parent f0618d54e8
commit 780e86acf8

View file

@ -333,8 +333,8 @@ final class HeraldNewController extends HeraldController {
$cancel_params = $params; $cancel_params = $params;
unset($cancel_params['type']); unset($cancel_params['type']);
$cancel_uri = $this->getApplicationURI('new/'); $cancel_uri = $this->getApplicationURI('create/');
$cancel_uri = new PhutilURI($cancel_uri, $params); $cancel_uri = new PhutilURI($cancel_uri, $cancel_params);
$form->appendChild( $form->appendChild(
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())