Bugzilla – Attachment 92152 Details for
Bug 22142
An item's current location changes to blank when it is removed from Course Reserves
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22142: Highlight the issue
Bug-22142-Highlight-the-issue.patch (text/plain), 3.74 KB, created by
Kyle M Hall (khall)
on 2019-08-12 12:32:59 UTC
(
hide
)
Description:
Bug 22142: Highlight the issue
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2019-08-12 12:32:59 UTC
Size:
3.74 KB
patch
obsolete
>From 1735c7542b78a5e19b04f44e8c052ce79bc2eb9f Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 13 Jun 2019 14:20:25 +0000 >Subject: [PATCH] Bug 22142: Highlight the issue > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/CourseReserves/CourseItems.t | 69 +++++++++++++++++++++ > 1 file changed, 69 insertions(+) > >diff --git a/t/db_dependent/CourseReserves/CourseItems.t b/t/db_dependent/CourseReserves/CourseItems.t >index aca171571c..38ceaa39e3 100644 >--- a/t/db_dependent/CourseReserves/CourseItems.t >+++ b/t/db_dependent/CourseReserves/CourseItems.t >@@ -167,6 +167,75 @@ DelCourseReserve( cr_id => $cr_id2 ); > $item = Koha::Items->find($itemnumber); > is($item->ccode, '', 'Item ccode should be set back to empty'); > >+subtest 'Ensure item info is preserved' => sub { >+ plan tests => 8; >+ >+ my $course = $builder->build({ >+ source => 'Course', >+ value => { >+ enabled => 'no', >+ } >+ }); >+ my $item = $builder->build_sample_item({ ccode=>"grasshopper", location=>"transylvania"}); >+ #Add course item but change nothing >+ my $course_item_id = ModCourseItem( >+ itemnumber => $item->itemnumber, >+ itype => '', >+ ccode => '', >+ holdingbranch => '', >+ location => '', >+ ); >+ #Add course reserve >+ my $course_reserve_id = ModCourseReserve( >+ course_id => $course->{course_id}, >+ ci_id => $course_item_id, >+ staff_note => '', >+ public_note => '', >+ ); >+ #Remove course reservei >+ DelCourseReserve( cr_id => $course_reserve_id ); >+ my $item_after = Koha::Items->find( $item->itemnumber ); >+ is( $item->itype, $item_after->itype, "Itemtype is unchanged after adding to and removing from course reserves for inactive course"); >+ is( $item->location, $item_after->location, "Location is unchanged after adding to and removing from course reserves for inactive course"); >+ is( $item->holdingbranch, $item_after->holdingbranch, "Holdingbranch is unchanged after adding to and removing from course reserves for inactive course"); >+ is( $item->ccode, $item_after->ccode, "Collection is unchanged after adding to and removing from course reserves for inactive course"); >+ >+ $course = $builder->build({ >+ source => 'Course', >+ value => { >+ enabled => 'yes', >+ } >+ }); >+ $item = $builder->build_sample_item({ ccode=>"grasshopper", location=>"transylvania"}); >+ #Add course item but change nothing >+ $course_item_id = ModCourseItem( >+ itemnumber => $item->itemnumber, >+ itype => '', >+ ccode => '', >+ holdingbranch => '', >+ location => '', >+ ); >+ #Add course reserve >+ $course_reserve_id = ModCourseReserve( >+ course_id => $course->{course_id}, >+ ci_id => $course_item_id, >+ staff_note => '', >+ public_note => '', >+ ); >+ #Remove course reserve >+ DelCourseReserve( cr_id => $course_reserve_id ); >+ $item_after = Koha::Items->find( $item->itemnumber ); >+ is( $item->itype, $item_after->itype, "Itemtype is unchanged after adding to and removing from course reserves for inactive course"); >+ is( $item->location, $item_after->location, "Location is unchanged after adding to and removing from course reserves for inactive course"); >+ is( $item->holdingbranch, $item_after->holdingbranch, "Holdingbranch is unchanged after adding to and removing from course reserves for inactive course"); >+ is( $item->ccode, $item_after->ccode, "Collection is unchanged after adding to and removing from course reserves for inactive course"); >+ >+}; >+ >+ >+ >+ >+ > $schema->storage->txn_rollback; > > sub create_dependent_objects { >-- >2.20.1 (Apple Git-117)
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 22142
:
90577
|
92015
|
92152
|
92153
|
92168
|
92169