From: Moritz Bunkus Date: Mon, 20 Jun 2011 11:34:45 +0000 (+0200) Subject: Warnung "no statement is executing" vermeiden X-Git-Tag: release-2.7.0beta1~374 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=2a795624e688aac06545b650217b947a0f08a899;p=kivitendo-erp.git Warnung "no statement is executing" vermeiden --- 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