[Koha-bugs] [Bug 23992] New: Adding multiple items with barcode might end with infinite loop if same barcode will be next_value

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Nov 7 21:34:36 CET 2019


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23992

            Bug ID: 23992
           Summary: Adding multiple items with barcode might end with
                    infinite loop if same barcode will be next_value
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P5 - low
         Component: Cataloging
          Assignee: nugged at gmail.com
          Reporter: nugged at gmail.com
        QA Contact: testopia at bugs.koha-community.org
                CC: m.de.rooy at rijksmuseum.nl

In /cataloguing/additem.pl we had the comment:
"FIXME : Please note that there is a risk of infinite loop here if we never
find a suitable barcode".

I researched that when we are adding '$number_of_copies', there will be no
infinite loop there in that 'for' loop EXCEPT if the 'next_value' method will
return the same but defined barcode only (border case1). Other cases:

- without a barcode code always adds any number of items in a sequential way,
so nothing to fix,

- if we have '$barcodevalue' defined in the beginning, code adds items with
barcodes generating them with 'next_value', 
if then no barcode will be generated in 'next_value' then '$exist_itemnumber'
will not be defined, so loop will keep adding items without barcodes.
Sequentially. (case2)

- if barcode will be occupied so it will be skipped until next barcode will be
generated, a free one, this was discussed with KohaSuomi as "might be not
needed" but because this already created in this way in KC so let's keep this
logic, so nothing to fix here too.


I am preparing patch to generate in case2: "no_barcode_value" error message if
it was started with a barcode and no more barcodes generated,
or in case1: if the barcode after 'next_value' will be the same as old value.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list