Paginated-Controller-Helfer: undef-Warnungen vermeiden
authorMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 9 Feb 2015 15:08:05 +0000 (16:08 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 13 Feb 2015 10:39:53 +0000 (11:39 +0100)
SL/Controller/Helper/GetModels/Paginated.pm

index ad5e10c..d900c18 100644 (file)
@@ -32,8 +32,8 @@ sub read_params {
   my $source = $self->get_models->source;
 
   my $from_form = {
-    page            => $source->{ $self->form_params->[0] } || 1,
-    per_page        => $source->{ $self->form_params->[1] } * 1,
+    page            =>  $source->{ $self->form_params->[0] } || 1,
+    per_page        => ($source->{ $self->form_params->[1] } // 0) * 1,
   };
 
 #  my $priv              = _priv($self);