Bug 6696 - New category button broken when no categories defined
Summary: New category button broken when no categories defined
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Owen Leonard
QA Contact: Bugs List
URL: /cgi-bin/koha/admin/categorie.pl
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-10 09:58 UTC by Katrin Fischer
Modified: 2013-12-05 20:01 UTC (History)
2 users (show)

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


Attachments
screenshot (10.87 KB, image/png)
2011-08-10 09:58 UTC, Katrin Fischer
Details
Proposed fix (1.65 KB, patch)
2011-08-10 15:47 UTC, Owen Leonard
Details | Diff | Splinter Review
[SIGNED-OFF] Fix for Bug 6696, New category button broken when no categories defined (1.89 KB, patch)
2011-08-11 17:45 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2011-08-10 09:58:39 UTC
Created attachment 4923 [details]
screenshot

The button 'New category' appears only as link when I have no patron categories defined in administration.

Once I have defined a first category the buttons shows up as normal.
Comment 1 Katrin Fischer 2011-08-10 11:23:19 UTC
javascript error probably related to the problem:

table.tBodies[0] is undefined
error source line: [Bei diesem Fehler anhalten] (function($){$.extend({tablesorter:new...g Zebra widget",time);}}});})(jQuery);...
Comment 2 Owen Leonard 2011-08-10 15:47:58 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2011-08-11 17:45:48 UTC
Created attachment 4971 [details] [review]
[SIGNED-OFF] Fix for Bug 6696, New category button broken when no categories defined

The javascript tablesorter will trigger an error if we try
to apply it to a table with no <tbody>. That error prevented
the YUI button script to complete properly, hence the broken
button.

This patch hides the table in cases where there are no
categories and displays an error message instead.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
- Deleted all patron categories and checked button was broken
- Applied patch and checked again - button shows up
- Nice: There is a note now that you have to create categories
Comment 4 Ian Walls 2011-08-27 13:24:37 UTC
Template only change, easy to read, marking as Passed QA
Comment 5 Chris Cormack 2011-08-28 07:40:28 UTC
Pushed please test
Comment 6 Chris Nighswonger 2011-10-26 18:02:23 UTC
The fix for this bug was published in the 3.4.5 release. If you were the reporter of this bug, please take time to verify the fix and update the status of this bug report accordingly. If the bug is fixed to your satisfaction, please close this report.