From faa7c313f767600c554fcbfb6321819c3f96c3e6 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 15 Nov 2012 17:05:11 +0100 Subject: [PATCH] Sortier-Spec nicht auf Klassenebene cachen MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Das geht bei Verwendung von FCGI kaputt, weil die sich gegenseitig komisch überschreiben. --- SL/Controller/Helper/Sorted.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SL/Controller/Helper/Sorted.pm b/SL/Controller/Helper/Sorted.pm index c9e577911..98c0a7c10 100644 --- a/SL/Controller/Helper/Sorted.pm +++ b/SL/Controller/Helper/Sorted.pm @@ -11,7 +11,7 @@ our @EXPORT = qw(make_sorted get_sort_spec get_current_sort_params set_report_ge use constant PRIV => '__sortedhelperpriv'; -my $controller_sort_spec; +my %controller_sort_spec; sub make_sorted { my ($class, %specs) = @_; @@ -35,7 +35,7 @@ sub make_sorted { $specs{ONLY} ||= []; $specs{ONLY} = [ $specs{ONLY} ] if !ref $specs{ONLY}; - $controller_sort_spec = \%specs; + $controller_sort_spec{$class} = \%specs; my %hook_params = @{ $specs{ONLY} } ? ( only => $specs{ONLY} ) : (); $class->run_before('_save_current_sort_params', %hook_params); @@ -53,7 +53,7 @@ sub make_sorted { sub get_sort_spec { my ($class_or_self) = @_; - return $controller_sort_spec; + return $controller_sort_spec{ref($class_or_self) || $class_or_self}; } sub get_current_sort_params { -- 2.20.1