]> git.koha-community.org Git - koha.git/commit
Bug 24254: Compare itemlost with 0
authorTomas Cohen Arazi <tomascohen@theke.io>
Sat, 19 Dec 2020 13:05:16 +0000 (10:05 -0300)
committerAndrew Fuerste-Henry <andrew@bywatersolutions.com>
Fri, 29 Jan 2021 18:42:31 +0000 (18:42 +0000)
commit4ffe7ddac04b0240b8007df6521fe6e65e403241
treea6b7bb48e3b1b00602e0d241741fa351c19551a0
parent11bdc847a38fa3631e39fbc19c05ea7e5e64afd3
Bug 24254: Compare itemlost with 0

On C4::Search and C4::Circulation the uses of the items.itemlost field
highlight the fact that the comparisson itemlost <= 0 was wrong, as it
is evaluated as a Perl boolean.

The column can only be an int and NOT NULL, so we need to check if it is
0 to ponder if not hidden.

This patch changes the tests to reflect this, and adjust the
Koha::Items->filter_by_visible_in_opac implementation to adapt to this.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Items.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Koha/Items.pm
t/db_dependent/Koha/Items.t