[Rt-commit] rt branch 5.0/statement-timeout updated. rt-5.0.3-146-gbd6c545d2a
BPS Git Server
git at git.bestpractical.com
Tue Nov 22 22:20:16 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/statement-timeout has been updated
via bd6c545d2a300bf94d22d238be5a2c9078575335 (commit)
from fbde6b177a37a2ad679ec26dbee54de6d14ff4ba (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 bd6c545d2a300bf94d22d238be5a2c9078575335
Author: sunnavy <sunnavy at bestpractical.com>
Date: Wed Nov 23 05:42:01 2022 +0800
Show end users a hint about SQL error
diff --git a/lib/RT/Handle.pm b/lib/RT/Handle.pm
index 294f532ad6..ebc5510b0d 100644
--- a/lib/RT/Handle.pm
+++ b/lib/RT/Handle.pm
@@ -2906,6 +2906,18 @@ sub _CanonilizeObjectCustomFieldValue {
}
}
+sub SimpleQuery {
+ my $self = shift;
+ my $ret = $self->SUPER::SimpleQuery(@_);
+ return $ret if $ret;
+
+ # Show end user something if query failed.
+ if ($HTML::Mason::Commands::m) {
+ $HTML::Mason::Commands::m->notes( 'SQLError' => 1 );
+ }
+ return $ret;
+}
+
__PACKAGE__->FinalizeDatabaseType;
RT::Base->_ImportOverlays();
diff --git a/share/html/Elements/Footer b/share/html/Elements/Footer
index 556efcc950..ee89f30470 100644
--- a/share/html/Elements/Footer
+++ b/share/html/Elements/Footer
@@ -78,6 +78,13 @@
</pre>
% }
</div>
+% if ( $m->notes('SQLError') ) {
+<script type="text/javascript">
+jQuery( function() {
+ jQuery.jGrowl(<% loc('Page content might be inaccurate because of SQL error. Please contact your admin, they can find more details in the logs.') |j %>, { sticky: true, themeState: 'none' });
+} );
+</script>
+% }
</body>
</html>
<%ARGS>
-----------------------------------------------------------------------
Summary of changes:
lib/RT/Handle.pm | 12 ++++++++++++
share/html/Elements/Footer | 7 +++++++
2 files changed, 19 insertions(+)
hooks/post-receive
--
rt
More information about the rt-commit
mailing list