When you try to create an order from a staged file, you get a sql error: DBD::mysql::st execute failed: called with 2 bind variables when 1 are needed at /home/koha/src/C4/Members.pm line 559
Created attachment 14070 [details] [review] Bug 9281: FIX add an order from a staged file In GetMember the hash parameter contained 'C4::Members' => 'borrowernumber' XXX => undef Test plan: In the acquition module, try to add an order to a basket from a staged file. Without this patch, you get an error: DBD::mysql::st execute failed: called with 2 bind variables when 1 are needed at /home/koha/src/C4/Members.pm line 559
Created attachment 14139 [details] [review] Bug 9281: FIX add an order from a staged file In GetMember the hash parameter contained 'C4::Members' => 'borrowernumber' XXX => undef Test plan: In the acquition module, try to add an order to a basket from a staged file. Without this patch, you get an error: DBD::mysql::st execute failed: called with 2 bind variables when 1 are needed at /home/koha/src/C4/Members.pm line 559 Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 14143 [details] [review] Bug 9284 - JavaScript should follow rules recommended by JSHint Coding style corrections to members.js: - Mixed tab/space indentation converted to spaces. - Converted "!=" and "==" to "!==" and "===" for comparisons with ''. - Adding missing semicolons. To test, create or edit a patron and confirm that validation hasn't been broken by the changes to members.js: Invalid date, empty required fields, guarantor popup, restricted-until field display, etc.
Comment on attachment 14143 [details] [review] Bug 9284 - JavaScript should follow rules recommended by JSHint Sorry, wrong bug number!
Hi Jonathan, I am sorry, but I can't reproduce the problem described. I added 2 order lines from a file I had staged some time ago and no error appeared. I also tried adding the rest of the staged file as batch and the orders were created perfectly. The logs are clean too. AcqCreateItem is set to 'on receive'. What am I missing?
(In reply to comment #5) > What am I missing? Hi Katrin, Yep I forgot 1 thing, on the "Add orders from" page, click on the "Save" button instead of the "Add order" link.
Hi Jonathan, I just tried it again and I think I already did it yesterday: >I also tried adding the rest of the staged file as batch and the orders were >created perfectly. You mean the save button at the bottom of the page below the accounting details box? I successfully added all records from a staged file as orders that way - on error. Is there another condition that has to be met to trigger the error?
(In reply to comment #7) > You mean the save button at the bottom of the page below the accounting > details box? Yes > I successfully added all records from a staged file as orders > that way - on error. Is there another condition that has to be met to > trigger the error? hum... strange. Could you dump the hash in GetMember please? (in C4/Members.pm l.530: warn Data::Dumper::Dumper \%information;) I get: $VAR1 = { 'C4::Members' => 'borrowernumber', '55' => undef, # 55 is $borrowernumber } According to the code, you should enter in this routine for each biblio contained in your staged file.
Hi Jonathan, I am not sure I did it right, as my output looks quite different to yours. I added it at the beginning of the GetMembers routing, but the line number was totally different to the one you noted in your comment. Could you check?
[Sun Jan 20 23:24:55 2013] [error] [client 127.0.0.1] [Sun Jan 20 23:24:55 2013] basket.pl: $VAR1 = {, referer: http://localhost:8080/cgi-bin/koha/acqui/addorderiso2709.pl?import_batch_id=12&basketno=9&booksellerid=2 [Sun Jan 20 23:24:55 2013] [error] [client 127.0.0.1] [Sun Jan 20 23:24:55 2013] basket.pl: 'borrowernumber' => '1', referer: http://localhost:8080/cgi-bin/koha/acqui/addorderiso2709.pl?import_batch_id=12&basketno=9&booksellerid=2 [Sun Jan 20 23:24:55 2013] [error] [client 127.0.0.1] [Sun Jan 20 23:24:55 2013] basket.pl: };, referer: http://localhost:8080/cgi-bin/koha/acqui/addorderiso2709.pl?import_batch_id=12&basketno=9&booksellerid=2
Created attachment 14738 [details] test file Hi Katrin, Could you test this perl script on master please? perl test_bug9281.pl gives me DBD::mysql::st execute failed: called with 2 bind variables when 1 are needed at /home/koha/src/C4/Members.pm line 560. Can't use an undefined value as an ARRAY reference at /usr/lib/perl5/DBI.pm line 2054.
Hi Jonathan, thank you for your patience. The file you provided gives me the error when running it and I finally found the error in my log files on ordering from a staged record: [Wed Jan 23 08:25:51 2013] [error] [client 127.0.0.1] [Wed Jan 23 08:25:51 2013] addorderiso2709.pl: DBD::mysql::st execute failed: called with 2 bind variables when 1 are needed at /home/katrin/kohaclone/C4/Members.pm line 559., referer: http://localhost:8080/cgi-bin/koha/acqui/addorderiso2709.pl?import_batch_id=15&basketno=10&booksellerid=2 I still wonder, what kind of problem this will cause, as it seems that the acquisition module works correctly, with and without the patch. But there is nothing to say against the patch - passing QA :)
Created attachment 14767 [details] [review] [SIGNED-OFF] Bug 9281: FIX add an order from a staged file In GetMember the hash parameter contained 'C4::Members' => 'borrowernumber' XXX => undef Test plan: In the acquition module, try to add an order to a basket from a staged file. Without this patch, you get an error: DBD::mysql::st execute failed: called with 2 bind variables when 1 are needed at /home/koha/src/C4/Members.pm line 559 Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> All tests pass, error only appearing in the log file. Test plan: 1) Create a basket 2) Add one or multiple order lines using a staged file and the 'batch' feature. This is done by using the "Save" button at the bottom of the page instead of the "Add order" link next to a single entry. 3) Check your koha-error_log for the error above.
This patch has been pushed to master.
Pushed to 3.10.x and 3.8.x will be in 3.10.3 and 3.8.10