Bug 14205: Deleting an Item/Record does not remove link to course reserve
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 4 Aug 2015 09:00:51 +0000 (10:00 +0100)
committerTomas Cohen Arazi <tomascohen@unc.edu.ar>
Wed, 2 Sep 2015 12:40:47 +0000 (09:40 -0300)
commitfc568dfb22238a052d7772a0bba374f836543d46
treeae4cb6f0fef07efe6b3f1f6eced1d659703c81be
parent438b62e8ffcbab3742ab9a48602a9653b1afde6f
Bug 14205: Deleting an Item/Record does not remove link to course reserve

A constraint is missing on the course_reserves.ci_id field.
This patch adds it and removes orphan rows.

Test plan:
0/ Don't apply the patch
1/ Login to Staff Site.
2/ Go to Course Reserves
3/ Create Course
4/ Add Reserve
5/ Go to item added (delete item/record)
6/ Refresh Course (see no items attached)
7/ Delete Course
8/ See course still listed in the courses (Not deleted)
9/ Apply the patch and execute the updatedatabase entry.
10/ Delete the Course
Note that the course has correctly been removed.

NOTE: Make sure to set the UseCourseReserves system preference to test.
      Tested before (problem existed) and after (problem solved) update.
      Dropped DB, web installed, and put in dummy data and retested.
      Problem solved.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
installer/data/mysql/atomicupdate/bug_14205-add_fk_course_reserves_ci_id.sql [new file with mode: 0644]
installer/data/mysql/kohastructure.sql