X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FDBUtils.pm;h=89761443bb378a3380a8722986b6ea0752da1995;hb=0c09beb40eea289ceebb36aa53b447051fb82857;hp=689340ac2299224b8e6ec2c6ec14fff0c5f78e42;hpb=188696a433d68ae7e7546086a4491cdd377d3264;p=kivitendo-erp.git diff --git a/SL/DBUtils.pm b/SL/DBUtils.pm index 689340ac2..89761443b 100644 --- a/SL/DBUtils.pm +++ b/SL/DBUtils.pm @@ -222,11 +222,11 @@ sub selectall_as_map { my %hash; if ('' eq ref $value_col) { while (my $ref = $sth->fetchrow_hashref()) { - $hash{$ref->{$key_col}} = $ref->{$value_col}; + $hash{$ref->{$key_col} // ''} = $ref->{$value_col}; } } else { while (my $ref = $sth->fetchrow_hashref()) { - $hash{$ref->{$key_col}} = { map { $_ => $ref->{$_} } @{ $value_col } }; + $hash{$ref->{$key_col} // ''} = { map { $_ => $ref->{$_} } @{ $value_col } }; } } @@ -389,7 +389,7 @@ __END__ =head1 NAME -SL::DBUTils.pm: All about Databaseconections in Lx +SL::DBUTils.pm: All about database connections in kivitendo =head1 SYNOPSIS @@ -422,7 +422,7 @@ Using DBUtils most database procedures can be reduced to defining the query, exe DBUtils relies heavily on two parameters which have to be passed to almost every function: $form and $dbh. - $form is used for error handling only. It can be omitted in theory, but should not. - - $dbh is a handle to the databe, as returned by the DBI::connect routine. If you don't have an active connectiong, you can query $form->get_standard_dbh() to get a generic no_auto connection. Don't forget to commit in this case! + - $dbh is a handle to the database, as returned by the DBI::connect routine. If you don't have an active connection, you can query $form->get_standard_dbh() to get a generic no_auto connection. Don't forget to commit in this case! Every function here should accomplish the follwing things: