[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 16:25:05 CET 2023


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

--- Comment #5 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
Just some related questions here.

Should we save authorised_values.id in connected fields? Perhaps theoretically,
but it does not sound very practical at this point in our codebase. So NO.

Should we adjust other item fields that are of integer type connected to AV
where the same problem actually may occur? Move them all to varchar(80)? It
feels a bit like overkill?
These are:
| stack                             | tinyint(1)   |  # on this report
| notforloan                        | tinyint(1)   |
| damaged                           | tinyint(1)   |
| itemlost                          | tinyint(1)   |
| withdrawn                         | tinyint(1)   |
| restricted                        | tinyint(1)   |

IF doing so, we could look at default values. They are not completely
consistent, since damaged and withdrawn default to 0.
`restricted` tinyint(1) DEFAULT NULL COMMENT 'authorized value defining use
restrictions for this item (MARC21 952$5)',
`stack` tinyint(1) DEFAULT NULL,
`ccode` varchar(80) DEFAULT NULL COMMENT 'authorized value for the collection
code associated with this item (MARC21 952$8)',
`location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the shelving
location for this item (MARC21 952$c)',

I thought about warning for a wrong value in an item field of type integer/date
BEFORE saving. Now we can just enter something in various fields, save, get no
warning and come back later to discover that our data is lost. E.g. the example
of 127 for a higher number. (Coming back as 127 with a warning in the editor.)
Or just 0 for a string.

But since this originates from AV. We should perhaps add a restriction THERE!
Why not add an AV column that allows you to only enter tinyints instead of 80
char codes? If we solve it in AV, there will be no problem in items?

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


More information about the Koha-bugs mailing list