[Rt-commit] rtir branch, 4.0/correct-redirect-on-update, created. 4.0.0-44-g23ba2c1

Jim Brandt jbrandt at bestpractical.com
Wed May 31 14:22:00 EDT 2017


The branch, 4.0/correct-redirect-on-update has been created
        at  23ba2c1520f5109866ecb747c3f73cf4f977afdc (commit)

- Log -----------------------------------------------------------------
commit 23ba2c1520f5109866ecb747c3f73cf4f977afdc
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Wed May 31 13:47:44 2017 -0400

    Redirect to the correct display page from Update.html
    
    Update.html executes Display.html to process ticket updates
    similar to the flow in RT. However, RTIR has a custom Display.html
    page for incidents. The default RTIR/Display.html checks for custom
    display pages and issues a redirect to RTIR/Incident/Display.html
    for incident updates. This results in a 302 back to the browser which
    generates a subsequent GET request to the correct Display.html page.
    This moves all of the previous POST args to the URI string, which
    can result in Request-URL string too long errors.
    
    Move the custom page detection logic to Update.html so it can
    execute the correct page without the extra redirect.

diff --git a/html/RTIR/Update.html b/html/RTIR/Update.html
index 369898c..767f16f 100644
--- a/html/RTIR/Update.html
+++ b/html/RTIR/Update.html
@@ -243,6 +243,13 @@ if ( !$checks_failure && $SubmitTicket ) {
 if ( !$checks_failure && $SubmitTicket ) {
     $m->callback(CallbackName => 'BeforeDisplay', ARGSRef => \%ARGS, Ticket => $Ticket);
 
+    # Use the custom display page for this type if it exists
+    my $RTIR_Lifecycle = RT::IR::TicketType( Lifecycle => $Ticket->QueueObj->Lifecycle );
+    if ( $RTIR_Lifecycle and $m->comp_exists("/RTIR/$RTIR_Lifecycle/Display.html") ) {
+        return $m->comp("/RTIR/$RTIR_Lifecycle/Display.html", %ARGS);
+    }
+
+    # Default display page for remaining lifecycles
     return $m->comp('/RTIR/Display.html', %ARGS);
 }
 

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


More information about the rt-commit mailing list