Bug 33484: Early return in add_filters if node does not exist

Maybe we could even return early from kohaTable?

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2024-10-08 11:45:58 +02:00 committed by Katrin Fischer
parent fa8a9bfec6
commit fe31fd7288
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 2 additions and 0 deletions

View File

@ -841,6 +841,8 @@ function _dt_on_visibility(add_filters, table_node, table_dt){
function _dt_add_filters(table_node, table_dt, filters_options = {}) {
if (!table_node.length) return;
$(table_node).find('thead tr:eq(1)').remove(); // Remove if one exists already
$(table_node).find('thead tr').clone().appendTo( $(table_node).find('thead') );