Bug 24740 - Use biblio title if available rather than biblio number in OPAC search result cover images tooltips
Summary: Use biblio title if available rather than biblio number in OPAC search result...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Didier Gautheron
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-27 09:42 UTC by Didier Gautheron
Modified: 2020-11-30 21:45 UTC (History)
5 users (show)

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


Attachments
BUG 24740: Use biblio title rather than biblio number in OPAC search result cover images tooltips (15.43 KB, patch)
2020-02-27 09:55 UTC, Didier Gautheron
Details | Diff | Splinter Review
Bug 24740: Use biblio title rather than biblio number in OPAC search result cover images tooltips (21.27 KB, patch)
2020-03-30 22:42 UTC, Didier Gautheron
Details | Diff | Splinter Review
Bug 24740: Use biblio title rather than biblio number in OPAC search result cover images tooltips (21.33 KB, patch)
2020-04-01 09:29 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 24740: Use biblio title rather than biblio number in OPAC search result cover images tooltips (21.38 KB, patch)
2020-05-02 02:03 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 Didier Gautheron 2020-02-27 09:42:13 UTC
In OPAC biblionum doesn't mean much to patrons, use biblio title field if not empty.


To test:
OPAC search
1) Apply the patch
2) For each cover images providers available to tester in:
/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=Cover
OPACLocalCoverImages, AdlibrisEnabled, OPACAmazonCoverImages, GoogleJackets, Coce provider.
3) Enable the provider.
4) Search a Library Catalog for a book with a cover image.
6) test mouse over cover image display biblio title.

OPAC Shelves
1) Enable OPAC virtualshelves preference
2) Create a list.
3) For each covers providers available.
4) Search the List
5) test mouse over cover image display biblio title.
Comment 1 Didier Gautheron 2020-02-27 09:55:48 UTC
Created attachment 99695 [details] [review]
BUG 24740: Use biblio title rather than biblio number in OPAC search result cover images tooltips

In OPAC biblionum doesn't mean much to patrons, use biblio title field if not empty.

Test plan:
OPAC search
1) Apply the patch
2) For each cover images providers available to tester in:
/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=Cover
OPACLocalCoverImages, AdlibrisEnabled, OPACAmazonCoverImages, GoogleJackets, Coce provider.
3) Enable the provider.
4) Search a Library Catalog for a book with a cover image.
6) test mouse over cover image display biblio title.

OPAC Shelves
1) Enable OPAC virtualshelves preference
2) Create a list.
3) For each covers providers available.
4) Search the List
5) test mouse over cover image display biblio title.
Comment 2 Andreas Roussos 2020-03-14 20:09:41 UTC
Indeed, the biblio number doesn't mean much when used as a cover tooltip.

I'm keen to Sign Off on your patch and have the following points to make:

1) "Author: Didier GAutheron" <- unless you want to be credited this way
   in the Koha release notes and in the About page timeline you may want
   to redo your git config and make a small change to your surname.

2) "BUG 24740: [...]": as per the official guidelines in the Koha wiki
   (https://wiki.koha-community.org/wiki/Commit_messages#Subject_line)
   the word "Bug" should be capitalised, and not be in all uppercase,
   otherwise the QA tools will complain.

3) The QA tools will also flag the missing filters at the lines where
   you've added [% img_title %], this is due to the coding guidelines'
   requirement that _all_ template variables must be filtered:
   https://wiki.koha-community.org/wiki/Coding_Guidelines#HTML9:_Filter_all_template_variables

   You should probably remove the filters from the assignments inside
   the IF-ELSE blocks and use the "html" filter whenever the img_title
   variable is used later on in the TT code:

   [% IF ( SEARCH_RESULT.title ) %]
       [% img_title = SEARCH_RESULT.title %]
   [% ELSE %]
       [% img_title = SEARCH_RESULT.biblionumber %]
   [% END %]

   [% IF ( itemsloo.title ) %]
       [% img_title = itemsloo.title %]
   [% ELSE %]
       [% img_title = itemsloo.biblionumber %]
   [% END %]

   <span title="[% img_title | html %]" ... ></span>

4) You have used hard tabs to indent some of the code in your patch,
   the QA tools will notice this. I suggest you change them to soft
   tabs (spaces). The offending lines are:

   254 and 256 in koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt
   327 and 329 in koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt

5) Should we take this opportunity and fix the cover tooltip in the biblio
   details page as well? And the shelf browser, too?

   The relevant TT files are:
   koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt
   koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc
Comment 3 Katrin Fischer 2020-03-15 13:44:11 UTC
Hi Andreas, please use "Failed QA" if you run into problems when testing - the developers will usually check and reply. In Discussion should be used only if there is a disagreement that cannot be resolved without getting more people involved.
Comment 4 Andreas Roussos 2020-03-15 16:08:55 UTC
(In reply to Katrin Fischer from comment #3)
> Hi Andreas, please use "Failed QA" if you run into problems when testing -
> the developers will usually check and reply. In Discussion should be used
> only if there is a disagreement that cannot be resolved without getting more
> people involved.
Hi Katrin, thanks for the clarification! I've taken the opportunity to include
the gist of your comment in the relevant page on the Wiki:
https://wiki.koha-community.org/wiki/Development_workflow#Failure_cases
Comment 5 Katrin Fischer 2020-03-15 16:15:06 UTC
> Hi Katrin, thanks for the clarification! I've taken the opportunity to
> include
> the gist of your comment in the relevant page on the Wiki:
> https://wiki.koha-community.org/wiki/Development_workflow#Failure_cases

Great, thx!
Comment 6 Didier Gautheron 2020-03-20 13:53:03 UTC
Hi, thanks for you reply.

(In reply to Andreas Roussos from comment #2)
> 1) "Author: Didier GAutheron" <- unless you want to be credited this way
Oops, thanks.

> 
> 2) "BUG 24740: [...]": as per the official guidelines in the Koha wiki
>    (https://wiki.koha-community.org/wiki/Commit_messages#Subject_line)
>    the word "Bug" should be capitalised, and not be in all uppercase,
>    otherwise the QA tools will complain.
Will do.

> 
> 3) The QA tools will also flag the missing filters at the lines where
>    you've added [% img_title %], this is due to the coding guidelines'
>    requirement that _all_ template variables must be filtered:
>
Same.

> 4) You have used hard tabs to indent some of the code in your patch,
>    the QA tools will notice this. I suggest you change them to soft
>    tabs (spaces). The offending lines are:
Note:
Tips in wiki guidlines seem to be wrong, 
You can fix tabs by using 
git config --global core.whitespace trailing-space,space-before-tab
git config --global apply.whitespace fix

Don't replace tab, I have it but still get tab.

> 
>    254 and 256 in koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt
>    327 and 329 in koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt
> 
> 5) Should we take this opportunity and fix the cover tooltip in the biblio
>    details page as well? And the shelf browser, too?
> 
>    The relevant TT files are:
>    koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt
>    koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc
I'll look at it.

Regards
Didier
Comment 7 Didier Gautheron 2020-03-30 22:42:46 UTC
Created attachment 102096 [details] [review]
Bug 24740: Use biblio title rather than biblio number in OPAC search result cover images tooltips

In OPAC biblionum doesn't mean much to patrons, use biblio title field if not empty.

Test plan:
OPAC search
1) Apply the patch
2) For each cover images providers available to tester in:
/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=Cover
OPACLocalCoverImages, AdlibrisEnabled, OPACAmazonCoverImages, GoogleJackets, Coce provider.
3) Enable the provider.
4) Search a Library Catalog for a book with a cover image.
6) test mouse over cover image display biblio title.

OPAC Shelves
1) Enable OPAC virtualshelves preference
2) Create a list.
3) For each covers providers available.
4) Search the List
5) test mouse over cover image display biblio title.
Comment 8 ByWater Sandboxes 2020-04-01 09:29:09 UTC
Created attachment 102187 [details] [review]
Bug 24740: Use biblio title rather than biblio number in OPAC search result cover images tooltips

In OPAC biblionum doesn't mean much to patrons, use biblio title field if not empty.

Test plan:
OPAC search
1) Apply the patch
2) For each cover images providers available to tester in:
/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=Cover
OPACLocalCoverImages, AdlibrisEnabled, OPACAmazonCoverImages, GoogleJackets, Coce provider.
3) Enable the provider.
4) Search a Library Catalog for a book with a cover image.
6) test mouse over cover image display biblio title.

OPAC Shelves
1) Enable OPAC virtualshelves preference
2) Create a list.
3) For each covers providers available.
4) Search the List
5) test mouse over cover image display biblio title.

Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se>
Comment 9 Stina Hallin 2020-04-01 09:32:14 UTC
Worked fine with books. Didn't get either title or biblionumber for e-books and films.
Comment 10 Didier Gautheron 2020-04-01 11:31:38 UTC
(In reply to Stina Hallin from comment #9)
> Worked fine with books. Didn't get either title or biblionumber for e-books
> and films.
Hi,

Are you using a sandbox for testing, if yes which one?
Comment 11 Stina Hallin 2020-04-01 11:34:57 UTC
Hi, yes I'm using Bywaters sandbox. I used it with my library's account with syndetics to display covers.
Comment 12 Didier Gautheron 2020-04-06 17:26:40 UTC
Hi,
(In reply to Stina Hallin from comment #11)
> Hi, yes I'm using Bywaters sandbox. I used it with my library's account with
> syndetics to display covers.

I haven't a syndetics account but have you an e-books or films' biblionumbers not showing tips?
Comment 13 Stina Hallin 2020-04-16 12:36:49 UTC
When I test it again, I can see the titles for different kinds of materials. So now it looks great. Everything I looked at showed tips.
Comment 14 Katrin Fischer 2020-05-02 02:03:35 UTC
Created attachment 104170 [details] [review]
Bug 24740: Use biblio title rather than biblio number in OPAC search result cover images tooltips

In OPAC biblionum doesn't mean much to patrons, use biblio title field if not empty.

Test plan:
OPAC search
1) Apply the patch
2) For each cover images providers available to tester in:
/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=Cover
OPACLocalCoverImages, AdlibrisEnabled, OPACAmazonCoverImages, GoogleJackets, Coce provider.
3) Enable the provider.
4) Search a Library Catalog for a book with a cover image.
6) test mouse over cover image display biblio title.

OPAC Shelves
1) Enable OPAC virtualshelves preference
2) Create a list.
3) For each covers providers available.
4) Search the List
5) test mouse over cover image display biblio title.

Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 15 Martin Renvoize 2020-05-04 08:31:01 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 16 Joy Nelson 2020-05-11 20:36:56 UTC
Backported to 19.11.x for 19.11.06
Comment 17 Lucas Gass 2020-05-15 21:18:59 UTC
enhancement will not be backported to 19.05.x