Bugzilla – Attachment 103953 Details for
Bug 24772
Deactivating course reserves before deleting the same course empties/resets course reserve values in the items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24772: Don't revert course item fields when deleting a course item unless it is enabled
Bug-24772-Dont-revert-course-item-fields-when-dele.patch (text/plain), 1.58 KB, created by
Kyle M Hall (khall)
on 2020-04-29 14:44:14 UTC
(
hide
)
Description:
Bug 24772: Don't revert course item fields when deleting a course item unless it is enabled
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2020-04-29 14:44:14 UTC
Size:
1.58 KB
patch
obsolete
>From 669e1b1c5c14e82666b032f19b28b46c96ccb861 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 29 Apr 2020 10:40:21 -0400 >Subject: [PATCH] Bug 24772: Don't revert course item fields when deleting a > course item unless it is enabled > >Deactivating a from Course Reserves reverts Item's Shelving Location >correctly, then deleting the same course reverts the Course Reserve >Items to old shelving location values. > >Test Plan: >1) Add items to a Course - make sure they all have shelving locations >prior to being added to the course. >2) When adding items change their shelving location to something else. > See that Shelving Location has changed; permanent location in >parentheses >3) Deactivated course > See that Shelving Location has changed back to its original location >4) Deleted course > See that Shelving Location has changed back to what was picked during >adding it to the Course. >5) Apply this patch, restart all the things! >6) Repeat steps 1-4, note the shelvig location is not lost! >--- > C4/CourseReserves.pm | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/C4/CourseReserves.pm b/C4/CourseReserves.pm >index 06101db1d3..dbc4ce2177 100644 >--- a/C4/CourseReserves.pm >+++ b/C4/CourseReserves.pm >@@ -693,7 +693,10 @@ sub DelCourseItem { > > return unless ($ci_id); > >- _RevertFields( ci_id => $ci_id ); >+ my $course_item = Koha::Course::Items->find( $ci_id ); >+ return unless $course_item; >+ >+ _RevertFields( ci_id => $ci_id ) if $course_item->enabled eq 'yes'; > > my $query = " > DELETE FROM course_items >-- >2.24.2 (Apple Git-127)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24772
:
103953
|
104085
|
104098
|
104106
|
104107