From 899abf7a2b534131d3d4a34016526558494d1fdc Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Mon, 20 May 2024 18:47:00 +0200 Subject: [PATCH] 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 --- .../transactions/editengine/PhabricatorEditEngine.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/applications/transactions/editengine/PhabricatorEditEngine.php b/src/applications/transactions/editengine/PhabricatorEditEngine.php index d63a66e8f3..4cc9914fe2 100644 --- a/src/applications/transactions/editengine/PhabricatorEditEngine.php +++ b/src/applications/transactions/editengine/PhabricatorEditEngine.php @@ -1676,6 +1676,7 @@ abstract class PhabricatorEditEngine ->setUser($viewer) ->setHeaderText($header_text) ->setAction($comment_uri) + ->setRequestURI(new PhutilURI($this->getObjectViewURI($object))) ->setRequiresMFA($requires_mfa) ->setObject($object) ->setEditEngine($this)