[Bug 19771] New: Pending offline circulation actions page will crash on unknown barcode
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19771 Bug ID: 19771 Summary: Pending offline circulation actions page will crash on unknown barcode Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: matthias.meusburger@biblibre.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com Test plan: Use the koct firefox plugin or a .koc file and make a return with an unknown barcode. Display the Pending offline circulation actions page: offline_circ/list.pl => The page crashes with a software error: Can't call method "biblio" on an undefined value at /home/koha/src/offline_circ/list.pl line 50. Apply the patch, repeat the test plan. => The page shows the list correctly. Click on process. The unknown barcode is marked as Item not found. -- 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=19771 --- Comment #1 from Matthias Meusburger <matthias.meusburger@biblibre.com> --- Created attachment 69610 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69610&action=edit Bug 19771: Prevent Pending offline circulation actions page from crashing when there is an unknown barcode Test plan: Use the koct firefox plugin or a .koc file and make a return with an unknown barcode. Display the Pending offline circulation actions page: offline_circ/list.pl => The page crashes with a software error: Can't call method "biblio" on an undefined value at /home/koha/src/offline_circ/list.pl line 50. Apply the patch, repeat the test plan. => The page shows the list correctly. Click on process. The unknown barcode is marked as Item not found. -- 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=19771 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |josef.moravec@gmail.com --- Comment #2 from Josef Moravec <josef.moravec@gmail.com> --- Is this ready for test? If so, please set the status to Need Signoff. -- 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=19771 --- Comment #3 from Josef Moravec <josef.moravec@gmail.com> --- The page crashes also when a payment is on the list - it goes through all operations, and payment does even have no barcode... -- 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=19771 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69610|0 |1 is obsolete| | --- Comment #4 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 69837 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69837&action=edit Bug 19771: Fix crashing in pending offline circulation actions list 0) Do not apply the patch 1) Add some checkout / checkin actions on existing barcodes, you can use standalone application, Firefox add-on or built-in offline circulation client 2) Go to Circulation -> Pending offline circulation actions and you will see you actions in the table 3) Add some actions with non-exitent barcodes or a payment 4) Go to Circulation -> Pending offline circulation actions - the page crashes 5) Apply the patch 6) Go to Circulation -> Pending offline circulation actions - the page is working again -- 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=19771 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |major Summary|Pending offline circulation |Pending offline circulation |actions page will crash on |actions page will crash on |unknown barcode |unknown barcode or on | |payment action Assignee|koha-bugs@lists.koha-commun |josef.moravec@gmail.com |ity.org | Status|NEW |Needs Signoff --- Comment #5 from Josef Moravec <josef.moravec@gmail.com> --- I added a counterpatch, could you please test? -- 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=19771 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=19825 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19771 --- Comment #6 from Matthias Meusburger <matthias.meusburger@biblibre.com> --- Your patch works well, it prevents from crashing on a unknown barcode. However, I couldn't reproduce the crash on a payment. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19771 --- Comment #7 from M. Tompsett <mtompset@hotmail.com> --- Comment on attachment 69837 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69837 Bug 19771: Fix crashing in pending offline circulation actions list Review of attachment 69837: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=19771&attachment=69837) ----------------------------------------------------------------- ::: offline_circ/list.pl @@ +50,5 @@
+ if ($item) { + my $biblio = $item->biblio; + $_->{'bibliotitle'} = $biblio->title; + $_->{'biblionumber'} = $biblio->biblionumber; + }
Uses same type of logic as $patron below. Nice. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19771 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtompset@hotmail.com --- Comment #8 from M. Tompsett <mtompset@hotmail.com> --- (In reply to Matthias Meusburger from comment #6)
Your patch works well, it prevents from crashing on a unknown barcode.
However, I couldn't reproduce the crash on a payment.
I will revise test plan so it is explicitly clear. I confirmed it does fail on payments. I am also pleased to announce that FINALLY, I RTFM'd regarding the offline client, and am much happier about it now. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19771 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69837|0 |1 is obsolete| | --- Comment #9 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 70695 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70695&action=edit Bug 19771: Fix crashing in pending offline circulation actions list When the barcode is empty or invalid, an "Internal Server Error" is triggered on the kohadev box. TEST PLAN --------- 0) back up your database if you care about it. 1) Run the following commands: git checkout master git pull git checkout -b bug_19771 origin/master git bz apply 19771 -- This should be quite uneventful. Standard promptings. 2) Continue to run the following commands: git checkout master reset_all sudo koha-shell -c bash kohadev ./misc/cronjobs/create_te_koc_db.pl --sqlite3 -- This will create a borrowers.db in your current directory. 3) On the host where you intend on running the koct install it. -- https://sourceforge.net/projects/koha-oc/files/ download and install. 4) get the borrowers.db file to your host where you installed koct 5) point koct at the file you downloaded Database -> Select Borrowers DB File 6) Create a .koc file with the following transactions. check in, check out, check in (bad barcode), pay fines (any non-zero amount). 7) Run the following commands: restart_all -- we want to make sure caching for plack isn't in the way. 8) In the staff client: Home -> Circulation -> Upload offline circulation file (.koc) 9) Choose the file created and click 'Upload file'. 10) Add to offline circulation queue. 11) View pending offline circulation actions -- This should die. Reading /var/log/koha/kohadev/plack-error.log should be the same error as comment #0. However, this was only the bad biblio error. 12) Run the following commands: git checkout bug_19771 restart_all 13) Refresh staff client page. -- it should all come up. 14) Select the bad biblio line, and delete it. 15) Run the following commands: git checkout master restart_all 16) Refresh the staff client page. -- it should die. Same error as comment #0. This confirms the fine payment issue. 17) Run the following commands git checkout bug_19771 restart_all 18) Refresh the staff client page. -- it should all come up. 19) run the koha qa test tools 20) if you backed up your database, restore it. :) Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19771 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19771 --- Comment #10 from M. Tompsett <mtompset@hotmail.com> ---
3) On the host where you intend on running the koct install it. -- https://sourceforge.net/projects/koha-oc/files/ download and install.
https://koha-community.org/manual/18.05/en/html/05_circulation.html#offline-... I didn't read this. This is the newer KOCT. Still, doesn't change the test plan. :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19771 --- Comment #11 from Josef Moravec <josef.moravec@gmail.com> --- (In reply to M. Tompsett from comment #8)
(In reply to Matthias Meusburger from comment #6)
Your patch works well, it prevents from crashing on a unknown barcode.
However, I couldn't reproduce the crash on a payment.
I will revise test plan so it is explicitly clear. I confirmed it does fail on payments. I am also pleased to announce that FINALLY, I RTFM'd regarding the offline client, and am much happier about it now.
Thanks Mark, excellent work! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19771 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19771 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #70695|0 |1 is obsolete| | --- Comment #12 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 70745 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70745&action=edit Bug 19771: Fix crashing in pending offline circulation actions list When the barcode is empty or invalid, an "Internal Server Error" is triggered on the kohadev box. TEST PLAN --------- 0) back up your database if you care about it. 1) Run the following commands: git checkout master git pull git checkout -b bug_19771 origin/master git bz apply 19771 -- This should be quite uneventful. Standard promptings. 2) Continue to run the following commands: git checkout master reset_all sudo koha-shell -c bash kohadev ./misc/cronjobs/create_te_koc_db.pl --sqlite3 -- This will create a borrowers.db in your current directory. 3) On the host where you intend on running the koct install it. -- https://sourceforge.net/projects/koha-oc/files/ download and install. 4) get the borrowers.db file to your host where you installed koct 5) point koct at the file you downloaded Database -> Select Borrowers DB File 6) Create a .koc file with the following transactions. check in, check out, check in (bad barcode), pay fines (any non-zero amount). 7) Run the following commands: restart_all -- we want to make sure caching for plack isn't in the way. 8) In the staff client: Home -> Circulation -> Upload offline circulation file (.koc) 9) Choose the file created and click 'Upload file'. 10) Add to offline circulation queue. 11) View pending offline circulation actions -- This should die. Reading /var/log/koha/kohadev/plack-error.log should be the same error as comment #0. However, this was only the bad biblio error. 12) Run the following commands: git checkout bug_19771 restart_all 13) Refresh staff client page. -- it should all come up. 14) Select the bad biblio line, and delete it. 15) Run the following commands: git checkout master restart_all 16) Refresh the staff client page. -- it should die. Same error as comment #0. This confirms the fine payment issue. 17) Run the following commands git checkout bug_19771 restart_all 18) Refresh the staff client page. -- it should all come up. 19) run the koha qa test tools 20) if you backed up your database, restore it. :) Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19771 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com QA Contact|testopia@bugs.koha-communit |nick@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19771 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 18.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19771 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable --- Comment #14 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to Stable for 17.11.02 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19771 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #15 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Those lines has been modified by Bug 18276. If needed for 17.05.x please rebase. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19771 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@stayawake.co.uk --- Comment #16 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- *** Bug 20394 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org