In inventory tool, there is a test on scanned items notforloan value : if the value is not one of authorized values, the inventory results displays the problem "Change item status". The bug is that if notforloan filter is not used, the notforloan values array is not filled and so all scanned items are marked with this problem.
Created attachment 31553 [details] [review] Bug 12913 - wrong inventory results when notforloan filter is not used In inventory tool, there is a test on scanned items notforloan value : if the value is not one of authorized values, the inventory results displays the problem "Change item status". The bug is that if notforloan filter is not used, the notforloan values array is not filled and so all scanned items are marked with this problem. Test plan : - Check you have in default framework an item subfield mapped with items.notforloan and with an authorized value catergory, for example 'NOTFORLOAN' - Check the authorized value category has at least value '0' - Create a new value in this category, for example '9' - Create a biblio with default framework - Create an item with barcode='000AAA1', callnumber='ZZZAAA1' and notforloan=0 - Create an item with barcode='000AAA2', callnumber='ZZZAAA2' and notforloan=9 - Delete new value created above, for example '9' - Create a file 'barecodes.txt' containing 2 lines '000AAA1' and '000AAA2' - Go to inventory tool : /cgi-bin/koha/tools/inventory.pl - Choose file in 'Barcode file' - Enter item callnumber between 'ZZZ' and 'ZZZZ' - Check 'Compare barcodes list to results' - Submit => without patch, you get 2 results with problem 'Change item status' even for item with notforloan=0 => with patch, you get 1 result with 'Change item status' on item with notforloan=9
Created attachment 31568 [details] [review] [SIGNED OFF] Bug 12913 - wrong inventory results when notforloan filter is not used In inventory tool, there is a test on scanned items notforloan value : if the value is not one of authorized values, the inventory results displays the problem "Change item status". The bug is that if notforloan filter is not used, the notforloan values array is not filled and so all scanned items are marked with this problem. Test plan : - Check you have in default framework an item subfield mapped with items.notforloan and with an authorized value catergory, for example 'NOTFORLOAN' - Check the authorized value category has at least value '0' - Create a new value in this category, for example '9' - Create a biblio with default framework - Create an item with barcode='000AAA1', callnumber='ZZZAAA1' and notforloan=0 - Create an item with barcode='000AAA2', callnumber='ZZZAAA2' and notforloan=9 - Delete new value created above, for example '9' - Create a file 'barecodes.txt' containing 2 lines '000AAA1' and '000AAA2' - Go to inventory tool : /cgi-bin/koha/tools/inventory.pl - Choose file in 'Barcode file' - Enter item callnumber between 'ZZZ' and 'ZZZZ' - Check 'Compare barcodes list to results' - Submit => without patch, you get 2 results with problem 'Change item status' even for item with notforloan=0 => with patch, you get 1 result with 'Change item status' on item with notforloan=9 Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Created attachment 31733 [details] Bug still shows Followed the test plan, still got the same "Change item status" message for both items. Please re-test. Perhaps something has changed since the sign-off that has broken the patch. That, or I'm not testing it right!
I haven't tried the patch, but at a glance it might be trying to fix the wrong part of inventory.pl. This is the section of code that probably needs to be changed: # If we have scanned items with a non-matching notforloan value if (none { $item->{'notforloancode'} eq $_ } @notforloans) { $item->{problem} = 'changestatus'; push @items_with_problems, { %$item }; } If you're not using the "Not for loans" filter, @notforloans should be empty. Likewise, if your item isn't "Not for loan", $item->{'notforloancode'} should be false. Thus, this if statement should always be true if you're not using "Not for loans" and the item is not not for loan (ie is available). So I think all we need here is to wrap this with a "if (@notforloans)" test. I might take a look at this after I finish filing another Inventory bug report...
Is this bug still valid?
(In reply to Marc Véron from comment #5) > Is this bug still valid? I think so but I haven't tried to confirm it yet.
*** Bug 14399 has been marked as a duplicate of this bug. ***
Still a valid report. Will add a follow-up partially based on comments from David Cook on bug 14399.
Still work in progress!
Created attachment 61670 [details] [review] Bug 12913 - wrong inventory results when notforloan filter is not used In inventory tool, there is a test on scanned items notforloan value : if the value is not one of authorized values, the inventory results displays the problem "Change item status". The bug is that if notforloan filter is not used, the notforloan values array is not filled and so all scanned items are marked with this problem. Test plan : - Check you have in default framework an item subfield mapped with items.notforloan and with an authorized value catergory, for example 'NOTFORLOAN' - Check the authorized value category has at least value '0' - Create a new value in this category, for example '9' - Create a biblio with default framework - Create an item with barcode='000AAA1', callnumber='ZZZAAA1' and notforloan=0 - Create an item with barcode='000AAA2', callnumber='ZZZAAA2' and notforloan=9 - Delete new value created above, for example '9' - Create a file 'barecodes.txt' containing 2 lines '000AAA1' and '000AAA2' - Go to inventory tool : /cgi-bin/koha/tools/inventory.pl - Choose file in 'Barcode file' - Enter item callnumber between 'ZZZ' and 'ZZZZ' - Check 'Compare barcodes list to results' - Submit => without patch, you get 2 results with problem 'Change item status' even for item with notforloan=0 => with patch, you get 1 result with 'Change item status' on item with notforloan=9 Signed-off-by: Nick Clemens <nick@quecheelibrary.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 61671 [details] [review] Bug 12913: [QA Follow-up] Reword 'change item status' and add zero status The zero status should be added in @notforloans. It is a legitimate status for available books. The zero status description can be translated in the template. The 'Change item status' is confusing. We mean that we saw a notforloan status that we do not expect (read: does not exist in the table). Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
This looks good to me. Note that we are not solving all problems in the script now. But I cannot overload this report and its signed off status. Will continue on report 14399 (reopened it).
Still needs some attention
Created attachment 61674 [details] [review] Bug 12913: [QA Follow-up] Reword 'change item status' and add zero status The zero status should be added in @notforloans. It is a legitimate status for available books. The zero status description can be translated in the template. The 'Change item status' is confusing. We mean that we saw a notforloan status that we do not expect (read: does not exist in the table). Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Pushed to master for 17.05, thanks Frido, Marcel!
These patches have been pushed to 16.11.x and will be in 16.11.07. .
Pushed to 3.22.x for 3.22.20
Pushed to 16.05.x, for 16.05.12 release