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.
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>
Passing QA on this trivial patch in conjunction with 15524. It is submitted separately in order to allow easy backporting.
Caused by bug 2000, outch!
Pushed to master for 18.05, thanks to everybody involved!
Awesome work all! Pushed to stable for 17.11.03
Pushed to 17.05.x for 17.05.12