diff --git a/lib/WebGUI/Paginator.pm b/lib/WebGUI/Paginator.pm index c70850e12..04d192bb3 100644 --- a/lib/WebGUI/Paginator.pm +++ b/lib/WebGUI/Paginator.pm @@ -655,7 +655,6 @@ A value to match the dynamicPageNumberKey. =cut sub setDataByQuery { - my ($sth, @row); my $self = shift; my ($sql, $dbh, $unconditional, $placeholders, $dynamicPageNumberKey, $dynamicPageNumberValue) = @_; @@ -691,9 +690,10 @@ sub setDataByQuery { ($self->{_totalRows}) = $dbh->quickArray("select found_rows()"); $self->{_columnNames} = [ $sth->getColumnNames ]; + my @row; while (my $data = $sth->hashRef) { - push(@row,$data); - } + push(@row,$data); + } $self->{_rowRef} = \@row; $self->{_setByQuery} = 1;