From ce156ea1e42781529561f43b46d3501648cdb34f Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 28 Jun 2013 14:18:40 +0200 Subject: [PATCH] defaults_feature: Standardwerte richtig propagieren --- sql/Pg-upgrade2/defaults_feature.pl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sql/Pg-upgrade2/defaults_feature.pl b/sql/Pg-upgrade2/defaults_feature.pl index 2e1398213..8d9b86360 100644 --- a/sql/Pg-upgrade2/defaults_feature.pl +++ b/sql/Pg-upgrade2/defaults_feature.pl @@ -21,14 +21,17 @@ sub run { # check current configuration and set default variables accordingly, so that # kivitendo's behaviour isn't changed by this update - # if checks are not set in config leave it to the default value + my %old_defaults = ( parts_show_image => 1 ); + foreach my $check (qw(webdav vertreter parts_show_image parts_listing_image)) { - my $check_set = $::lx_office_conf{features}->{$check} ? 1 : 0; - $self->db_query("UPDATE defaults SET $check = ?", bind => [ $check_set ]) if $check_set; + my $check_set = exists $::lx_office_conf{features}->{$check} ? $::lx_office_conf{features}->{$check} : $old_defaults{$check}; + $self->db_query("UPDATE defaults SET $check = ?", bind => [ $check_set ? 1 : 0 ]); } - my $update_column = "UPDATE defaults SET parts_image_css = ?"; - $self->db_query($update_column, bind => [ $::lx_office_conf{features}->{parts_image_css} ]); + if (exists $::lx_office_conf{features}->{parts_image_css}) { + my $update_column = "UPDATE defaults SET parts_image_css = ?"; + $self->db_query($update_column, bind => [ $::lx_office_conf{features}->{parts_image_css} ]); + } return 1; } -- 2.20.1