From 2a795624e688aac06545b650217b947a0f08a899 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 20 Jun 2011 13:34:45 +0200 Subject: [PATCH] Warnung "no statement is executing" vermeiden --- SL/OE.pm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/SL/OE.pm b/SL/OE.pm index 0fd91a437..2ff682bde 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -802,14 +802,16 @@ sub retrieve { $sth = prepare_execute_query($form, $dbh, $query, @values); $ref = $sth->fetchrow_hashref("NAME_lc"); - map { $form->{$_} = $ref->{$_} } keys %$ref; - $form->{saved_xyznumber} = $form->{$form->{type} =~ /_quotation$/ ? - "quonumber" : "ordnumber"}; + if ($ref) { + map { $form->{$_} = $ref->{$_} } keys %$ref; - # set all entries for multiple ids blank that yield different information - while ($ref = $sth->fetchrow_hashref("NAME_lc")) { - map { $form->{$_} = '' if ($ref->{$_} ne $form->{$_}) } keys %$ref; + $form->{saved_xyznumber} = $form->{$form->{type} =~ /_quotation$/ ? "quonumber" : "ordnumber"}; + + # set all entries for multiple ids blank that yield different information + while ($ref = $sth->fetchrow_hashref("NAME_lc")) { + map { $form->{$_} = '' if ($ref->{$_} ne $form->{$_}) } keys %$ref; + } } # if not given, fill transdate with current_date -- 2.20.1