Bug 17882 - C4::Installer::PerlModules::version_info() drops data during error handling
Summary: C4::Installer::PerlModules::version_info() drops data during error handling
Status: RESOLVED DUPLICATE of bug 17990
Alias: None
Product: Koha
Classification: Unclassified
Component: Installation and upgrade (command-line installer) (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: David Cook
QA Contact: Testopia
URL:
Keywords: Academy
Depends on:
Blocks:
 
Reported: 2017-01-11 06:15 UTC by David Cook
Modified: 2017-01-26 23:17 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 17882 - Add missing module test to Installer_PerlModules.t (1.41 KB, patch)
2017-01-11 22:54 UTC, David Cook
Details | Diff | Splinter Review
Bug 17882 - Fix C4::Installer::PerlModules::version_info() (1.70 KB, patch)
2017-01-11 22:58 UTC, David Cook
Details | Diff | Splinter Review
Bug 17882 - Fix C4::Installer::PerlModules::version_info() (1.70 KB, patch)
2017-01-11 23:09 UTC, David Cook
Details | Diff | Splinter Review
Bug 17882 - Add missing module test to Installer_PerlModules.t (1.52 KB, patch)
2017-01-11 23:10 UTC, David Cook
Details | Diff | Splinter Review
Bug 17882 - Fix C4::Installer::PerlModules::version_info() (1.70 KB, patch)
2017-01-11 23:10 UTC, David Cook
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2017-01-11 06:15:17 UTC
If you try something like the following when DateTime isn't installed, instead of seeing the Perl dependency information, you'll see nulls and hard-coded defaults.

my $version_check = $modules->version_info('module'=>"DateTime");

This is only a problem when using version_info with the module parameter. The "all" parameter (as used by koha_perl_deps.pl) works fine.

It looks like a simple copy/paste error, so I'll post a patch for this too soon.
Comment 1 David Cook 2017-01-11 22:54:19 UTC
Created attachment 58851 [details] [review]
Bug 17882 - Add missing module test to Installer_PerlModules.t

Adds a test that checks the values declared for a missing Perl
dependency.
Comment 2 David Cook 2017-01-11 22:58:49 UTC
Created attachment 58852 [details] [review]
Bug 17882 - Fix C4::Installer::PerlModules::version_info()

If you're doing version_info() for a single uninstalled module,
you'll currently get null values and default values instead of
the values defined in C4::Installer::PerlDependencies.

This patch fixes the variable name for the module, and that
allows the correct data to be used.
Comment 3 David Cook 2017-01-11 23:09:24 UTC
Created attachment 58853 [details] [review]
Bug 17882 - Fix C4::Installer::PerlModules::version_info()

If you're doing version_info() for a single uninstalled module,
you'll currently get null values and default values instead of
the values defined in C4::Installer::PerlDependencies.

This patch fixes the variable name for the module, and that
allows the correct data to be used.
Comment 4 David Cook 2017-01-11 23:10:25 UTC
Created attachment 58854 [details] [review]
Bug 17882 - Add missing module test to Installer_PerlModules.t

Adds a test that checks the values declared for a missing Perl
dependency.
Comment 5 David Cook 2017-01-11 23:10:32 UTC
Created attachment 58855 [details] [review]
Bug 17882 - Fix C4::Installer::PerlModules::version_info()

If you're doing version_info() for a single uninstalled module,
you'll currently get null values and default values instead of
the values defined in C4::Installer::PerlDependencies.

This patch fixes the variable name for the module, and that
allows the correct data to be used.
Comment 6 David Cook 2017-01-11 23:18:59 UTC
Test Plan:

1) Apply patch "Bug 17882 - Add missing module test to Installer_PerlModules.t".
2) Run "perl t/Installer_PerlModules.t"
3) Note the following at the end of the test output:

not ok 18 - Minimum version found for missing module

#   Failed test 'Minimum version found for missing module'
#   at t/Installer_PerlModules.t line 48.
#          got: undef
#     expected: '0.9.3'
# Looks like you planned 17 tests but ran 18.
# Looks like you failed 1 test of 18 run.

4) Apply patch "Bug 17882 - Fix C4::Installer::PerlModules::version_info()".
5) Run "perl t/Installer_PerlModules.t"
6) Note the following at the end of the test output:

ok 18 - Minimum version found for missing module
Comment 7 David Cook 2017-01-12 00:07:29 UTC
Arg... just noticed the usage doesn't show up for upgrades and installed modules...
Comment 8 David Cook 2017-01-26 23:17:54 UTC

*** This bug has been marked as a duplicate of bug 17990 ***