Bug 16532 - Libraries and groups showing empty tables if nothing defined
Summary: Libraries and groups showing empty tables if nothing defined
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Aleisha Amohia
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-17 05:03 UTC by Aleisha Amohia
Modified: 2017-12-07 22:16 UTC (History)
5 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Text to go in the release notes:
Version(s) released in:


Attachments
Empty groups tables (34.54 KB, image/png)
2016-05-17 05:03 UTC, Aleisha Amohia
Details
Bug 16523: Groups showing empty tables if no groups defined (1.35 KB, patch)
2016-05-17 05:08 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 16532: Groups showing empty tables if no groups defined (1.35 KB, patch)
2016-05-17 05:09 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 16532: Groups showing empty tables if no groups defined (1.59 KB, patch)
2016-05-24 01:56 UTC, Aleisha Amohia
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 16532: Groups showing empty tables if no groups defined (1.64 KB, patch)
2016-05-25 12:06 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 16532: Groups showing empty tables if no groups defined (1.66 KB, patch)
2016-05-25 19:33 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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