From c1036ed64cc2cf38a641f16378afdb8427cde184 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 24 Oct 2024 10:37:59 +0200 Subject: [PATCH] Bug 33484: Include patron search code if no patron selected yet When placing a hold we should not display the patron search code (html+js) if we have picked a patron already, otherwise a get a JS error Uncaught TypeError: table_dt.settings()[0] is undefined koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc 781 let table_dt = patrons_table.DataTable(); 782 let loaded_from_state = table_dt.settings()[0].loaded_from_state; Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- .../prog/en/modules/reserve/request.tt | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index 2141e06c512..8d1c1fddc3f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -1998,16 +1998,20 @@ table_settings = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]; - [% SET search_results_block_id = 'holds_patronsearch_pane_panel' %] [%# adjusting variable for patron-search.inc %] - [% PROCESS patron_search_js table_id => 'table_borrowers', categories => categories, libraries => libraries, columns => columns, open_on_row_click => 1, on_click_url => '/cgi-bin/koha/reserve/request.pl?' _ url_biblio_params, redirect_if_one_result => 1, redirect_url => '/cgi-bin/koha/reserve/request.pl?' _ url_biblio_params, redirect_if_attribute_equal => 'cardnumber' %] + [% UNLESS patron %] + [% SET search_results_block_id = 'holds_patronsearch_pane_panel' %] [%# adjusting variable for patron-search.inc %] + [% PROCESS patron_search_js table_id => 'table_borrowers', categories => categories, libraries => libraries, columns => columns, open_on_row_click => 1, on_click_url => '/cgi-bin/koha/reserve/request.pl?' _ url_biblio_params, redirect_if_one_result => 1, redirect_url => '/cgi-bin/koha/reserve/request.pl?' _ url_biblio_params, redirect_if_attribute_equal => 'cardnumber' %] + + [% END %] [% END %] -- 2.34.1