Bug 31568

Summary: Renaming/removing an authorised value does not cascade to linked tables
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: System AdministrationAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: gmcharlt, jonathan.druart, martin.renvoize, tomascohen
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21466
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Marcel de Rooy 2022-09-15 08:43:23 UTC
We could give lots of examples here.
E.g. location is controlled by category LOC having a value like CHILD. If you rename it to CHILDREN, your items still contain the old value.

This cannot be solved with a FK since an authorised value may be in use under several AV categories.

Maybe there are cases where you do not want to have an AV immediately cascade the change in a linked table?

Also note that we have a maintenance script looking for these inconsistencies (bug 21466), but if we could reduce the volume here, I wouldnt mind.

How should we best address this need?
Comment 1 Marcel de Rooy 2022-09-15 08:45:45 UTC
Feedback welcome
Comment 2 Jonathan Druart 2022-10-17 08:24:20 UTC
Well, there is the script :)

An other solution could be to SELECT COUNT(*) FROM items where location = $old_value
and display an alert if there are some. You could also provide a link to the batch mod item with the items to modify.
Comment 3 Katrin Fischer 2022-11-16 23:40:11 UTC
In theory I guess we could look up via the frameworks if a authorised value is used and then offer to update the items or at least display a warning.

Fixing this in general for all types of AV would probably turn out a bit nightmarish.