[Rt-commit] rt branch, 4.6/reapply-remove-invalid-dashboards-from-menu, created. rt-4.4.2-92-geccbf30bb
? sunnavy
sunnavy at bestpractical.com
Thu Feb 15 16:54:47 EST 2018
The branch, 4.6/reapply-remove-invalid-dashboards-from-menu has been created
at eccbf30bb87480ce085e2f547e077c8750c575e1 (commit)
- Log -----------------------------------------------------------------
commit eccbf30bb87480ce085e2f547e077c8750c575e1
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Feb 16 05:21:41 2018 +0800
reapply dropped changes of "Remove dashboard from menu if it can't be loaded"
original commit is bc441b84, it's been merged but the
RemoveDashboardMenuItem call in /Elements/Tabs got dropped accidently
later(probably when we merged another change to move related code to
MenuBuilder.pm)
diff --git a/lib/RT/Interface/Web/MenuBuilder.pm b/lib/RT/Interface/Web/MenuBuilder.pm
index d68ad6cbc..3c06eb5ad 100644
--- a/lib/RT/Interface/Web/MenuBuilder.pm
+++ b/lib/RT/Interface/Web/MenuBuilder.pm
@@ -113,7 +113,13 @@ sub BuildMainNav {
if ( $status ) {
push @dashboards, $dash;
} else {
- $RT::Logger->warning( "Failed to load dashboard $id: $msg" );
+ $RT::Logger->debug( "Failed to load dashboard $id: $msg, removing from menu" );
+ $home->RemoveDashboardMenuItem(
+ DashboardId => $id,
+ CurrentUser => $HTML::Mason::Commands::session{CurrentUser}->UserObj,
+ );
+ @{ $HTML::Mason::Commands::session{'dashboards_in_menu'} } =
+ grep { $_ != $id } @{ $HTML::Mason::Commands::session{'dashboards_in_menu'} };
}
}
-----------------------------------------------------------------------
More information about the rt-commit
mailing list