Bug 15790 - Don't delete a MARC framework if existing records use that framework
Summary: Don't delete a MARC framework if existing records use that framework
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL: /cgi-bin/koha/admin/biblio_framework.pl
Keywords:
Depends on: 15785
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-10 20:07 UTC by Owen Leonard
Modified: 2017-06-14 22:11 UTC (History)
5 users (show)

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


Attachments
Bug 15790 - Don't delete a MARC framework if existing records use that framework (3.65 KB, patch)
2016-02-11 17:14 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 15790 - Don't delete a MARC framework if existing records use that framework (3.76 KB, patch)
2016-02-11 17:31 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 15790 - Don't delete a MARC framework if existing records use that framework (3.83 KB, patch)
2016-02-12 13:11 UTC, Jonathan Druart
Details | Diff | Splinter Review
[3.22.x] Bug 15790 - Don't delete a MARC framework if existing records use that framework (3.07 KB, patch)
2016-03-07 10:25 UTC, Julian Maurice
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2016-02-10 20:07:48 UTC
In contrast with item types, where you cannot delete an item type if existing records use it, Koha will let you delete a MARC framework even if there are existing records which use that framework code. I think the correct behavior is to prevent the user from proceeding with the deletion.
Comment 1 Owen Leonard 2016-02-11 17:14:18 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2016-02-11 17:31:39 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2016-02-12 13:11:58 UTC
Created attachment 47973 [details] [review]
Bug 15790 - Don't delete a MARC framework if existing records use that framework

If a MARC framework is in use by any records it should not be possible
to delete it. Deleting a framework which is in use will leave the
deleted framework code in those records.

This patch modifies the deletion confirmation dialog so that it will not
let the user confirm the deletion if there are records using it.

Depends on Bug 15785 - Use Font Awesome icons in confirmation dialogs

To test, apply the patch and go to Administration -> MARC frameworks

1. Try to delete a framework which is in use by 1 or more records. The
   resulting confirmation dialog should prevent you from proceeding.
2. Try to delete a framework which is not in use. Test both canceling
   and confirming that deletion to make both function correctly.

Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Brendan Gallagher 2016-02-23 20:52:43 UTC
Pushed to Master - Should be in the May 2016 Release.  Thanks!
Comment 5 Julian Maurice 2016-03-07 10:25:01 UTC
Created attachment 48731 [details] [review]
[3.22.x] Bug 15790 - Don't delete a MARC framework if existing records use that framework

Patch for 3.22.x
Comment 6 Julian Maurice 2016-03-07 10:25:19 UTC
Patch pushed to 3.22.x, will be in 3.22.5
Comment 7 Frédéric Demians 2016-03-15 08:58:46 UTC
This patch has been pushed to 3.20.x, will be in 3.20.10.