[Rt-commit] r12611 - in rt/branches/3.8-TESTING: share/html/Search share/html/Search/Elements

alexmv at bestpractical.com alexmv at bestpractical.com
Wed May 21 16:04:19 EDT 2008


Author: alexmv
Date: Wed May 21 16:03:50 2008
New Revision: 12611

Modified:
   rt/branches/3.8-TESTING/   (props changed)
   rt/branches/3.8-TESTING/share/html/Search/Build.html
   rt/branches/3.8-TESTING/share/html/Search/Elements/BuildFormatString

Log:
 r32060 at kohr-ah:  chmrr | 2008-05-21 16:03:08 -0400
  * <%once> blocks are Often More Evil Than You Think


Modified: rt/branches/3.8-TESTING/share/html/Search/Build.html
==============================================================================
--- rt/branches/3.8-TESTING/share/html/Search/Build.html	(original)
+++ rt/branches/3.8-TESTING/share/html/Search/Build.html	Wed May 21 16:03:50 2008
@@ -270,6 +270,8 @@
     cfqueues => $queues,
     Format => $query{'Format'},
 );
+warn "AvailableColumns is $AvailableColumns\n";
+warn "Got CFs: @{[grep {/CustomField/} @{$AvailableColumns}]}\n";
 
 # }}}
 

Modified: rt/branches/3.8-TESTING/share/html/Search/Elements/BuildFormatString
==============================================================================
--- rt/branches/3.8-TESTING/share/html/Search/Elements/BuildFormatString	(original)
+++ rt/branches/3.8-TESTING/share/html/Search/Elements/BuildFormatString	Wed May 21 16:03:50 2008
@@ -63,7 +63,10 @@
 $SelectDisplayColumns => undef
 $CurrentDisplayColumns => undef
 </%ARGS>
-<%ONCE>
+<%init>
+# This can't be in a <once> block, because otherwise we return the
+# same \@fields every request, and keep tacking more CustomFields onto
+# it -- and it grows per request.
 
 # All the things we can display in the format string by default
 my @fields = qw(
@@ -93,8 +96,6 @@
     NEWLINE
 );
 
-</%ONCE>
-<%init>
 $m->callback( CallbackOnce => 1, CallbackName => 'SetFieldsOnce', Fields => \@fields );
 
 my $CustomFields = RT::CustomFields->new( $session{'CurrentUser'});


More information about the Rt-commit mailing list