[Rt-commit] rt 01/03: Provide user messages and don't show inner details like dashboard ids

Jim Brandt jbrandt at bestpractical.com
Thu Jul 15 17:58:56 UTC 2021


This is an automated email from the git hooks/post-receive script.

jbrandt pushed a commit to branch 5.0/use-dashboard-for-homepage-select-ui
in repository rt.

commit 4534a514ac6d59175d197284c67437378a4da023
Author: Jim Brandt <jbrandt at bestpractical.com>
AuthorDate: Thu Jul 15 11:47:34 2021 -0400

    Provide user messages and don't show inner details like dashboard ids
---
 share/html/Elements/MyRT | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/share/html/Elements/MyRT b/share/html/Elements/MyRT
index 4e5571a5b7..0ebf9a4145 100644
--- a/share/html/Elements/MyRT
+++ b/share/html/Elements/MyRT
@@ -74,19 +74,22 @@ unless ( $Portlets ) {
     my $dashboard = RT::Dashboard->new($system_default_id == $dashboard_id ? RT->SystemUser : $session{'CurrentUser'});
     my ( $ok, $msg ) = $dashboard->LoadById( $dashboard_id );
     if ( !$ok ) {
+        my $user_msg = loc('Unable to load selected dashboard, it may have been deleted');
         if ( $dashboard_id == $system_default_id ) {
-            $m->out($m->scomp('/Elements/ListActions', actions => $msg));
+            RT->Logger->warn("Unable to load dashboard: $msg");
+            $m->out($m->scomp('/Elements/ListActions', actions => $user_msg));
             return;
         }
         else {
             my ( $ok, $sys_msg ) = $dashboard->LoadById( $system_default_id );
             if ( $ok ) {
-                $m->out($m->scomp('/Elements/ListActions', actions => [$msg, loc('Fallback to system default homepage')]));
+                $m->out($m->scomp('/Elements/ListActions', actions => [$user_msg, loc('Setting homepage to system default homepage')]));
                 my ( $ok, $msg ) = $user->DeletePreferences( 'DefaultDashboard' );
                 RT->Logger->error( "Couldn't delete DefaultDashboard of user " . $user->Name . ": $msg" ) unless $ok;
             }
             else {
-                $m->out($m->scomp('/Elements/ListActions', actions => [$msg, $sys_msg]));
+                RT->Logger->warn("Unable to load dashboard: $msg $sys_msg");
+                $m->out($m->scomp('/Elements/ListActions', actions => $user_msg));
                 return;
             }
         }

-- 
To stop receiving notification emails like this one, please contact
sysadmin at bestpractical.com.


More information about the rt-commit mailing list