Bug 18044

Summary: Label Batches not displaying
Product: Koha Reporter: matthew.charlesworth
Component: Label/patron card printingAssignee: Chris Nighswonger <cnighswonger>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: critical    
Priority: P2 CC: jonathan.druart, josef.moravec, julian.maurice, katrin.fischer, kyle, mtj
Version: master   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: Trivial patch
Who signed the patch off: Text to go in the release notes:
Version(s) released in:
Bug Depends on: 17900    
Bug Blocks:    
Attachments: Patch to fix missing list separators in SQL
Bug 18044: Label Batches not displaying
Bug 18044: Label Batches not displaying
Bug 18044: Add a test

Description matthew.charlesworth 2017-02-03 08:35:17 UTC
Good day,

After upgrading Koha, when I try to view label batches at http://koha-server:8080/cgi-bin/koha/labels/label-manage.pl?label_element=batch it says that "There are no Batches currently available".

I can create a new batch (e.g. I created a new batch numbered 27 and then another numbered 28, but I can't see the list of batches???

I can directly edit the Batches, e.g.
So this tells me that there's a problem displaying the list of label batches.

I'm running Koha on Ubuntu 14.04.5 LTS Trusty with Apache Server version: Apache/2.4.7 (Ubuntu) and mysql Ver 15.1 Distrib 5.5.54-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2, Zebra 2.0.44 and Perl 5.018002.

I tried looking in the Log files for any messages regarding labels but could not find any relevant log entries (even for creating the Batches I did), under Browse system logs.

Comment 1 Chris Nighswonger 2017-02-03 10:54:11 UTC
Bumping severity.

Can anyone confirm this? I don't have an installation of this version handy.
Comment 2 Josef Moravec 2017-02-04 06:49:35 UTC
I can confirm it on master too
Comment 3 Chris Nighswonger 2017-02-05 02:11:35 UTC
I'm guessing it is related to bug 17900 (which I cannot access). The fix for this bug made extensive changes to the patron card code. Detail may be had here:

Comment 4 Chris Nighswonger 2017-02-05 02:12:43 UTC
I'm adding Jonathan to this bug as he was the one who handled the aforementioned bug. Maybe he can have a look at what's going on here.
Comment 5 Chris Nighswonger 2017-02-05 13:45:01 UTC
We probably need to verify that _build_query is construction the correct SQL for the case of $label_element eq 'batch'. That case is unique in that there is an OR in it.

Can someone verify that the other cases of $label_element work as expected?
Comment 6 Chris Nighswonger 2017-02-05 13:46:41 UTC
It would be nice to add a parameter to _build_query which would cause it to dump the resulting query and args to the log for debug use.
Comment 7 Katrin Fischer 2017-02-05 14:32:33 UTC
Should this be 'in discussion'? Being critical it would be good to get a fast fix, the problem is probably in all versions now due to the security fix. :(
Comment 8 Chris Nighswonger 2017-02-05 19:36:10 UTC
I think it is just waiting for someone to take it.

I'd work on it, but do not have a Koha dev setup available at all ATM. (Sad, I know.)
Comment 9 Katrin Fischer 2017-02-05 19:41:58 UTC
Better to use new then!
Comment 10 Chris Nighswonger 2017-02-05 20:08:49 UTC
I'm cloning koha.git now... its huge.
Comment 11 Chris Nighswonger 2017-02-05 20:17:29 UTC
Updating version to master
Comment 12 Katrin Fischer 2017-02-05 20:21:53 UTC
https://github.com/digibib/kohadevbox is fun for setting up dev environments - might be worth taking a look at :)
Comment 13 Chris Nighswonger 2017-02-05 21:16:33 UTC
Created attachment 59909 [details] [review]
Patch to fix missing list separators in SQL
Comment 14 Chris Nighswonger 2017-02-05 21:20:55 UTC
This bug breaks critical functionality for many libraries. The fix is super-simple. If someone could QA this, and we could get it push up right away, that would be fantastic!
Comment 15 Josef Moravec 2017-02-06 06:39:45 UTC
Created attachment 59912 [details] [review]
Bug 18044: Label Batches not displaying

SQL expects lists to be comma separated. A trailing comma must also
be avoided.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 16 Jonathan Druart 2017-02-06 08:19:44 UTC
Created attachment 59913 [details] [review]
Bug 18044: Label Batches not displaying

SQL expects lists to be comma separated. A trailing comma must also
be avoided.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 17 Jonathan Druart 2017-02-06 08:19:49 UTC
Created attachment 59914 [details] [review]
Bug 18044: Add a test

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 18 Kyle M Hall 2017-02-07 17:46:34 UTC
Pushed to master for 17.05, thanks Chris, Jonathan!
Comment 19 Katrin Fischer 2017-02-07 21:10:04 UTC
These patches have been pushed to 16.11.x and will be in 16.11.04.
Comment 20 Julian Maurice 2017-02-09 09:32:46 UTC
Pushed to 3.22.x for 3.22.17
Comment 21 Mason James 2017-02-15 18:24:46 UTC
Pushed to 16.05.x, for 16.05.10 release
Comment 22 Chris Nighswonger 2017-02-15 19:26:32 UTC
Thanks to everyone who helped get this resolved quickly!