[Rt-commit] rt branch 5.0/optimize-ticket-display created. rt-5.0.3-63-g4d51dbbc3c

BPS Git Server git at git.bestpractical.com
Fri Jul 29 14:27:52 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/optimize-ticket-display has been created
        at  4d51dbbc3cd5c9eca5fa3d90e58de4e0ed246595 (commit)

- Log -----------------------------------------------------------------
commit 4d51dbbc3cd5c9eca5fa3d90e58de4e0ed246595
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Jul 29 10:23:07 2022 -0400

    Skip processing when displaying ticket with no args
    
    A request to Ticket/Display.html with only an id argument
    has no other args to process, so skip running all processing
    code for these display-only requests.
    
    With no args, this processing makes no updates and is
    effectively a no-op on most RTs. However, on some systems
    these processing steps can slow down page display.

diff --git a/share/html/Ticket/Display.html b/share/html/Ticket/Display.html
index 78642411ba..c167bc8f44 100644
--- a/share/html/Ticket/Display.html
+++ b/share/html/Ticket/Display.html
@@ -147,7 +147,17 @@ if ($ARGS{'id'} eq 'new') {
     unless ( $TicketObj->CurrentUserHasRight('ShowTicket') ) {
         Abort("No permission to view newly created ticket #".$TicketObj->id.".", Code => HTTP::Status::HTTP_FORBIDDEN);
     }
+}
+elsif ( $ARGS{'id'} && (scalar keys %ARGS == 1) ) {
+    # Just load the ticket
+    # No updates to do since we have just id and no other args
+    $TicketObj ||= LoadTicket($ARGS{'id'});
+
+    unless ($TicketObj->CurrentUserHasRight('ShowTicket')) {
+        Abort("No permission to view ticket", Code => HTTP::Status::HTTP_FORBIDDEN);
+    }
 } else { 
+    # Load the ticket and process any additional passed args
     $TicketObj ||= LoadTicket($ARGS{'id'});
 
     # fill ACL cache

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


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list