Bug 6379 - Remove link from unapproved and rejected tags in the OPAC's "My tags" table
Summary: Remove link from unapproved and rejected tags in the OPAC's "My tags" table
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Bugs List
URL: /cgi-bin/koha/opac-tags.pl
Keywords:
: 10815 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-05-20 15:35 UTC by Owen Leonard
Modified: 2016-06-21 21:40 UTC (History)
7 users (show)

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


Attachments
Bug 6739 : Funds not showing up for super librarians (deleted)
2011-09-02 03:20 UTC, Chris Cormack
Details
Bug 6379: Remove link from unapproved tags (2.75 KB, patch)
2015-03-25 12:46 UTC, Jonathan Druart
Details | Diff | Splinter Review
[Signed-off] Bug 6379: Remove link from unapproved tags (3.00 KB, patch)
2015-03-25 15:29 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 6379: Remove link from unapproved tags (3.84 KB, patch)
2015-03-26 08:50 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 6379: Remove link from unapproved tags (4.01 KB, patch)
2015-05-12 15:01 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 6379: Fix if the reviewer is not the same patron (1.12 KB, patch)
2015-07-10 11:00 UTC, Jonathan Druart
Details | Diff | Splinter Review
[PASSED QA] Bug 6379: Remove link from unapproved tags (4.06 KB, patch)
2015-10-03 20:54 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 6379: Fix if the reviewer is not the same patron (1.19 KB, patch)
2015-10-03 20:55 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2011-05-20 15:35:16 UTC
You can't perform a search of the catalog using unapproved or rejected tags, so the table of the user's tags should not have clickable links for them. There should probably be additional visual feedback to indicate why the term isn't clickable.
Comment 1 Chris Cormack 2011-09-02 03:20:41 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2011-09-02 03:25:42 UTC
The content of attachment 5266 [details] has been deleted by
    Chris Cormack <chris@bigballofwax.co.nz>
without providing any reason.

The token used to delete this attachment was generated at 2011-09-02 15:25:38 NZST.
Comment 3 Owen Leonard 2013-09-13 19:33:01 UTC
*** Bug 10815 has been marked as a duplicate of this bug. ***
Comment 4 Jonathan Druart 2015-03-25 12:46:43 UTC Comment hidden (obsolete)
Comment 5 Marc Véron 2015-03-25 15:29:41 UTC Comment hidden (obsolete)
Comment 6 Katrin Fischer 2015-03-25 21:13:02 UTC
Hm, I am sorry, but with the patch applied I have problems adding new tags, this is after trying form the result list:

[Wed Mar 25 22:07:32.575073 2015] [cgi:error] [pid 18931] [client 127.0.0.1:59595] AH01215: [Wed Mar 25 22:07:32 2015] opac-tags.pl: DBD::mysql::st execute failed: Column 'term' in where clause is ambiguous at /home/katrin/kohaclone/C4/Tags.pm line 221., referer: http://localhost/cgi-bin/koha/opac-search.pl?idx=kw&q=der&sort_by=relevance&addto=Add+to...&tagsel_new=&biblionumber=2&loggedinuser=&newtag2=XXX&biblionumber=4&loggedinuser=&newtag4=&biblionumber=8&loggedinuser=&newtag8=&biblionumber=9&loggedinuser=&newtag9=&biblionumber=10&loggedinuser=&newtag10=&biblionumber=13&loggedinuser=&newtag13=&biblionumber=14&loggedinuser=&newtag14=&biblionumber=18&loggedinuser=&newtag18=&biblionumber=19&loggedinuser=&newtag19=&biblionumber=23&loggedinuser=&newtag23=&biblionumber=32&loggedinuser=&newtag32=&biblionumber=38&loggedinuser=&newtag38=&biblionumber=40&loggedinuser=&newtag40=&biblionumber=47&loggedinuser=&newtag47=&biblionumber=50&loggedinuser=&newtag50=&biblionumber=58&loggedinuser=&newtag58=&biblionumber=60&loggedinuser=&newtag60=&biblionumber=61&loggedinuser=&newtag61=&biblionumber=63&loggedinuser=&newtag63=&biblionumber=64&loggedinuser=&newtag64=
[Wed Mar 25 22:07:32.575440 2015] [cgi:error] [pid 18931] [client 127.0.0.1:59595] AH01215: [Wed Mar 25 22:07:32 2015] opac-tags.pl: Can't use an undefined value as an ARRAY reference at /usr/lib/perl5/DBI.pm line 2064., referer: http://localhost/cgi-bin/koha/opac-search.pl?idx=kw&q=der&sort_by=relevance&addto=Add+to...&tagsel_new=&biblionumber=2&loggedinuser=&newtag2=XXX&biblionumber=4&loggedinuser=&newtag4=&biblionumber=8&loggedinuser=&newtag8=&biblionumber=9&loggedinuser=&newtag9=&biblionumber=10&loggedinuser=&newtag10=&biblionumber=13&loggedinuser=&newtag13=&biblionumber=14&loggedinuser=&newtag14=&biblionumber=18&loggedinuser=&newtag18=&biblionumber=19&loggedinuser=&newtag19=&biblionumber=23&loggedinuser=&newtag23=&biblionumber=32&loggedinuser=&newtag32=&biblionumber=38&loggedinuser=&newtag38=&biblionumber=40&loggedinuser=&newtag40=&biblionumber=47&loggedinuser=&newtag47=&biblionumber=50&loggedinuser=&newtag50=&biblionumber=58&loggedinuser=&newtag58=&biblionumber=60&loggedinuser=&newtag60=&biblionumber=61&loggedinuser=&newtag61=&biblionumber=63&loggedinuser=&newtag63=&biblionumber=64&loggedinuser=&newtag64=
Comment 7 Jonathan Druart 2015-03-26 08:50:52 UTC Comment hidden (obsolete)
Comment 8 Jonathan Druart 2015-03-26 08:52:54 UTC
(In reply to Katrin Fischer from comment #6)
> Hm, I am sorry, but with the patch applied I have problems adding new tags,
> this is after trying form the result list:

Thanks for catching that!
My error was to try to modify C4::Tags, it's a nightmare.
This last patch does what I tried to do but without modifingy the module.
It's less efficient but much more safe.
Comment 9 Bernardo Gonzalez Kriegel 2015-05-12 14:57:54 UTC
Hi, tested and works.

One problem, when I click on tag's link, I got a no results found,
and "Can't locate YAML/XS.pm in @INC..."

Installing YAML::XS (using cpan) solves the problem, but can't
understand what is calling or ising that library, and is not a Koha dep.
Comment 10 Bernardo Gonzalez Kriegel 2015-05-12 15:01:03 UTC Comment hidden (obsolete)
Comment 11 Marcel de Rooy 2015-07-10 09:59:12 UTC
I have added three tags with a normal user:
Biblio 1: tag1 tag2
Biblio 2: tag1

I have approved tag1 in staff, did not touch tag2.

I see the tag1 in opac-detail. I can click on it and have two results.
With the normal user, I go to opac-tags.
Both tags are marked not-approved.
Somehow the $my_approved_tags array is empty.

Failed QA
Comment 12 Jonathan Druart 2015-07-10 11:00:38 UTC Comment hidden (obsolete)
Comment 13 Jonathan Druart 2015-07-10 11:01:43 UTC
(In reply to Marcel de Rooy from comment #11)
> I have added three tags with a normal user:
> Biblio 1: tag1 tag2
> Biblio 2: tag1
> 
> I have approved tag1 in staff, did not touch tag2.
> 
> I see the tag1 in opac-detail. I can click on it and have two results.
> With the normal user, I go to opac-tags.
> Both tags are marked not-approved.
> Somehow the $my_approved_tags array is empty.
> 
> Failed QA

Good catch!
This C4::Tags module is really a mess and I prefer not to touch it.
The patch I propose should work but is not the best way to do.
Comment 14 Katrin Fischer 2015-10-03 20:54:52 UTC
Created attachment 43084 [details] [review]
[PASSED QA] Bug 6379: Remove link from unapproved tags

At the OPAC, if the tag is not approved, the tag's link did not return
any result.

This patch removes the link.
Test plan:
1/ Set TagsModeration to 'Require'
2/ Create tags at the OPAC
3/ Approve a couple
4/ Confirm that unapproved tags does not have links.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
works as described, no errors

For the (approved) link to work I need to install YAML::XS

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 15 Katrin Fischer 2015-10-03 20:55:50 UTC
Created attachment 43085 [details] [review]
[PASSED QA] Bug 6379: Fix if the reviewer is not the same patron

get_approval_rows does a left join on tags_approval.approved_by =
borrowers.borrowernumber

This means it cannot return the approval tags for a given patron.

Note that this patch could be time-consuming if there is a lot of tags
in the DB.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 16 Tomás Cohen Arazi 2015-10-05 15:40:29 UTC
Patches pushed to master.

Thknas Ojanahtn!
Comment 17 Jonathan Druart 2015-10-05 16:25:04 UTC
(In reply to Tomás Cohen Arazi from comment #16)
> Patches pushed to master.
> 
> Thknas Ojanahtn!

You need some rest :)