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

Use correct viewer for debug.stop-on-redirect

Summary:
See <https://github.com/facebook/phabricator/pull/563>.

I think this secondary construction of a `$user` is very old, and predates subsequent changes which cause a proper user to construct earlier, so using the user on the `$request` should (I think) always work. I couldn't immediately find any cases where it does not.

Test Plan: With `debug.stop-on-redirect` set, hit various redirects, like jump-naving to T1. Got a proper stop dialog.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D8718
This commit is contained in:
epriestley 2014-04-08 10:27:05 -07:00
parent b937bf5946
commit 58ba8e7d63

View file

@ -41,16 +41,17 @@ class AphrontRedirectResponse extends AphrontResponse {
public function buildResponseString() { public function buildResponseString() {
if ($this->shouldStopForDebugging()) { if ($this->shouldStopForDebugging()) {
$user = new PhabricatorUser(); $request = $this->getRequest();
$viewer = $request->getUser();
$view = new PhabricatorStandardPageView(); $view = new PhabricatorStandardPageView();
$view->setRequest($this->getRequest()); $view->setRequest($this->getRequest());
$view->setApplicationName('Debug'); $view->setApplicationName(pht('Debug'));
$view->setTitle('Stopped on Redirect'); $view->setTitle(pht('Stopped on Redirect'));
$dialog = new AphrontDialogView(); $dialog = new AphrontDialogView();
$dialog->setUser($user); $dialog->setUser($viewer);
$dialog->setTitle('Stopped on Redirect'); $dialog->setTitle(pht('Stopped on Redirect'));
$dialog->appendParagraph( $dialog->appendParagraph(
pht( pht(
@ -68,7 +69,7 @@ class AphrontRedirectResponse extends AphrontResponse {
$dialog->appendChild( $dialog->appendChild(
id(new AphrontStackTraceView()) id(new AphrontStackTraceView())
->setUser($user) ->setUser($viewer)
->setTrace($this->stackWhenCreated)); ->setTrace($this->stackWhenCreated));
$dialog->setIsStandalone(true); $dialog->setIsStandalone(true);