Description
Martin Renvoize (ashimema)
2023-06-22 11:44:16 UTC
Created attachment 152567 [details] [review] Bug 34094: Use DefaultPatronSearchMethod consistently This patch updates the patron search bar and pages to default search method to that defined by DefaultPatronSearchMethod system preference. Test plan 1) Prior to this patch confirm that regardless of what you set DefaultPatronSearchMethod to, the search in /members/member.pl, members/members-home.pl and the search from the patrons search top bar all default to 'contains'. 2) Apply the patch 3) Confirm that the system preference now affects the default option for match type upon page load. Pretty sure I've missed some spots here, so would love some thorough testing and feedback. Created attachment 152726 [details] [review] Bug 34094: Use DefaultPatronSearchMethod consistently This patch updates the patron search bar and pages to default search method to that defined by DefaultPatronSearchMethod system preference. Test plan 1) Prior to this patch confirm that regardless of what you set DefaultPatronSearchMethod to, the search in /members/member.pl, members/members-home.pl and the search from the patrons search top bar all default to 'contains'. 2) Apply the patch 3) Confirm that the system preference now affects the default option for match type upon page load. Created attachment 152742 [details] [review] Bug 34094: Use DefaultPatronSearchMethod consistently This patch updates the patron search bar and pages to default search method to that defined by DefaultPatronSearchMethod system preference. Test plan 1) Prior to this patch confirm that regardless of what you set DefaultPatronSearchMethod to, the search in /members/member.pl, members/members-home.pl and the search from the patrons search top bar all default to 'contains'. 2) Apply the patch 3) Confirm that the system preference now affects the default option for match type upon page load. Rebased on 34106 as discussed with Pedro.. this patch included most of 34106... but it didn't clearly highlight it was doing so.. nice to keep them distinct. *** Bug 34106 has been marked as a duplicate of this bug. *** Doesn't apply anymore now that bug 34106 was marked as duplicate. Created attachment 152787 [details] [review] Bug 34094: Use DefaultPatronSearchMethod consistently This patch updates the patron search bar and pages to default search method to that defined by DefaultPatronSearchMethod system preference. Test plan 1) Prior to this patch confirm that regardless of what you set DefaultPatronSearchMethod to, the search in /members/member.pl, members/members-home.pl and the search from the patrons search top bar all default to 'contains'. 2) Apply the patch 3) Confirm that the system preference now affects the default option for match type upon page load. Hi Martin, I'm running into one main issue when trying this patch. After applying, all the search forms have the same method as expected, however, the patron table is not loading for me. Thus, none of the searches are giving me back any results. I was able to fix this issue by removing this line in koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc: let filters = []; Upon removing this line, everything seemed to be working fine for me Ah, that looks like a rebase error.. I think that particular line was removed in a recently pushed patch and then re-introduced here accidentally as part of a rebase. I will remove it. Created attachment 152827 [details] [review] Bug 34094: Use DefaultPatronSearchMethod consistently This patch updates the patron search bar and pages to default search method to that defined by DefaultPatronSearchMethod system preference. Test plan 1) Prior to this patch confirm that regardless of what you set DefaultPatronSearchMethod to, the search in /members/member.pl, members/members-home.pl and the search from the patrons search top bar all default to 'contains'. 2) Apply the patch 3) Confirm that the system preference now affects the default option for match type upon page load. Created attachment 152828 [details] [review] Bug 34094: Use DefaultPatronSearchMethod consistently This patch updates the patron search bar and pages to default search method to that defined by DefaultPatronSearchMethod system preference. Test plan 1) Prior to this patch confirm that regardless of what you set DefaultPatronSearchMethod to, the search in /members/member.pl, members/members-home.pl and the search from the patrons search top bar all default to 'contains'. 2) Apply the patch 3) Confirm that the system preference now affects the default option for match type upon page load. Signed-off-by: Sam Lau <samalau@gmail.com> Created attachment 152881 [details] [review] Bug 34094: Use DefaultPatronSearchMethod consistently This patch updates the patron search bar and pages to default search method to that defined by DefaultPatronSearchMethod system preference. Test plan 1) Prior to this patch confirm that regardless of what you set DefaultPatronSearchMethod to, the search in /members/member.pl, members/members-home.pl and the search from the patrons search top bar all default to 'contains'. 2) Apply the patch 3) Confirm that the system preference now affects the default option for match type upon page load. Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Pushed to master for 23.11. Nice work everyone, thanks! This patch broke patrons_search.t # Failed test at t/db_dependent/selenium/patrons_search.t line 247. # got: 'No entries to show (filtered from 80 total entries)' # expected: 'Showing 1 to 15 of 26 entries (filtered from 80 total entries)' Created attachment 153324 [details] [review] Bug 34094: (follow-up) Fix failing unit test The unit tests were written to assume we always do a 'contains' search, but the new system preference allows for 'starts_with' or 'contains'. As such, for the tests to pass, we need to explicitly mock the preference to 'contains' Follow-up pushed, thanks Martin! Thanks for all the hard work! Pushed to 23.05.x for the next release Nice work everyone! Pushed to oldstable for 22.11.x |