[Koha-bugs] [Bug 28869] If authorized values for STACK (shelving control number) are > 127 things explode

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Dec 7 09:45:20 CET 2023


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

Marcel de Rooy <m.de.rooy at rijksmuseum.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |m.de.rooy at rijksmuseum.nl

--- Comment #3 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
(In reply to Lucas Gass from comment #0)

> The A.V. category of STACK maps to items.stack.

Somehow in our local production db I do have the AV STACK category (without any
value under it) and no mappings to STACK in the frameworks!
We do not use the field but it contains a small number of 127s. Should have
hidden the field in the item editor ;)

> Tinyint can be anything between -128 and 127.

MySQL defaults to signed. If we SHOULD alter it to UNSIGNED. We have 0 to 255.
Which might be just a bit more useful in the library environment. See also
below.

> -Edit an item, things seem to work fine. 

If you enter a value over 127, it is converted to 127.
This is not really fine imo :) It is just silently adjusted/capped.

> Should items.stack be int?

This actually is a harder question than it looks like.
One aspect is that the item editor just silently ignores non-numeric input in
this field. So a text field would be nice?
But authorised_values.id is an INT. But "unfortunately", Koha does not save the
id in the corresponding item field but the actual value which is varchar(80).
(Using  a TEXT variant here would have performance impacts.)

In conclusion, for items.stack I would opt for varchar(80) too here. It does
however trigger a few remarks having a wider scope (postponed to next comment).

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


More information about the Koha-bugs mailing list