From 1de761a76b26089e0281845b2522dce85a5ecc1a Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Sat, 4 Jun 2016 11:11:00 -0400 Subject: [PATCH] Bug 16637: Optional Dependency not listed If a user decides to set the Enhanced Content system preference TagsExternalDictionary to something (e.g. /usr/bin/ispell), but the Lingua::Ispell perl library is not installed, Koha dies ungracefully. TEST PLAN --------- 1) fill in TagsExternalDictionary system preference 2) check out the Perl modules tab in the about Koha page -- Lingua::Ispell is not listed. 3) sudo apt-get install liblingua-ispell-perl -- likely uninstalled, so this will ensure it is. 4) prove t/db_dependent/Tags.t -- should work fine. 5) sudo apt-get remove liblingua-ispell-perl 6) prove t/db_dependent/Tags.t -- it should die horribly because Lingua::Ispell is not installed. 7) apply patch 8) prove t/db_dependent/Tags.t -- like bug 16582 and the others, all tests will be skipped and a notice given of the missing optional library 9) sudo apt-get install liblingua-ispell-perl 10) prove t/db_dependent/Tags.t -- should run fine 11) check out the Perl modules tab in the about Koha page -- Lingua::Ispell is listed. 12) run koha qa test tools --- C4/Installer/PerlDependencies.pm | 5 +++++ t/db_dependent/Tags.t | 15 ++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/C4/Installer/PerlDependencies.pm b/C4/Installer/PerlDependencies.pm index d84b51c..eded225 100644 --- a/C4/Installer/PerlDependencies.pm +++ b/C4/Installer/PerlDependencies.pm @@ -802,6 +802,11 @@ our $PERL_DEPS = { 'required' => '1', 'min_ver' => '0.14', }, + 'Lingua::Ispell' => { + 'usage' => 'Enhanced Content - Tagging', + 'required' => '0', + 'min_ver' => '0.07' + }, }; 1; diff --git a/t/db_dependent/Tags.t b/t/db_dependent/Tags.t index 5612d3a..a9e68e4 100755 --- a/t/db_dependent/Tags.t +++ b/t/db_dependent/Tags.t @@ -3,15 +3,20 @@ # This Koha test module is a stub! # Add more tests here!!! -use strict; -use warnings; - -use Test::More tests => 32; +use Modern::Perl; +use Test::More; +use Module::Load::Conditional qw/check_install/; BEGIN { - use_ok('C4::Tags'); + if ( check_install( module => 'Lingua::Ispell' ) ) { + plan tests => 32; + } else { + plan skip_all => "Need Lingua::Ispell"; + } } +use_ok('C4::Tags'); + # Check no tags case. my @tagsarray; my $tags = \@tagsarray; -- 2.1.4