From 84fa5ba37a81828079cff363cfc364979e0ad005 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 25 Nov 2015 17:08:43 +0000 Subject: [PATCH] Bug 15256: Fix items table display on the detail page MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Bug 14966 fixed a bug but introduced another one: With IndependentBranches set to 'prevent', if the librarian (without the superlibrarian permission) can edit items but not all, the table is broken. DataTables raises the following warning: "DataTables warning: table id=DataTables_Table_1 - Requested unknown parameter '8' for row0." And does not display correctly. Test plan: 1/ Create a biblio record with 1+ items located in different places. 2/ Create/use a patron with the permission to edit items 3/ Set the IndependentBranches pref to 'prevent' 4/ With this patron logged in, go on the record detail page. Without this patch, the display is broken (only 1 edit link and 1 td missing, DataTables raises a warning). With this patch, the display is correct. Signed-off-by: Frédéric Demians See the warning, and the broken table. Solved by this patch. Signed-off-by: Katrin Fischer Signed-off-by: Kyle M Hall (cherry picked from commit d456acc7bfd2507ac7eaaf32bd6da1f023655886) Signed-off-by: Julian Maurice (cherry picked from commit ed13f4fe200352460b62376b01ba48d3ba51ae80) Signed-off-by: Frédéric Demians (cherry picked from commit a6d5c091df0b15e00719d5a14f42ac7fd4f61e5b) Signed-off-by: Liz Rea --- .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 02dd4114e8..4abd40adcc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -803,8 +803,12 @@ function verify_images() { [% END %] [% END %] - [% IF CAN_user_editcatalogue_edit_items and not item.cannot_be_edited %] - Edit + [% IF CAN_user_editcatalogue_edit_items %] + + [% UNLESS item.cannot_be_edited %] + Edit + [% END %] + [% END %] [% END %] -- 2.39.5