X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/c85291ee4adfab9c21e5d780275221197365e120..fdebfd5d0c558cb156849b01c9c9268b29dc443b:/sql/Pg-upgrade2/defaults_feature.pl diff --git a/sql/Pg-upgrade2/defaults_feature.pl b/sql/Pg-upgrade2/defaults_feature.pl index c46ff3ac3..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 set it to true + 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 ]); + 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; }