Bug 22722 - Deleting a library leaves the letters and shows them belonging to "All libraries"
Summary: Deleting a library leaves the letters and shows them belonging to "All librar...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-17 07:16 UTC by paxed
Modified: 2023-09-23 22:36 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description paxed 2019-04-17 07:16:31 UTC
When you delete a library, any notices or slips belonging to it are not deleted.

If there are any letters for a library which does not exist, the Notices tool shows the letter as belonging to "All libraries". This could lead to problems, when an admin sees two identical lines in the tool, and then deletes the one actually belonging to all libraries.
Comment 1 Katrin Fischer 2019-04-17 07:27:57 UTC
Probably a missing FK?
Comment 2 Rogan Hamby 2019-07-05 19:40:17 UTC
There is definitely a missing foreign key.  Right now with the sample data that is loaded if you have a test system letter entries have an empty space to get around the NOT NULL constraint.  

It's fairly straight forward to add the FK but (and I ask this as someone new to looking to contribute more to Koha) how does the community view adding this?  It would break the sample data and obviously need to be taken into account for upgrade scripts.
Comment 3 Katrin Fischer 2023-09-23 22:36:16 UTC
I think it doesn't necessarily break things, we can have an FK that allows NULL - but I guess cleaning up the old left over data might require some warning?