Bug 12974 - Argument "" isn't numeric in numeric gt (>) in opac-results.tt
Summary: Argument "" isn't numeric in numeric gt (>) in opac-results.tt
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: Marc Véron
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-20 19:31 UTC by Marc Véron
Modified: 2015-06-04 23:33 UTC (History)
2 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 12974 - Argument "" isn't numeric in numeric gt (>) in opac-results.tt (1.86 KB, patch)
2014-09-20 19:41 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 12974 - Argument "" isn't numeric in numeric gt (>) in opac-results.tt (1.90 KB, patch)
2014-10-06 14:34 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 12974 - Argument "" isn't numeric in numeric gt (>) in opac-results.tt (2.04 KB, patch)
2014-10-06 15:54 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 12974 - Argument "" isn't numeric in numeric gt (>) in opac-results.tt (2.09 KB, patch)
2014-10-06 20:01 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2014-09-20 19:31:09 UTC
If an item has no star ratings you get an error message in opac-error.log:

Argument "" isn't numeric in numeric gt (>) at (...) /koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt line 467.
Comment 1 Marc Véron 2014-09-20 19:41:25 UTC Comment hidden (obsolete)
Comment 2 Marcel de Rooy 2014-10-06 13:36:05 UTC
( SEARCH_RESULT.rating_total &&  SEARCH_RESULT.rating_total ) > 0 

This is probably not what you intended to do.
Do you mean: A && A>0 ?
Comment 3 Marc Véron 2014-10-06 14:34:39 UTC Comment hidden (obsolete)
Comment 4 Magnus Enger 2014-10-06 15:54:53 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2014-10-06 20:01:40 UTC
Created attachment 32021 [details] [review]
Bug 12974 - Argument "" isn't numeric in numeric gt (>) in opac-results.tt

If an item has no star ratings you get an error message in opac-error.log:
Argument "" isn't numeric in numeric gt (>) at (...) /koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt line 467.

To test:
In OPAC, search for a bilio that has no star ratings.
Check opac-error.log for message as above
Apply patch
Repeat search
Check opac-error.log again, there should be no more warnings

(Fixed mistake with brackets, see comment #2)

Signed-off-by: Magnus Enger <digitalutvikling@gmail.com>
Works as advertized. Looks like you have to be logged in to trigger
the error.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 6 Tomás Cohen Arazi 2014-10-14 14:11:32 UTC
Patch pushed to master.

Thanks Marc!