Bug 18928: (bug 22679 follow-up) Do not remove all rules along with the issuing rule
We actually want to remove maxissueqty, maxonsiteissueqty and max_holds (for now) Signed-off-by: Agustin Moyano <agustinmoyano@theke.io> Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
86f37b1eb3
commit
d52ec38cef
|
|
@ -46,6 +46,11 @@ sub delete {
|
|||
branchcode => $branchcode,
|
||||
itemtype => $itemtype,
|
||||
categorycode => $categorycode,
|
||||
rule_name => [qw(
|
||||
maxissueqty
|
||||
maxonsiteissueqty
|
||||
max_holds
|
||||
)],
|
||||
})->delete;
|
||||
|
||||
$self->SUPER::delete;
|
||||
|
|
|
|||
|
|
@ -329,19 +329,28 @@ subtest 'delete' => sub {
|
|||
$builder->build_object({ class => 'Koha::CirculationRules', value => {
|
||||
categorycode => $category->categorycode,
|
||||
itemtype => $itemtype->itemtype,
|
||||
branchcode => $library->branchcode
|
||||
branchcode => $library->branchcode,
|
||||
rule_name => 'maxissueqty',
|
||||
}
|
||||
});
|
||||
$builder->build_object({ class => 'Koha::CirculationRules', value => {
|
||||
categorycode => $category->categorycode,
|
||||
itemtype => $itemtype->itemtype,
|
||||
branchcode => $library->branchcode
|
||||
branchcode => $library->branchcode,
|
||||
rule_name => 'maxonsiteissueqty',
|
||||
}
|
||||
});
|
||||
$builder->build_object({ class => 'Koha::CirculationRules', value => {
|
||||
categorycode => $category->categorycode,
|
||||
itemtype => $itemtype->itemtype,
|
||||
branchcode => $library->branchcode,
|
||||
rule_name => 'another_rule', # That must not be deleted
|
||||
}
|
||||
});
|
||||
|
||||
# Now we delete the issuing rule
|
||||
$issue_rule->delete;
|
||||
is( Koha::CirculationRules->search()->count ,$count, "We remove related circ rules with our issuing rule");
|
||||
is( Koha::CirculationRules->search()->count ,$count + 1, "We remove related circ rules maxissueqty and maxonsiteissueqty with our issuing rule");
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue