Bug 18097 - It is possible to create unusable category codes (ccode) due to field length mismatch
Summary: It is possible to create unusable category codes (ccode) due to field length ...
Status: RESOLVED DUPLICATE of bug 5458
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low major (vote)
Assignee: Kyle M Hall
QA Contact: Testopia
URL:
Keywords:
Depends on: 17216
Blocks:
  Show dependency treegraph
 
Reported: 2017-02-10 16:16 UTC by Kyle M Hall
Modified: 2019-12-12 08:22 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 18097 - Update kohastructure.pl (6.65 KB, patch)
2017-02-10 16:25 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 18097: Add FK for authorised values (8.46 KB, patch)
2017-02-24 14:07 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2017-02-10 16:16:44 UTC
The column items.ccode is 10 characters long. It references authorised values of the type CCODE. The maximum length of an authorised value is 80 characters long. If a CCODE is created with a value greater than 10, when it is stored for the item it will be truncated and become either a) an invalid ccode or b) match a different ccode!

The solution should be to increase the items.ccode column from varchar(10) to varchar(80).

This really goes for all columns that could possibly store an authorised value.
Comment 1 Kyle M Hall 2017-02-10 16:25:56 UTC
Created attachment 60121 [details] [review]
Bug 18097 - Update kohastructure.pl
Comment 2 Jonathan Druart 2017-02-15 17:33:46 UTC
Kyle, do you plan to provide a complete patch?
Comment 3 Kyle M Hall 2017-02-23 11:37:25 UTC
(In reply to Jonathan Druart from comment #2)
> Kyle, do you plan to provide a complete patch?

I haven't found the time yet to identify all columns that have the option to be authorised values yet. If you want to add a patch please go ahead!
Comment 4 Jonathan Druart 2017-02-24 14:07:30 UTC
Created attachment 60656 [details] [review]
Bug 18097: Add FK for authorised values
Comment 5 Jonathan Druart 2017-02-24 14:08:19 UTC
This patch seems more complicate and cover other authorised values FK.
However I am wondering if ccode DB fields should have a FK as well.
Comment 6 Katrin Fischer 2019-12-12 07:38:48 UTC
It looks like we fixed this elsewhere: items.ccode is 80 chars now.
Comment 7 Jonathan Druart 2019-12-12 08:22:48 UTC
(In reply to Katrin Fischer from comment #6)
> It looks like we fixed this elsewhere: items.ccode is 80 chars now.

Maybe ccode, but what I tried to address (av columns) with my patch is not fixed.

*** This bug has been marked as a duplicate of bug 5458 ***