[Bug 6673] New: Create Batch Label from Staged MARC Records fails after upgrade to 3.4.x
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6673 Bug #: 6673 Summary: Create Batch Label from Staged MARC Records fails after upgrade to 3.4.x Classification: Unclassified Change sponsored?: --- Product: Koha Version: rel_3_4 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P5 Component: Label printing AssignedTo: cnighswonger@foundations.edu ReportedBy: larry@bywatersolutions.com QAContact: koha-bugs@lists.koha-community.org Several sites are reporting that after upgrading Koha 3.4.x, they are unable to run Create Batch Label, from the Staged MARC Records page. Error message is: "Error attempting to create label batch. Please ask your system administrator to check the log for more details." -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6673 --- Comment #1 from Ian Walls <ian.walls@bywatersolutions.com> 2011-08-05 16:52:32 UTC --- Created attachment 4869 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=4869 Proposed fix -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6673 Ian Walls <ian.walls@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 |PATCH-Sent CC| |ian.walls@bywatersolutions. | |com Patch Status|--- |Needs Signoff -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6673 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #4869|0 |1 is obsolete| | --- Comment #2 from Chris Cormack <chris@bigballofwax.co.nz> 2011-08-06 00:56:04 UTC --- Created attachment 4874 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=4874 Bug 6673: Create Batch Label from Staged MARC Records fails For some reason, the code attempts to get the current users branch in the following manner: $branch_code = get_branch_code_from_name($template->param('LoginBranchname')) This seems particularly cumbersome and prone to failure if there is not template param LoginBranchname. This patch changes the given line to use the more traditional method for finding current branchcode: $branch_code = C4::Context->userenv->{'branch'}; Initial testing shows this to help alleviate the problem Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6673 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz Patch Status|Needs Signoff |Signed Off --- Comment #3 from Chris Cormack <chris@bigballofwax.co.nz> 2011-08-06 00:56:47 UTC --- Works well, is more robust. Signed Off -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6673 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED AssignedTo|cnighswonger@foundations.ed |chris@bigballofwax.co.nz |u | --- Comment #4 from Owen Leonard <oleonard@myacpl.org> 2011-08-08 15:27:13 UTC --- I just tried testing this by doing the following: - Apply the patch (attachment 4874) to my test system - Export a batch of MARC records from our live system - Import the batch into my test system - Find the batch listed on the Manage Staged MARC Records page - Click 'Create Label Batch' link for that set I still got "Error attempting to create label batch" message. In my logs I find this: manage-marc-import.pl: create_labelbatch_from_importbatch() : Call to C4::ImportBatch::GetItemNumbersFromImportBatch returned no item number(s) from import batch #13. at /home/oleonard/kohaclone/tools/manage-marc-import.pl line 196. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6673 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |brendan@bywatersolutions.co | |m --- Comment #5 from Brendan Gallagher <brendan@bywatersolutions.com> 2011-08-09 03:57:18 UTC --- Owen - Can you try it with a new batch of items - instead of ones that are already in your system. I just want to compare the differences. Looking at the database - I see the batches that are not adding items (are going into the database with a NULL itemnumber in the labels_database tables - since they are already in there). It will just give me another spot to test on. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6673 --- Comment #6 from Owen Leonard <oleonard@myacpl.org> 2011-08-24 13:17:35 UTC --- Sorry, looks like I neglected to post the results of my last test: Adding a batch of items which I've gotten from an external source still result in the same error in my test system running current master. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6673 --- Comment #7 from Ian Walls <ian.walls@bywatersolutions.com> 2011-09-21 02:16:07 UTC --- Owen, I've discovered that it's not possible to create a label batch if do not have a branch set, as is the default with the Koha database user. The branchcode added to the system must be a valid entry. Are you testing with that user, or with a specific patron account? I've poked through this pretty thoroughly... not sure what else it could be -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6673 --- Comment #8 from Ian Walls <ian.walls@bywatersolutions.com> 2011-09-21 02:29:25 UTC --- Further evidence: all other invocations of the variable LoginBranchname work like this: get_branch_code_from_name($template->{VARS}->{'LoginBranchname'}) Whereas (at least before the attached patch), manage-marc-import.pl does this: get_branch_code_from_name($template->param('LoginBranchname')) By default, LoginBranchname is defined as: C4::Context->userenv?C4::Context->userenv->{"branchname"}:"insecure" or C4::Context->userenv?C4::Context->userenv->{"branchname"}:"" depending on what part of C4/Auth.pm you look at. Since 'insecure' and '' are both invalid entries, it makes more sense to bypass the code=>name=>code jump, and just invoke the code in the standard fashion, as submitted in this patch. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6673 --- Comment #9 from Chris Cormack <chris@bigballofwax.co.nz> 2011-09-21 02:39:16 UTC --- Furthermore In 3.4.x and onwards, $template->param('LoginBranchname') always returns nothing $template->param('anything') will always return nothing. With the change to template::toolkit the param call is just a wrapper to set a variable for use by the template: $template->param('fish' => 'food') == $template->{VARS}->{'fish'} = 'food'; $template->param('fish') == $template->{VARS}-{'fish'} = ''; The way to get a variable is $template->{VARS}->{'LoginBranchname'} I agree, we may as well just fetch the branch for the userenv. The reason its failing now, is branch is never going to be set with the existing code -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6673 Ian Walls <ian.walls@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #4874|0 |1 is obsolete| | --- Comment #10 from Ian Walls <ian.walls@bywatersolutions.com> 2011-09-21 15:13:40 UTC --- Created attachment 5495 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=5495 Expanded patch This expanded patch removes all usage of get_branchcode_by_name($template->param('LoginBranchname')) and get_branchcode_by_name($template->{VARS}->('LoginBranchname')) in favour of the more standard C4::Context->userenv->{'branch'} call. This occurs 5 places in the code, all related to Labels -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6673 Ian Walls <ian.walls@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch Status|Signed Off |Needs Signoff -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6673 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #5495|0 |1 is obsolete| | --- Comment #11 from Owen Leonard <oleonard@myacpl.org> 2011-09-27 19:17:43 UTC --- Created attachment 5620 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=5620 Signed-off patch I tested this batch on a fresh data set and found it to work. Before applying the patch, attempting to create a label batch from an imported MARC record batch (/cgi-bin/koha/tools/manage-marc-import.pl?import_batch_id=xx&op=create_labels) would result in an error. After applying the patch the label batch is created without errors. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6673 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch Status|Needs Signoff |Signed Off AssignedTo|chris@bigballofwax.co.nz |ian.walls@bywatersolutions. | |com -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6673 Ian Walls <ian.walls@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch Status|Signed Off |Passed QA --- Comment #12 from Ian Walls <ian.walls@bywatersolutions.com> 2011-09-27 19:23:30 UTC --- I'm very confident of my marking this patch Passed QA, but if anyone would like another set of eyes on this before it gets committed, please speak up. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6673 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch Status|Passed QA |Patch Pushed --- Comment #13 from Chris Cormack <chris@bigballofwax.co.nz> 2011-09-28 07:36:33 UTC --- Pushed, please test -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org