Bug 22142: Highlight the issue
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 52885ff55b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
027d317a66
commit
5f8bc12e59
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue