Page MenuHomePhorge

Cryptic exception when listing tasks "Closed By: Current Viewer" while logged out
Closed, ResolvedPublic

Description

Upstreaming from https://phabricator.wikimedia.org/T217984

Steps to reproduce:

  1. Phorge at 428f9686c4171912ee186ebd919640a7427da768, PHP 8.2.14
  2. Go to http://phorge.localhost/maniphest/query/advanced/
  3. Set "Closed By" to "Current Viewer" and Search.
  4. Copy the resulting query URL
  5. Open that URL in an incognito browser window without being logged into Phorge (thus: "Current Viewer" is not set).

Expected results:
An error message which allows the user to potentially understand what went wrong, and allows them to correct.

Actual results:

This datasource ("PhabricatorPeopleUserFunctionDatasource") can not evaluate the function "viewer(...)".
Depth	Library	File	Where
27	phorge	applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php : 280	PhabricatorTypeaheadDatasource::parseFunction()
26	phorge	view/form/control/AphrontFormTokenizerControl.php : 76	PhabricatorTypeaheadDatasource::renderTokens()
25	phorge	view/form/control/AphrontFormControl.php : 183	AphrontFormTokenizerControl::renderInput()
24	phorge	view/AphrontView.php : 222	AphrontFormControl::render()
23	phorge	infrastructure/markup/render.php : 115	AphrontView::producePhutilSafeHTML()

Proposal n. 1

If login is required, just redirect to the login form instead of crashing.

Proposal n. 2

Event Timeline

valerio.bozzolan updated the task description. (Show Details)
valerio.bozzolan subscribed.

This fix was super-interesting. Thanks again for the report.