From ccacef74f97842c0297a735fe7d81987adb5e6d6 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 16 Nov 2012 11:43:49 +0100 Subject: [PATCH] Paginated-Controller-Helfer: Sortier-Spec nicht auf Klassenebene cachen --- SL/Controller/Helper/Paginated.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SL/Controller/Helper/Paginated.pm b/SL/Controller/Helper/Paginated.pm index d3da20dc0..11eddd32d 100644 --- a/SL/Controller/Helper/Paginated.pm +++ b/SL/Controller/Helper/Paginated.pm @@ -7,7 +7,7 @@ our @EXPORT = qw(make_paginated get_paginate_spec get_current_paginate_params _s use constant PRIV => '__paginatedhelper_priv'; -my $controller_paginate_spec; +my %controller_paginate_spec; sub make_paginated { my ($class, %specs) = @_; @@ -20,7 +20,7 @@ sub make_paginated { $specs{ONLY} = [ $specs{ONLY} ] if !ref $specs{ONLY}; $specs{ONLY_MAP} = @{ $specs{ONLY} } ? { map { ($_ => 1) } @{ $specs{ONLY} } } : { '__ALL__' => 1 }; - $controller_paginate_spec = \%specs; + $controller_paginate_spec{$class} = \%specs; my %hook_params = @{ $specs{ONLY} } ? ( only => $specs{ONLY} ) : (); $class->run_before('_save_current_paginate_params', %hook_params); @@ -38,7 +38,7 @@ sub make_paginated { sub get_paginate_spec { my ($class_or_self) = @_; - return $controller_paginate_spec; + return $controller_paginate_spec{ref($class_or_self) || $class_or_self}; } sub get_current_paginate_params { -- 2.20.1