Fix call to isGlobalDragAndDropUploadEnabled() from pages with no controller
Summary: Fixes T7902. Some kinds of error pages, including the 404 page, may not have a controller when they reach this method. Test Plan: Hit 404 page. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T7902 Differential Revision: https://secure.phabricator.com/D12538
This commit is contained in:
@@ -643,13 +643,19 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView {
|
|||||||
if ($console) {
|
if ($console) {
|
||||||
$console_config = $this->getConsoleConfig();
|
$console_config = $this->getConsoleConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$upload_enabled = false;
|
||||||
|
if ($controller) {
|
||||||
|
$upload_enabled = $controller->isGlobalDragAndDropUploadEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'title' => $this->getTitle(),
|
'title' => $this->getTitle(),
|
||||||
'aphlictDropdownData' => array(
|
'aphlictDropdownData' => array(
|
||||||
$dropdown_query->getNotificationData(),
|
$dropdown_query->getNotificationData(),
|
||||||
$dropdown_query->getConpherenceData(),
|
$dropdown_query->getConpherenceData(),
|
||||||
),
|
),
|
||||||
'globalDragAndDrop' => $controller->isGlobalDragAndDropUploadEnabled(),
|
'globalDragAndDrop' => $upload_enabled,
|
||||||
'aphlictDropdowns' => $rendered_dropdowns,
|
'aphlictDropdowns' => $rendered_dropdowns,
|
||||||
'hisecWarningConfig' => $hisec_warning_config,
|
'hisecWarningConfig' => $hisec_warning_config,
|
||||||
'consoleConfig' => $console_config,
|
'consoleConfig' => $console_config,
|
||||||
|
|||||||
Reference in New Issue
Block a user