[Rt-commit] rtir branch, 2.9/stop-clobbering-session-collection, created. 3.0.0rc1-52-gfc567dd

Kevin Falcone falcone at bestpractical.com
Fri Apr 19 16:01:04 EDT 2013


The branch, 2.9/stop-clobbering-session-collection has been created
        at  fc567ddc88d4549bb11ca99c6f6183759ae9f9fc (commit)

- Log -----------------------------------------------------------------
commit 8d3cc5fa0fe36afdd48c8e834b40ea5fc07737b2
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Tue Sep 25 18:05:53 2012 -0400

    Stop clobbering the collection of tickets stored in your session
    
    Without this, things like Incident/Reply.html will stick the search for
    IRs into your session, on top of a recent search you did. It also makes
    the last search on your homepage your current session search.
    
    However, we do need to update the session when showing search results,
    so we'll keep the option of clobbering $session{'tickets'} around and
    use it in Results.html.
    
    This really just needs to reuse RT search infrastructure.
    
    ---
    For 2.9 this was originally done in 7e9cf5268.
    This commit comes from a 2.6 branch, and ensures that CurrentSearchHash
    isn't clobbered on every result display.

diff --git a/html/RTIR/Search/Elements/ShowResults b/html/RTIR/Search/Elements/ShowResults
index ffcb238..4fe0f1f 100644
--- a/html/RTIR/Search/Elements/ShowResults
+++ b/html/RTIR/Search/Elements/ShowResults
@@ -6,8 +6,6 @@ $BaseURL = RT->Config->Get('WebPath')."/$BaseURL" unless $BaseURL =~ m{^/};
 $BaseURL .= ( $BaseURL =~ /\?/ )? '&': '?' unless $BaseURL =~ m{[&?]$};
 
 my $collection = RT::Tickets->new( $session{'CurrentUser'} );
-$session{'tickets'} = $collection if $UpdateSession;
-
 $collection->FromSQL( $Query );
 
 my $result = $m->scomp( '/Elements/TicketList',
@@ -23,14 +21,17 @@ my $result = $m->scomp( '/Elements/TicketList',
     AllowSorting   => $AllowSorting,
 );
 
-$session{'CurrentSearchHash'} = {
-    Format      => $Format,
-    Query       => $Query,
-    Page        => $Page,
-    Order       => $Order,
-    OrderBy     => $OrderBy,
-    RowsPerPage => $Rows
-};
+if ( $UpdateSession ) {
+    $session{'tickets'} = $collection;
+    $session{'CurrentSearchHash'} = {
+        Format      => $Format,
+        Query       => $Query,
+        Page        => $Page,
+        Order       => $Order,
+        OrderBy     => $OrderBy,
+        RowsPerPage => $Rows
+    };
+}
 
 my $found = $collection->Count;
 if ( $found || $ShowEmpty ) {

commit fc567ddc88d4549bb11ca99c6f6183759ae9f9fc
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Wed Sep 26 10:28:58 2012 -0400

    Nothing ever thaws the limits, so stop freezing.
    
    This is incredibly old copied code.

diff --git a/html/RTIR/Elements/PickRestriction b/html/RTIR/Elements/PickRestriction
index f5406db..0968621 100644
--- a/html/RTIR/Elements/PickRestriction
+++ b/html/RTIR/Elements/PickRestriction
@@ -23,7 +23,6 @@
 %# 
 %# END LICENSE BLOCK
 <form method="get">
-<input type="hidden" name="Bookmark" value="<% $session{'tickets'}->FreezeLimits()|u %>" />
 <input type="hidden" name="Queue" value="<%$ARGS{'Queue'}%>" />
 <&| /Widgets/TitleBox, title => loc('Refine search')&>
 <input type="hidden" name="id" value="<%$ARGS{'id'}%>" />

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


More information about the Rt-commit mailing list