mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-02 01:48:23 +01:00
Make CelerityController extend PhabricatorController
Summary: Currently, CelerityController extends AphrontController, not PhabricatorController. (I think I imagined Celerity being somewhat stand-alone and didn't want to create a dependency.) This creates a concrete problem if a static resource is missing, since we throw an exception, but the higher-level exception handlers depend on the User existing in order to show an appropriate response page. This is the only controller which doesn't extend PhabricatorController, and it doesn't seem worthwhile to make a weird edge case out of it. Specific repro case is: - Remove `externals/javelin/` (or forget to run `git submodule update --init`). - Load a static resource. - Get "[Rendering Exception] Argument 1 passed to PhabricatorMainMenuView::setUser() must be an instance of PhabricatorUser, null given, called in /services/apache/phabricator/phabricator/src/view/page/PhabricatorStandardPageView.php on line 435 and defined" Test Plan: - Followed above steps, no more fataling. - Verified this is the only weird controller. Reviewers: voldern, vrana, btrahan Reviewed By: voldern CC: aran Differential Revision: https://secure.phabricator.com/D3389
This commit is contained in:
parent
bc6aa91059
commit
7fbcdfc52c
2 changed files with 10 additions and 2 deletions
|
@ -1289,7 +1289,7 @@ phutil_register_library_map(array(
|
|||
'AphrontTypeaheadTemplateView' => 'AphrontView',
|
||||
'AphrontUsageException' => 'AphrontException',
|
||||
'AphrontWebpageResponse' => 'AphrontResponse',
|
||||
'CelerityResourceController' => 'AphrontController',
|
||||
'CelerityResourceController' => 'PhabricatorController',
|
||||
'CelerityResourceGraph' => 'AbstractDirectedGraph',
|
||||
'CelerityResourceTransformerTestCase' => 'PhabricatorTestCase',
|
||||
'ConduitAPI_arcanist_Method' => 'ConduitAPIMethod',
|
||||
|
|
|
@ -23,12 +23,20 @@
|
|||
*
|
||||
* @group celerity
|
||||
*/
|
||||
final class CelerityResourceController extends AphrontController {
|
||||
final class CelerityResourceController extends PhabricatorController {
|
||||
|
||||
private $path;
|
||||
private $hash;
|
||||
private $package;
|
||||
|
||||
public function shouldRequireLogin() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function shouldRequireEnabledUser() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function willProcessRequest(array $data) {
|
||||
$this->path = $data['path'];
|
||||
$this->hash = $data['hash'];
|
||||
|
|
Loading…
Add table
Reference in a new issue