Bug 36334

Summary: Unnecessary JS code in member.tt
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: fridolin.somers, nick, pedro.amorim
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00
Circulation function:
Attachments: Bug 36334: Remove unnecessary JS code from member.tt
Bug 36334: Remove unnecessary JS code from member.tt
Bug 36334: Remove unnecessary JS code from member.tt
Bug 36334: (follow-up) Restore selection of previous values in sidebar
Bug 36334: (follow-up) Restore selection of previous values in sidebar

Description Jonathan Druart 2024-03-15 14:38:14 UTC

    
Comment 1 Jonathan Druart 2024-03-15 14:40:35 UTC
Created attachment 163249 [details] [review]
Bug 36334: Remove unnecessary JS code from member.tt

This was initially written to set the input/select in the form in the
left side of the main patron search page.

But this is now done in patron-search.inc:
koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc:
  <input type="text" class="search_patron_filter" value="[% search_filter | html %]" class="focus" />

I don't see how/when this code is still used.

Additionally:
 #searchmember_filter
 => does not exist, it's .search_patron_filter

 $("searchfieldstype_filter").val("[% searchfieldstype | html %]");
 => Not a valid selector
Comment 2 Jonathan Druart 2024-03-15 14:41:28 UTC
Nick, Pedro, could you confirm that?
Comment 3 Pedro Amorim 2024-03-15 16:39:02 UTC
Created attachment 163258 [details] [review]
Bug 36334: Remove unnecessary JS code from member.tt

This was initially written to set the input/select in the form in the
left side of the main patron search page.

But this is now done in patron-search.inc:
koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc:
  <input type="text" class="search_patron_filter" value="[% search_filter | html %]" class="focus" />

I don't see how/when this code is still used.

Additionally:
 #searchmember_filter
 => does not exist, it's .search_patron_filter

 $("searchfieldstype_filter").val("[% searchfieldstype | html %]");
 => Not a valid selector

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 4 Nick Clemens (kidclamp) 2024-03-15 18:19:55 UTC
Created attachment 163268 [details] [review]
Bug 36334: Remove unnecessary JS code from member.tt

This was initially written to set the input/select in the form in the
left side of the main patron search page.

But this is now done in patron-search.inc:
koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc:
  <input type="text" class="search_patron_filter" value="[% search_filter | html %]" class="focus" />

I don't see how/when this code is still used.

Additionally:
 #searchmember_filter
 => does not exist, it's .search_patron_filter

 $("searchfieldstype_filter").val("[% searchfieldstype | html %]");
 => Not a valid selector

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 5 Nick Clemens (kidclamp) 2024-03-15 18:19:57 UTC
Created attachment 163269 [details] [review]
Bug 36334: (follow-up) Restore selection of previous values in sidebar

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Nick Clemens (kidclamp) 2024-03-15 18:22:29 UTC
Created attachment 163275 [details] [review]
Bug 36334: (follow-up) Restore selection of previous values in sidebar

Before and after the first patch the values for category and library were not populated

To test:
1 - With nothing applied search in the top bar, clicking the 'settings' button
2 - Select a search field, search type, category, and library
3 - Perform search, note only search field and search type are populated
4 - Apply first path, repeat, same result
5 - Apply this patch, repeat
6 - Confirm all four fields now populate in sidebar

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 7 Nick Clemens (kidclamp) 2024-03-15 18:22:54 UTC
Jonathan, can you confirm my follow-up?
Comment 8 Jonathan Druart 2024-03-18 15:33:19 UTC
(In reply to Nick Clemens from comment #7)
> Jonathan, can you confirm my follow-up?

Yes, good catch!
Thanks a lot!
Comment 9 Katrin Fischer 2024-03-18 17:05:05 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 10 Fridolin Somers 2024-03-21 09:56:30 UTC
Code has changed in master since Bug 35329
So I prefer not to backport