Bugzilla – Attachment 52061 Details for
Bug 16637
Dependency for C4::Tags not listed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16637: Dependency for C4::Tags not listed
Bug-16637-Dependency-for-C4Tags-not-listed.patch (text/plain), 3.07 KB, created by
Marcel de Rooy
on 2016-06-05 07:15:24 UTC
(
hide
)
Description:
Bug 16637: Dependency for C4::Tags not listed
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2016-06-05 07:15:24 UTC
Size:
3.07 KB
patch
obsolete
>From ecdc58487410fca5a063f5d572163bc289bc8f78 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Sat, 4 Jun 2016 11:11:00 -0400 >Subject: [PATCH] Bug 16637: Dependency for C4::Tags not listed >Content-Type: text/plain; charset=utf-8 > >Added optional dependency, so as to explain why testing >explodes when the Enhanced Content system preference >TagsExternalDictionary is set. It is optional, because not only >does TagsExternalDictionary have to be set, but TagsEnabled >must be 'Allow'. > >Also tweaked C4/Tags.pm to ignore TagsExternalDictionary, >if Lingua::Ispell is not installed. A warning is given. > >TEST PLAN >--------- > 1) Set the Enhanced Content system preference > TagsExternalDictionary to /usr/bin/ispell > > 2) sudo apt-get install liblingua-ispell-perl > -- should be a new install > > 3) prove t/db_dependent/Tags.t > -- should work fine > > 4) sudo apt-get remove liblingua-ispell-perl > > 5) prove t/db_dependent/Tags.t > -- should explode > > 6) Clear the Enhanced Content system preference > TagsExternalDictionary > > 7) prove t/db_dependent/Tags.t > -- should work fine > > 8) apply patch > > 9) prove t/db_dependent/Tags.t > -- should work fine > >10) Set the Enhanced Content system preference > TagsExternalDictionary to /usr/bin/ispell > >11) prove t/db_dependent/Tags.t > -- should work, with warning. > >12) sudo apt-get install liblingua-ispell-perl > >13) prove t/db_dependent/Tags.t > -- should work fine > >14) run koha qa test tools. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Post-hackfest hotel Olympia lobby signoff. Kalimera! >Works as expected. >At this moment the Tags.t test does not need the database btw, >but the module should have much more test coverage. >--- > C4/Installer/PerlDependencies.pm | 5 +++++ > C4/Tags.pm | 5 +++++ > 2 files changed, 10 insertions(+) > >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/C4/Tags.pm b/C4/Tags.pm >index c964bc1..1db7acc 100644 >--- a/C4/Tags.pm >+++ b/C4/Tags.pm >@@ -25,6 +25,7 @@ use Exporter; > > use C4::Context; > use C4::Debug; >+use Module::Load::Conditional qw/check_install/; > #use Data::Dumper; > use constant TAG_FIELDS => qw(tag_id borrowernumber biblionumber term language date_created); > use constant TAG_SELECT => "SELECT " . join(',', TAG_FIELDS) . "\n FROM tags_all\n"; >@@ -50,6 +51,10 @@ BEGIN { > ); > # %EXPORT_TAGS = (); > my $ext_dict = C4::Context->preference('TagsExternalDictionary'); >+ if ( $ext_dict && ! check_install( module => 'Lingua::Ispell' ) ) { >+ warn "Ignoring TagsExternalDictionary, because Lingua::Ispell is not installed."; >+ $ext_dict = q{}; >+ } > if ($debug) { > require Data::Dumper; > import Data::Dumper qw(:DEFAULT); >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16637
:
51958
|
52059
|
52060
|
52061
|
52100