Bug 6696

Summary: New category button broken when no categories defined
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: minor    
Priority: P5 - low CC: chris, koha.sekjal
Version: Main   
Hardware: All   
OS: All   
URL: /cgi-bin/koha/admin/categorie.pl
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: screenshot
Proposed fix
[SIGNED-OFF] Fix for Bug 6696, New category button broken when no categories defined

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.