Bug 31568 - Renaming/removing an authorised value does not cascade to linked tables
Summary: Renaming/removing an authorised value does not cascade to linked tables
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-15 08:43 UTC by Marcel de Rooy
Modified: 2022-11-16 23:40 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:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.