Bug 20227: Check for categorycode in default_borrower_circ_rules
Fixes silent crash when adding the same category twice.
DBD::mysql::st execute failed: Duplicate entry 'ST' for key 'PRIMARY' [for Statement "
INSERT INTO default_borrower_circ_rules
(categorycode, maxissueqty, maxonsiteissueqty, max_holds)
VALUES (?, ?, ?, ?)
" with ParamValues: 0="ST", 1=undef, 2=undef, 3="3"] at /usr/share/koha/devclone/admin/smart-rules.pl line 309.
(Line number affected by bug 15524.)
Very trivial solution.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
427b9a70ba
commit
4339291f44
|
|
@ -296,7 +296,7 @@ elsif ($op eq "add-branch-cat") {
|
|||
maxonsiteissueqty = ?
|
||||
WHERE categorycode = ?
|
||||
|);
|
||||
$sth_search->execute($branch);
|
||||
$sth_search->execute($categorycode);
|
||||
my $res = $sth_search->fetchrow_hashref();
|
||||
if ($res->{total}) {
|
||||
$sth_update->execute($maxissueqty, $maxonsiteissueqty, $categorycode);
|
||||
|
|
|
|||
Loading…
Reference in New Issue