From d6df6c2b7503996dd133599e06aec8edf91f98c5 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Tue, 30 Jan 2018 18:22:42 +0000 Subject: [PATCH] Bug 12932: When all modules installed, Perl version check ignored The description in comment #0 is quite true, because the scope of the $checkmodule variable is local to just the module checking. If we change the scope, we can include the perl check as part of the new scope, and thus properly set its value. As Debian Jessie, Stretch and Ubuntu Xenial all have good versions of Perl by default, the easiest way to test this is to: - make sure to have some optional modules not installed. - change the system preference 'Version' to one just under the current version in your SQL client. - modify the version check line to 5.030000 - restart_all and try going to the staff client. -- This should not inform you that your perl version is bad. - git reset hard back to origin/master - apply the patch - modify the version check line to 5.030000 - change the system preference 'Version' to one just under the current version in your SQL client. - restart_all and try going to the staff client. -- This should trigger the patch, and you should be informed your perl version is bad. - git reset hard back to origin/master - apply the patch - run koha qa test tools --- installer/install.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/installer/install.pl b/installer/install.pl index bf0b9d1..a7aaa28 100755 --- a/installer/install.pl +++ b/installer/install.pl @@ -89,11 +89,13 @@ if ( $step && $step == 1 ) { #Whenever there is an error, adding a report to the page my $op = $query->param('op') || 'noop'; $template->param( language => 1 ); + my $checkmodule = 1; $template->param( 'checkmodule' => 1 ) ; # we start with the assumption that there are no problems and set this to 0 if there are unless ( $] >= 5.010000 ) { # Bug 7375 $template->param( problems => 1, perlversion => 1, checkmodule => 0 ); + $checkmodule = 0; } my $perl_modules = C4::Installer::PerlModules->new; @@ -102,7 +104,6 @@ if ( $step && $step == 1 ) { my $modules = $perl_modules->get_attr('missing_pm'); if ( scalar(@$modules) ) { my @components = (); - my $checkmodule = 1; foreach (@$modules) { my ( $module, $stats ) = each %$_; $checkmodule = 0 if $stats->{'required'}; -- 2.1.4