X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FDBUpgrade2.pm;h=3918ad40d3615114fb6cb68d52f09730f15cc660;hb=d1d70f4ad540f4d57d1b577b337b6db38074e223;hp=82bd27f259ad644d7880af4ae26a55a04f6e661e;hpb=2b31bcbfb48ad1ef8da19703e1a2d1fa832026c6;p=kivitendo-erp.git diff --git a/SL/DBUpgrade2.pm b/SL/DBUpgrade2.pm index 82bd27f25..3918ad40d 100644 --- a/SL/DBUpgrade2.pm +++ b/SL/DBUpgrade2.pm @@ -98,12 +98,17 @@ sub parse_dbupdate_controls { _control_error($form, $file_name, sprintf($locale->text("Missing 'description' field."))) ; } + delete @{$control}{qw(depth applied)}; + + my @unknown_keys = grep { !m{^ (?: depends | description | file | ignore | locales | may_fail | priority | superuser_privileges | tag ) $}x } keys %{ $control }; + if (@unknown_keys) { + _control_error($form, $file_name, sprintf($locale->text("Unknown control fields: #1", join(' ', sort({ lc $a cmp lc $b } @unknown_keys))))); + } + $control->{"priority"} *= 1; $control->{"priority"} ||= 1000; $control->{"file"} = $file; - delete @{$control}{qw(depth applied)}; - $all_controls{$control->{"tag"}} = $control; close(IN); @@ -315,14 +320,6 @@ sub unapplied_upgrade_scripts { return grep { !$_->{applied} } @all_scripts; } -sub update2_available { - my ($self, $dbh) = @_; - - my @unapplied_scripts = $self->unapplied_upgrade_scripts($dbh); - - return !!@unapplied_scripts; -} - sub apply_admin_dbupgrade_scripts { my ($self, $called_from_admin) = @_; @@ -652,14 +649,6 @@ to the database that is checked. Requires that the scripts have been parsed. -=item C - -Returns trueish if at least one upgrade script hasn't been applied to -a database yet. C<$dbh> is an open handle to the database that is -checked. - -Requires that the scripts have been parsed. - =back =head1 BUGS