[Bug 22291] New: 'Batch modify' button on itemnumber causes internal server error if itemnumbers do not correspond to real items.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22291 Bug ID: 22291 Summary: 'Batch modify' button on itemnumber causes internal server error if itemnumbers do not correspond to real items. Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Reports Assignee: koha-bugs@lists.koha-community.org Reporter: barton@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org Target Milestone: --- To re-create: Create a new report from SQL using the following query: select title, itemnumber + 1 as itemnumber from biblio inner join items using (biblionumber) order by itemnumber desc LIMIT 1 The value in the itemnumber column will *not* correspond to any item in the items table. Run the report and click the 'Batch modify' button. This causes an internal server error with the following error message: Can't call method "title" on an undefined value at /usr/share/koha/intranet/cgi-bin/tools/batchMod.pl line 583. The problem is that 'my $biblio = Koha::Biblios->find( $itemdata->{biblionumber}' at line 577 *can't* be guaranteed to return a valid biblio record, so we *must* check whether it's defined before we access its members. 575 # grab title, author, and ISBN to identify bib that the item 576 # belongs to in the display 577 my $biblio = Koha::Biblios->find( $itemdata->{biblionumber} );
578 $this_row{title} = $biblio->title; 579 $this_row{author} = $biblio->author; 580 $this_row{isbn} = $biblio->biblioitem->isbn; 581 $this_row{biblionumber} = $biblio->biblionumber;
-- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22291 Barton Chittenden <barton@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |minor -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22291 --- Comment #1 from Barton Chittenden <barton@bywatersolutions.com> --- Note that even though the query that I used to illustrate this problem won't ever occur in production, this was triggered by a real report, that looked something like this: SELECT aqbasket.basketname, aqbasket.closedate, aqorders.biblionumber, aqorders_items.itemnumber, items.itemnumber AS 'items.itemnumber', biblio.title, items.barcode FROM aqbasket LEFT JOIN aqorders USING (basketno) LEFT JOIN aqorders_items on (aqorders.ordernumber = aqorders_items.ordernumber) LEFT JOIN biblio on (aqorders.biblionumber = biblio.biblionumber) LEFT JOIN items on (aqorders_items.itemnumber = items.itemnumber) WHERE aqbasket.basketname='XXXXXXXXXXXXXX' GROUP BY aqorders_items.itemnumber The 'Batch Modify' button was attached to the 'aqorders_items.itemnumber' column, and there were instances where that was populated, even when 'items.itemnumber' was NULL. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22291 Margaret <margaret@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |margaret@bywatersolutions.c | |om -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22291 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Can you give us a step by step plan to recreate the problem please? I have try to use the SQL query from comment 1: - Create an order with 3 items - Receive - Remove an item - Execute the report => I see the 3 lines with an itemnumber that have been deleted (ie. do not longer exist in the items table). - Batch operation, delete items => I see 2 items to delete -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22291 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |WORKSFORME Status|NEW |RESOLVED --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I can't find any error with the batch operations, but filed a new report for the links on the single entries: Bug 34898 - Links in reports don't work when item/record/patron have been deleted -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org