Bug 27781

Summary: Editing Codes
Product: Koha Reporter: Christopher Brannon <cbrannon>
Component: System AdministrationAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: gmcharlt, lisettepalouse+koha
Version: 20.11   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 27881: Markup error in masthead-langmenu.inc

Description Christopher Brannon 2021-02-24 17:13:12 UTC
I understand the need to not allow code editing once a code has been created for tables.  However, I am wondering if we could consider another approach.  It is risky, but might provide more flexibility with editing.  This would be particularly helpful to those of us that mistype a code, or create a code, only to realize that sorting in dropdowns is based on order of the code, not the description.

What if we added an option to change the code, and the process would A) check related tables to make sure the suggested change doesn't already exist, and B) change all instances of that code in related tables.

If there are flaws with this process, or it is too risky, I understand.  I am just one of those people that hates it when you make a mistake and then it lives in your database for eternity.
Comment 1 Owen Leonard 2021-03-05 15:41:03 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2021-03-05 17:53:36 UTC
Sorry for the noise -- attach this patch to the wrong bug.
Comment 3 Katrin Fischer 2021-06-04 09:50:58 UTC
I think it would be quite hard to do in some cases.

If we had FK constraints in the database a lot of the change could be handled automatically, but we are not quite there yet. At least for item type codes this could work, I think

Not sure about authorised values - they are used so differently in so many tables that it would probably be a lot more risky to get this to work reliably. On the other hand - those codes can already be changed.