mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-27 14:09:11 +01:00
Improve recovery from panel action rendering exceptions, and mark "Changeset" queries as not suitable for panel generation
Summary: Fixes T13443. When a panel raises an exception during edit action generation, it currently escapes to top level. Instead, catch it more narrowly. Additionally, mark "ChangesetSearchEngine" as not being a suitable search engine for use in query panels. There's no list view or search URI so it can't generate a sensible panel. Test Plan: - Added a changeset panel to a dashboard. - Before: entire dashboard fataled. - After: panel fataled narrowly, menu fatals narrowly, dashboard no longer permits creation of another Changeset query panel. Maniphest Tasks: T13443 Differential Revision: https://secure.phabricator.com/D20902
This commit is contained in:
parent
a3f4cbd748
commit
72f82abe07
2 changed files with 14 additions and 3 deletions
|
@ -329,9 +329,16 @@ final class PhabricatorDashboardPanelRenderingEngine extends Phobject {
|
||||||
$actions = array();
|
$actions = array();
|
||||||
|
|
||||||
if ($panel) {
|
if ($panel) {
|
||||||
|
try {
|
||||||
$panel_actions = $panel->newHeaderEditActions(
|
$panel_actions = $panel->newHeaderEditActions(
|
||||||
$viewer,
|
$viewer,
|
||||||
$context_phid);
|
$context_phid);
|
||||||
|
} catch (Exception $ex) {
|
||||||
|
$error_action = id(new PhabricatorActionView())
|
||||||
|
->setIcon('fa-exclamation-triangle red')
|
||||||
|
->setName(pht('<Rendering Exception>'));
|
||||||
|
$panel_actions[] = $error_action;
|
||||||
|
}
|
||||||
|
|
||||||
if ($panel_actions) {
|
if ($panel_actions) {
|
||||||
foreach ($panel_actions as $panel_action) {
|
foreach ($panel_actions as $panel_action) {
|
||||||
|
|
|
@ -22,6 +22,10 @@ final class DifferentialChangesetSearchEngine
|
||||||
return 'PhabricatorDifferentialApplication';
|
return 'PhabricatorDifferentialApplication';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function canUseInPanelContext() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public function newQuery() {
|
public function newQuery() {
|
||||||
$query = id(new DifferentialChangesetQuery());
|
$query = id(new DifferentialChangesetQuery());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue