From df91c9fde8209d66dab26e657a2b1a4a105b5ee7 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 22 Apr 2013 13:09:01 +0200 Subject: [PATCH] update_defaults: Fall "Spalte noch leer" richtig behandeln MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Bei neu angelegten Datenbanken sind die Nummernkreisspalten NULL, was SL::PrefixedNumber nicht mag. Also in solchen Fällen '0' annehmen. Behebt #2245. --- SL/Form.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/SL/Form.pm b/SL/Form.pm index 8859cae40..5af4dc287 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -3190,6 +3190,7 @@ sub update_defaults { my ($var) = $sth->fetchrow_array; $sth->finish; + $var = 0 if !defined($var) || ($var eq ''); $var = SL::PrefixedNumber->new(number => $var)->get_next; $query = qq|UPDATE defaults SET $fld = ?|; do_query($self, $dbh, $query, $var); -- 2.20.1