From a8f429cdbf4d9b71c5ed871060edcaadad6632e9 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 31 May 2021 23:38:04 -0700 Subject: [PATCH] Correct an issue where "dashboard.panel.edit" fatals in the API console Summary: Ref T13650. Currently, viewing the API console help page for this method fatals because it constructs a generic, untyped panel. As a step toward improving this, generate a concrete panel type instead. This isn't the best possible fix, see T13650 for discussion. Test Plan: Viewed "dashboard.panel.edit" API page, now saw a usable page. Maniphest Tasks: T13650 Differential Revision: https://secure.phabricator.com/D21668 --- .../editor/PhabricatorDashboardPanelEditEngine.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/applications/dashboard/editor/PhabricatorDashboardPanelEditEngine.php b/src/applications/dashboard/editor/PhabricatorDashboardPanelEditEngine.php index 223f15135f..129f28b347 100644 --- a/src/applications/dashboard/editor/PhabricatorDashboardPanelEditEngine.php +++ b/src/applications/dashboard/editor/PhabricatorDashboardPanelEditEngine.php @@ -71,6 +71,17 @@ final class PhabricatorDashboardPanelEditEngine return $panel; } + protected function newEditableObjectForDocumentation() { + $panel = parent::newEditableObjectForDocumentation(); + + $text_type = id(new PhabricatorDashboardTextPanelType()) + ->getPanelTypeKey(); + + $panel->setPanelType($text_type); + + return $panel; + } + protected function newObjectQuery() { return new PhabricatorDashboardPanelQuery(); }