Upstreaming from https://phabricator.wikimedia.org/T217984
Steps to reproduce:
- Phorge at 428f9686c4171912ee186ebd919640a7427da768, PHP 8.2.14
- Go to http://phorge.localhost/maniphest/query/advanced/
- Set "Closed By" to "Current Viewer" and Search.
- Copy the resulting query URL
- 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.