Commit graph

26 commits

Author SHA1 Message Date
Mark Tompsett
c91b16bd9e Bug 16637: Dependency for C4::Tags not listed
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.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-06-10 18:05:10 +00:00
7d916c380a Bug 16455: Remove the "Too late to run INIT block" from C4::Tags
The pref TagsExternalDictionary is used to tell Lingua::Ispell to use an
other dictionary, different from the default one (/usr/bin/ispell).

To do so we need to set $Lingua::Ispell::path to the expected path.
It's currently done in the INIT block.

If you try to use C4::Tags, you will get the famous "Too late to run
INIT block at C4/Tags.pm line 74." warning. Plack use the INIT block to
load functions at run time, when we are using C4::Tags when hitting a pl
script, the compilation phase is finished and it's "too late to run INIT
block" from C4::Tags.

I do not really know if it has an impact on the behavior of
Lingua::Ispell (i.e. is the path redefined?), but I know that this INIT
block is not executed when we want.

Test plan:
under Plack,
- hit /cgi-bin/koha/opac-search.pl and confirm that the warning does no
longer appears
- Use another dictionnary (??), fill TagsExternalDictionary with its
  path and confirm that it is used by the tags approval system

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-06-06 17:35:58 +00:00
fff754a7fc Bug 16444: Make C4::Tags plack safe
C4::Tags use a package variable to cache the pref
TagsExternalDictionary, it's not needed and not safe.

There is not test plan, just make sure the changes are consistent.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-06-04 07:46:22 +00:00
017699c345 Bug 16011: $VERSION - Remove the $VERSION init
Mainly a
  perl -p -i -e 's/^.*3.07.00.049.*\n//' **/*.pm
Then some adjustements

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-24 17:20:28 +00:00
3830d78d46 Bug 16011: $VERSION - remove use vars $VERSION
perl -p -i -e 's/^(use vars .*)\$VERSION\s?(.*)/$1$2/' **/*.pm

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-24 17:20:26 +00:00
Stefan Weil
64925f7522 Bug 14383: C4: Fix some typos (mostly in comments and documentation)
Most of them were found and fixed using codespell.
Fix also some related grammar issues.

In C4/Serials.pm a variable was renamed to make future codespelling
checks easier.

Signed-off-by: Stefan Weil <sw@weilnetz.de>

http://bugs.koha-community.org/show_bug.cgi?id=14383
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-06-22 17:34:45 -03:00
Jonathan Druart
a6c9bd0eb5 Bug 9978: Replace license header with the correct license (GPLv3+)
Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

http://bugs.koha-community.org/show_bug.cgi?id=9987

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-20 09:59:38 -03:00
Mark Tompsett
32bb90604b Bug 12916 - Use of uninitialized values $max and $min in C4/Tags.pm
When the stratify_tags function is called without any tags, the
$min and $max variables are left undefined, which triggers a
warning message about uninitialized values in the subtraction.

TEST PLAN
---------
1) prove -v t/db_dependent/Tags.t
   -- should succeed, but there is no test for empty tags.
2) Make sure that you have no tags
3) In Opac, go to 'Tag cloud'
4) Check the opac error log file
   (e.g. ~/koha-dev/var/log/koha-opac-error_log) for entries
   regarding uninitialized values $max and $min in C4/Tags.pm
5) apply this patch
6) prove -v t/db_dependent/Tags.t
   -- should still succeed, though no tests are added.
7) Reload page 'Tag cloud'
   -- Result: No additional warnings in opac error log file.

Signed-off-by: Chris <chris@bigballofwax.co.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
New and old tests pass. Works as described.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-30 00:31:36 -03:00
Jared Camins-Esakov
6417e44bc2 Bug 9136: C4::Tags not Plack-compatible
The three module-scoped variables $ext_dict, @fields, and $select_all
were preventing tagging code from working under Plack. I fixed this
by changing the latter two to compile-time constants, and declared the
first with "our $ext_dict;"

To test (under Plack):
1) Try to create a tag before the patch is applied. Note that you get a
   500 error in the AJAX request.
2) Apply patch.
3) Repeat step (1), noticing that this time the tag is created and there
   is no error.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-12-22 15:47:48 -05:00
Paul Poulain
0fb3dda69f Bug 7642 follow-up fix POD
The patch for bug 7642 did not introduce this error, but the QA tools detected it, so I fixed it
2012-10-01 17:42:23 +02:00
Robin Sheat
79e0fb6fd6 Bug 7642 - fix the lost display of tag sizes
This fixes the display of different sized words for differently popular
tags. It is a bit of a refactor of that part of the system, moving
logic to more sensible places (and removing an unused method on the
way.)

Note that it isn't an attempt to reproduce what was there previously,
just to do something similar, and in an easier to change fashion.

Sponsored-By: New Zealand Educational Institute
Signed-off-by: Marc Veron <veron@veron.ch>
Works as expected.
2012-10-01 17:38:27 +02:00
5abd4f0b9b Bug 6679 - [SIGNED-OFF]fixing 23 '"return" statement with explicit "undef"' violations in C4/Tags.pm
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-20 11:40:00 +02:00
Chris Cormack
509d673f10 Bug 7941 : Fix version numbers in modules
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-11 17:29:38 +02:00
295f9e2dcd Bug 6679: Fixing 26 perlcritic violations in C4/Tags.pm
Subroutine prototypes used at line XXX, column 1.  See page 194 of PBP.
(Severity: 5)

Note: Rebased on master 06/09/2012 by jcamins
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-10 15:16:01 +02:00
88b6e0f90a Bug 4330 : Adding copyright headers and fixing FSF addresses
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-28 17:54:25 +02:00
d3c02c6bb6 Bug 7259 - Show a count of items pending approval on staff client home and tools pages
This patch adds count indicators on the staff client home page and
the tools page for the number of items pending approval. On the
home page this includes suggestions, comments, and tags. On the tools
page a count of pending comments and tags is shown.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Counts appear for all types of actionable items listed, all are clickable through to the proper place.

Nice work!
2011-12-08 12:04:28 +01:00
Andrew Elwell
546a0244bb More POD cleanups
Signed-off-by: Andrew Elwell <Andrew.Elwell@gmail.com>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-06-09 08:38:58 -04:00
Paul Poulain
28718d254d bugfix for ???
Tag cloud fixes :
* ordering cloud by tag name, not by weight
* improve behaviour : either display everyone cloud or my cloud only. When clicquing on "Tag cloud" on the top, will display by default everyone cloud. when clicquing on "My tag" (left tab when logged in), the page will display only my tags and my tags only
2009-09-30 11:30:14 +02:00
Joe Atzberger
7c174930ac Bug 2279: TagsModeration effectiveness restored.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-22 15:45:04 -05:00
Joe Atzberger
797c1d5502 Bugfix is_approved() to handle the 3-state nature of approval.
That is, a term is either approved, or rejected, or neither.
Without an external dictionary, most terms will fall into the
latter category.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-05 22:41:40 -05:00
Joe Atzberger
37c25f55b2 Restrict OPAC tags display to approved=>1.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-03 06:00:47 -05:00
Joe Atzberger
a101cd2d82 Tags AJAX integration on OPAC details page, so it behaves like results.
Also, prevent duplicate tags (same user, biblio and term).  Strip
leading/trailing whitespace from term.  Block whitespace terms.
The CSS for details could be enhanced to emphasize tagstatus more.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-29 07:04:54 -05:00
Joe Atzberger
e0c1b0031b Adding basic get_filters to Tags, centralizing "counts" code for Terms Summary.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-29 07:04:41 -05:00
Joe Atzberger
bbb3f00955 Initial commit for Tags back-end moderation. Requires AJAX functions from Output.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-29 06:22:44 -05:00
Joe Atzberger
cbabfaaa5f New subs for moderation, fixed bug to allow multiple sort fields, added POD.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-29 06:22:43 -05:00
Joe Atzberger
524a5cbb21 Tags - module, script and template support for user tagging in OPAC.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-22 18:02:44 -05:00