From 96f8eef08701d2296bebee75db99557bffb92278 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 3 Jul 2015 10:23:14 +0200 Subject: [PATCH] =?utf8?q?GetModels:=20Disablen=20von=20Plugins=20auch=20f?= =?utf8?q?=C3=BCr=20undef?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Die Dokumentation sagt Folgendes zum Deaktivieren von Plugins: > Configuration for plugins. If the option for any plugin is omitted, > it defaults to enabled and is configured by default. Giving a > falsish value as first argument will disable the plugin. Das bisherige Verhalten war aber, dass bei Übergabe von undef (z.B. »paginated => undef«) die Standardeinstellungen gegriffen haben. --- SL/Controller/Helper/GetModels.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SL/Controller/Helper/GetModels.pm b/SL/Controller/Helper/GetModels.pm index 861834b83..cb73ab354 100644 --- a/SL/Controller/Helper/GetModels.pm +++ b/SL/Controller/Helper/GetModels.pm @@ -95,7 +95,9 @@ sub init { my @plugins; for my $plugin (qw(filtered sorted paginated)) { - next unless my $spec = delete $params{$plugin} // {}; + next if exists($params{$plugin}) && !$params{$plugin}; + + my $spec = delete $params{$plugin} // {}; my $plugin_class = "SL::Controller::Helper::GetModels::" . ucfirst $plugin; push @plugins, $self->$plugin($plugin_class->new(%$spec, get_models => $self)); } -- 2.20.1