Bug 16532

Summary: Libraries and groups showing empty tables if nothing defined
Product: Koha Reporter: Aleisha Amohia <aleisha>
Component: System AdministrationAssignee: Aleisha Amohia <aleisha>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: brendan, f.demians, gmcharlt, jonathan.druart, julian.maurice
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Empty groups tables
Bug 16523: Groups showing empty tables if no groups defined
Bug 16532: Groups showing empty tables if no groups defined
Bug 16532: Groups showing empty tables if no groups defined
[SIGNED-OFF] Bug 16532: Groups showing empty tables if no groups defined
Bug 16532: Groups showing empty tables if no groups defined

Description Aleisha Amohia 2016-05-17 05:03:56 UTC
Created attachment 51558 [details]
Empty groups tables
Comment 1 Aleisha Amohia 2016-05-17 05:08:38 UTC Comment hidden (obsolete)
Comment 2 Aleisha Amohia 2016-05-17 05:09:05 UTC Comment hidden (obsolete)
Comment 3 Owen Leonard 2016-05-17 12:30:18 UTC
Can we do the same for libraries?

Even with no libraries defined, "[% IF libraries.size %]" always evaluates as true. Why?
Comment 4 Owen Leonard 2016-05-17 13:56:42 UTC
> Even with no libraries defined, "[% IF libraries.size %]" always evaluates
> as true. Why?

Jonathan explained to me in IRC that because "libraries" is an object (from Koha::Libraries) we should use "count" instead:

[% IF libraries.count %]...
Comment 5 Aleisha Amohia 2016-05-24 01:56:34 UTC Comment hidden (obsolete)
Comment 6 Owen Leonard 2016-05-25 12:06:13 UTC Comment hidden (obsolete)
Comment 7 Jonathan Druart 2016-05-25 19:33:44 UTC
Created attachment 51803 [details] [review]
Bug 16532: Groups showing empty tables if no groups defined

EDIT: Same change for libraries

To test:
1) Go to Admin -> Libraries and Groups
2) Notice empty tables if nothing defined
3) Apply patch and refresh page
4) Empty tables should not show
5) Add a new group
6) Confirm table shows correctly

Sponsored-by: Catalyst IT

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Brendan Gallagher 2016-05-31 09:22:39 UTC
Pushed to Master - Should be in the November 2016 Release.  Thanks!
Comment 9 Frédéric Demians 2016-06-15 07:30:58 UTC
Pushed in 16.05. Will be in 16.05.01.
Comment 10 Julian Maurice 2016-06-16 07:37:32 UTC
Not needed in 3.22.x