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

2019-11-16 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23992

--- Comment #5 from Andrew Nugged  ---
(In reply to Jonathan Druart from comment #3)

Also we had discussion about "sequence" of barcodes with KohaSuomi
community/cataloguers but I still unclear in vision.

Do librarians needs to insert barcodes for items in the middle as THEY want? 
Or is it enough to number barcodes from free space from the max? 
Or fill randomly from given incrementally skipping existing ones and no matter
how they spreaded, just should be unique and different?
Is these requirements worldwide or they need some settings + interface feedback
about skipps/stopped generator/etc?

I proposed just to print error/do partial add/inform user when barcode sequence
generated not as "user may expect", if users expects barcodes to start from
their own wished barcode. 

But I don't have answer then "should we also inform that some barcode numbers
were skipped"?
Example of the situation: if user will put first barcode which occupied, system
will increment barcodes until free gap, and user will get all items numbered
with totally diferent barcodes instead of that which he/she put on the
beginning, and this even won't give any feedback to user. Should that be so?

Maybe – we should inform user that sequence was broken (jumped over occupied
barcode, empty next one generated, barcode not re-generated), and stop?

I brought this question + partial solution here as WIP/unclear. Will
re-translate this my message to IRC chat then.

And thanks for you that you're joined this small brainstorming :).

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


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

2019-11-15 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23992

--- Comment #4 from Andrew Nugged  ---
(In reply to Jonathan Druart from comment #3)
> If I understand correctly you are trying to fix a logic issue, and so an
> hypothetical situation where the barcode plugin will return $new = $old.

or when it will return NO BARCODE (empty/undef) if such possible.

Because our plugins/barcodes can change by time and I don't know how might
behave, I propose to detect this in the sequence, and inform user that
"something went wrong.

But yes, if this never happens now and never later if someone will change
barcode generator or use their own so that "no_barcode_generated" I've added
not needed at all and this solution might look useless.

But idea was not so clear, I agree, but let's assume we:
1. started loop with barcode provided, so each next item should be with
next_value barcode,
2. but eventually no next_value or it is the same for "unknown future reasons"
(someone will develop Barcode generator which will do that),
3. so we should stop in the middle bringing error to operator/user that "we
failed to go further with your sequence", not just silently continue adding
empty or same barcodes.

But yes, this was unclear fix because it came as attempt to syncronize another
bugfix in KohaSuomi fork which way behind of current KohaCommunity (v16 against
v19), and because there's not exactly how this was solved in KohaSuomi, I
wanted to have this fix in KC, port it back in KS, so then KS don't needs other
fixes,

but I also agree this is "silver tape fix"

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


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

2019-11-15 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23992

--- Comment #3 from Jonathan Druart  
---
Hi Andrew,

Are you trying to fix a random FIXME or a bug you found? :)

If I understand correctly you are trying to fix a logic issue, and so an
hypothetical situation where the barcode plugin will return $new = $old. Maybe
we should fix that in the plugins then?

Even if the change makes sense to me I will need to think a bit more about it,
especially the following "terribly hacky" fix I wrote few weeks ago.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


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

2019-11-12 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23992

--- Comment #2 from Andrew Nugged  ---
this might be "WIP" (not full patch without test plan), so I need community
help, because it's hard to generate test plan: I tried with all variants of
barcodes and in most cases we have barcode just incremented in "->next_value"
method. 

With patch, the error "no_next_barcode" will be generated so this will break
the loop and inform the user about the wrong generation in cases when we start
adding WITH barcode but then for some reason the same or empty barcode started
to appear.

If we start with empty barcode – then just requested numbers of items added
without barcodes at all, as it was before.

Also, this will prevent the infinite loop (when $i++ won't be executed) in
cases when the barcode generator might stuck and return the same old or some
another barcode which will be always found for some item.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


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

2019-11-12 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23992

--- Comment #1 from Andrew Nugged  ---
Created attachment 95349
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95349=edit
Bug 23992: Items multi add - generate 'no_next_barcode' error if no barcode

When multiple items added with barcode from the first, we expect for next
barcode to be generated. If it will be the same barcode or empty one, then
error 'no_next_barcode' will be generated to inform user/operator that
operation wasn't completed as expected.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


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

2019-11-11 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23992

Jonathan Druart  changed:

   What|Removed |Added

 CC||jonathan.dru...@bugs.koha-c
   ||ommunity.org
 Status|NEW |ASSIGNED

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/