Bug 12932

Summary: Web installer's Perl version check will not raise errors if all modules are installed
Product: Koha Reporter: Owen Leonard <oleonard>
Component: Installation and upgrade (web-based installer)Assignee: Mark Tompsett <mtompset>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt, mtompset, nick
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 20104    
Attachments: Bug 12932: When all modules installed, Perl version check ignored
Bug 12932: When all modules installed, Perl version check ignored
Bug 12932: When all modules installed, Perl version check ignored
Bug 12932: When all modules installed, Perl version check ignored

Description Owen Leonard 2014-09-16 15:37:27 UTC
During the web installer process an error variable is set if the Perl version is too old (installer/install.pl starting at line 60):

    $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 );
    }

However, the "checkmodule" error flag gets reset in the following section where required modules are checked. If all required modules are installed the checkmodule variable gets set back to 1 and no error will be raised in the template about the old Perl version.
Comment 1 Mark Tompsett 2018-01-30 19:26:12 UTC Comment hidden (obsolete)
Comment 2 Mark Tompsett 2018-01-30 19:31:33 UTC
sudo apt-get remove libwebservices-ils-perl
-- it's currently the only one that is really not packaged with koha-common.
Comment 3 Mark Tompsett 2018-01-30 19:37:38 UTC
Created attachment 71073 [details] [review]
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
Comment 4 Owen Leonard 2018-01-31 13:30:03 UTC
Created attachment 71087 [details] [review]
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

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 5 Katrin Fischer 2018-02-04 12:29:10 UTC
Created attachment 71175 [details] [review]
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

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Jonathan Druart 2018-02-05 12:58:25 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 7 Nick Clemens (kidclamp) 2018-02-16 02:30:05 UTC
Awesome work all, pushed to stable for 17.11.03