Bug 20227 - admin/smart-rules.pl should pass categorycode instead of branchcode
Summary: admin/smart-rules.pl should pass categorycode instead of branchcode
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff Client (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on: 2000
Blocks: 15524
  Show dependency treegraph
 
Reported: 2018-02-16 10:59 UTC by Marcel de Rooy
Modified: 2018-08-22 15:18 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 20227: Check for categorycode in default_borrower_circ_rules (1.46 KB, patch)
2018-02-16 11:05 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2018-02-16 10:59:36 UTC
Found while testing bug 15524.
Trivial error. Field mixed up (copy-paste).

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.
Comment 1 Marcel de Rooy 2018-02-16 11:05:56 UTC
Created attachment 71712 [details] [review]
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>
Comment 2 Marcel de Rooy 2018-02-16 11:16:36 UTC
Passing QA on this trivial patch in conjunction with 15524.
It is submitted separately in order to allow easy backporting.
Comment 3 Jonathan Druart 2018-02-16 16:27:53 UTC
Caused by bug 2000, outch!
Comment 4 Jonathan Druart 2018-02-16 17:07:25 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 5 Nick Clemens 2018-02-26 11:40:32 UTC
Awesome work all! Pushed to stable for 17.11.03
Comment 6 Fridolin SOMERS 2018-05-09 14:46:42 UTC
Pushed to 17.05.x for 17.05.12