[Rt-commit] rt branch 5.0/log-sql-even-without-currentuser updated. rt-5.0.3-25-g5bab1ebbcb

BPS Git Server git at git.bestpractical.com
Fri Jul 29 12:43:54 UTC 2022


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/log-sql-even-without-currentuser has been updated
       via  5bab1ebbcb38d4b8b9069e4e64e83a9d51ca76c2 (commit)
      from  0f56a9626bb203e786693cb6a769248ee076ee0a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5bab1ebbcb38d4b8b9069e4e64e83a9d51ca76c2
Author: Jason Crome <jcrome at bestpractical.com>
Date:   Fri Jul 29 08:42:45 2022 -0400

    Log recorded SQL statements, even without CurrentUser
    
    The RT CLI also calls this function, but may not provide a current user.
    This ensures statements still get logged without error.

diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index f997f941f3..33c6b6b21c 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -1408,7 +1408,7 @@ sub LogRecordedSQLStatements {
         }
         $RT::Logger->log(
             level   => $log_sql_statements,
-            message => ($HTML::Mason::Commands::session{'CurrentUser'}->Name // '')
+            message => ($HTML::Mason::Commands::session{'CurrentUser'} ? $HTML::Mason::Commands::session{'CurrentUser'}->Name : '')
                 . " - "
                 . "SQL("
                 . sprintf( "%.6f", $duration )

-----------------------------------------------------------------------

Summary of changes:
 lib/RT/Interface/Web.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list