From 3a442e98d0ea275d19d056672e8ccc7c8829e6ac Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 13 Jan 2014 13:26:53 +0100 Subject: [PATCH] Bessere Fehlermeldung bei Fehlkonfiguration von GetModels::Sorted werfen --- SL/Controller/Helper/GetModels/Sorted.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SL/Controller/Helper/GetModels/Sorted.pm b/SL/Controller/Helper/GetModels/Sorted.pm index 216215efa..3b03e04f7 100644 --- a/SL/Controller/Helper/GetModels/Sorted.pm +++ b/SL/Controller/Helper/GetModels/Sorted.pm @@ -76,6 +76,12 @@ sub finalize { my %sort_params = $self->read_params; my $sort_spec = $self->specs->{ $sort_params{sort_by} }; + if (!$sort_spec) { + no warnings 'once'; + $::lxdebug->show_backtrace(1); + die "Unknown sort spec '$sort_params{sort_by}'"; + } + $params{sort_by} = "SL::DB::Manager::$sort_spec->{model}"->make_sort_string(sort_by => $sort_spec->{model_column}, sort_dir => $sort_params{sort_dir}); %params; -- 2.20.1