1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-19 16:58:48 +02:00

Redirect back to object after clicking "Log In to Comment" and login

Summary:
`PhabricatorApplicationTransactionCommentView` performs `$uri = id(new PhutilURI('/login/'))->replaceQueryParam('next', (string)$this->getRequestURI())` but the constructor call in `PhabricatorEditEngine` does not set any `RequestURI` so the `Log In to Comment` button at the bottom of an object view does not redirect back to the object URI after login.

Thus pass a `RequestURI` to `PhabricatorApplicationTransactionCommentView` in the constructor call in `PhabricatorEditEngine`.

Closes T15837

Test Plan: As a Phorge admin, set `policy.allow-public` to true and create a Maniphest task with `Public` view policy.  As an anonymous user, visit the task and click the `Log In to Comment` button at the bottom of the single task view, log in, and see that you get redirected to the task.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15837

Differential Revision: https://we.phorge.it/D25667
This commit is contained in:
Andre Klapper 2024-05-20 18:47:00 +02:00
parent c769125e90
commit 899abf7a2b

View file

@ -1676,6 +1676,7 @@ abstract class PhabricatorEditEngine
->setUser($viewer) ->setUser($viewer)
->setHeaderText($header_text) ->setHeaderText($header_text)
->setAction($comment_uri) ->setAction($comment_uri)
->setRequestURI(new PhutilURI($this->getObjectViewURI($object)))
->setRequiresMFA($requires_mfa) ->setRequiresMFA($requires_mfa)
->setObject($object) ->setObject($object)
->setEditEngine($this) ->setEditEngine($this)