]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
table.html.tmpl: Use order_columns only when present (#63)
authorVladimir Panteleev <CyberShadow@users.noreply.github.com>
Mon, 15 Mar 2021 14:50:43 +0000 (14:50 +0000)
committerGitHub <noreply@github.com>
Mon, 15 Mar 2021 14:50:43 +0000 (15:50 +0100)
Fix a hard dependency on the BMO extension.

order_columns is set in Bugzilla::Extension::BMO, which might not be
present / loaded.

Co-authored-by: Dylan William Hardison <dylan@hardison.net>
template/en/default/list/table.html.tmpl

index 86aca78ed1982f99509a075d1aaa2fad17b6c48c..d6c05c9e9ab4842d66cab0890ae16dfdfb42bad2 100644 (file)
       <th class="sorttable_nosort">&nbsp;</th>
       [% END %]
       <th colspan="[% splitheader ? 2 : 1 %]" class="first-child
-                   sorted_[% lsearch(order_columns, 'bug_id') FILTER html %]">
+                   [% order_columns.defined
+                      ? 'sorted_' _ lsearch(order_columns, 'bug_id')
+                      : '' FILTER html %]">
         <a href="[% basepath FILTER none %]buglist.cgi?
                   [% urlquerypart FILTER html %]&amp;order=
                   [% PROCESS new_order id='bug_id' %]
 [% BLOCK columnheader %]
   <th colspan="[% splitheader ? 2 : 1 %]"
       class="sortable_column_[% key FILTER html %]
-             sorted_[% lsearch(order_columns, id) FILTER html %]">
+             [% order_columns.defined
+                ? 'sorted_' _ lsearch(order_columns, id)
+                : '' FILTER html %]">
     <a href="[% basepath FILTER none %]buglist.cgi?[% urlquerypart FILTER html %]&amp;order=
       [% PROCESS new_order %]
       [%-#%]&amp;query_based_on=