|
Description
David Gustafsson
2025-03-03 15:52:03 UTC
Created attachment 178892 [details] [review] Bug 39229: Search unique extended attributes on patron quicksearch Forgot to add how to test etc in commit message, will do so tomorrow. Created attachment 178932 [details] [review] Bug 39229: Search unique extended attributes on patron quicksearch To test: 1) Apply patch 2) Create a unique extended patron attribute, set it to "Searchable" and and "Searched by default" 3) Edit a patron and set a value for the created attribute. 4) Enable UniqueExtendedAttributesQuickSearch syspref 5) Edit memebers/member.pl, after the if (@attributes_conditinos) block, around line 93, write "exit;" and save the file. 6) Perforn a search on the patron attribute value 7) A redirect to the patron page should occur 8) Search for something else not matching the attribute 9) You should now recieve a 500 error (since the script exits prematurely, and the normal search is never run) Sponsored-by: Gothenburg University Library I now created a test plan, but it's unfortunately pretty convoluted. If one has access to a koha instance with at least tens of thousands of patrons, preferably more, there would be a clear difference in response time. But if the number is smaller, it is very hard to notice a difference and hard to test. Exiting the script after the unique attributes quicksearch has been performed was the only way I could figure out, but other suggestions are welcome. Created attachment 178970 [details] [review] Bug 39229: Search unique extended attributes on patron quicksearch To test: 1) Apply patch 2) Create a unique extended patron attribute, set it to "Searchable" and and "Searched by default" 3) Edit a patron and set a value for the created attribute. 4) Enable UniqueExtendedAttributesQuickSearch syspref 5) Edit memebers/member.pl, before "my $searchfieldstype = ..." around line 94, write "exit;" and save the file. 6) Perform a search on the patron attribute value 7) A redirect to the patron page should occur 8) Search for something else not matching the attribute 9) You should now recieve a 500 error (since the script exits prematurely, and the normal search is never run) Sponsored-by: Gothenburg University Library Created attachment 178971 [details] [review] Bug 39229: Also try to find patron by borrowernumber Created attachment 178972 [details] [review] Bug 39229: Search unique extended attributes on patron quicksearch To test: 1) Apply patch 2) Create a unique extended patron attribute, set it to "Searchable" and and "Searched by default" 3) Edit a patron and set a value for the created attribute. 4) Enable UniqueExtendedAttributesQuickSearch syspref 5) Edit memebers/member.pl, before "my $searchfieldstype = ..." around line 94, write "exit;" and save the file. 6) Perform a search on the patron attribute value 7) A redirect to the patron page should occur 8) Search for something else not matching the attribute 9) You should now recieve a 500 error (since the script exits prematurely, and the normal search is never run) 10) Repeat steps 6 to 9 using borrowernumber instead of extended attribute value Sponsored-by: Gothenburg University Library Created attachment 178973 [details] [review] Bug 39229: Also try to find patron by borrowernumber I also added quicksearch using borrowernumber. I also added finding patron by borrowernumber quicksearch and edited the bug name to reflect the change. Created attachment 178974 [details] [review] Bug 39229: Search unique extended attributes on patron quicksearch To test: 1) Apply patch 2) Create a unique extended patron attribute, set it to "Searchable" and and "Searched by default" 3) Edit a patron and set a value for the created attribute. 4) Enable UniqueExtendedAttributesQuickSearch syspref 5) Edit memebers/member.pl, before "my $searchfieldstype = ..." around line 94, write "exit;" and save the file. 6) Perform a search on the patron attribute value 7) A redirect to the patron page should occur 8) Search for something else not matching the attribute 9) You should now recieve a 500 error (since the script exits prematurely, and the normal search is never run) 10) Repeat steps 6 to 9 using borrowernumber instead of extended attribute value Sponsored-by: Gothenburg University Library Created attachment 178975 [details] [review] Bug 39229: Also try to find patron by borrowernumber Created attachment 178995 [details] [review] Bug 39229: Also try to find patron by userid My mistake, should have been userid. Created attachment 178996 [details] [review] Bug 39229: Search unique extended attributes on patron quicksearch To test: 1) Apply patch 2) Create a unique extended patron attribute, set it to "Searchable" and and "Searched by default" 3) Edit a patron and set a value for the created attribute. 4) Enable UniqueExtendedAttributesQuickSearch syspref 5) Edit memebers/member.pl, before "my $searchfieldstype = ..." around line 94, write "exit;" and save the file. 6) Perform a search on the patron attribute value 7) A redirect to the patron page should occur 8) Search for something else not matching the attribute 9) You should now recieve a 500 error (since the script exits prematurely, and the normal search is never run) 10) Repeat steps 6 to 9 using userid instead of extended attribute value Sponsored-by: Gothenburg University Library Created attachment 178997 [details] [review] Bug 39229: Also try to find patron by userid Created attachment 180780 [details] [review] Bug 39229: Also handle the case when performing a patron checkout I tested this and got to step 6. Is the quicksearch done in the green tool bar at top? If that is the case, I did not get a redirect to the patron page and received a 500 error. Searches for other terms that were not an attribute also returned a 500 error. I also did the search from the Patron module using the search form on the left side of the page. I searched for the attribute using the standard parameter.The patron was in the patron search results list. Searching for other terms gave blank results and no 500 error. I stopped at this point because I wasn't sure if I was following the test plan correctly. I did edit the members/member.pl file as instructed. Automated patch testing results: [FAIL] PATCH DOES NOT APPLY One or more patches do not apply cleanly to the current codebase. Please rebase your patches and upload new versions. **Patch Results:** [FAIL] Bug-39229-Also-handle-the-case-when-performing-a-p.patch (ID: 180780) Status: FAILURE - Patch does not apply Error: error: patch failed: members/member.pl:60 [FAIL] Bug-39229-Also-try-to-find-patron-by-userid.patch (ID: 178997) Status: FAILURE - Patch does not apply Error: error: patch failed: members/member.pl:68 [PASS] Bug-39229-Search-unique-extended-attributes-on-pat.patch (ID: 178996) Status: SUCCESS + Patch applies cleanly --- This is an automated message from the patch testing system. Tested against branch: main Automated patch testing results: [FAIL] PATCH DOES NOT APPLY One or more patches do not apply cleanly to the current codebase. Please rebase your patches and upload new versions. **Patch Results:** [FAIL] Bug-39229-Also-handle-the-case-when-performing-a-p.patch (ID: 180780) Status: FAILURE - Patch does not apply [FAIL] Bug-39229-Also-try-to-find-patron-by-userid.patch (ID: 178997) Status: FAILURE - Patch does not apply [PASS] Bug-39229-Search-unique-extended-attributes-on-pat.patch (ID: 178996) Status: SUCCESS + Patch applies cleanly --- This is an automated message from the patch testing system. Tested against branch: main Created attachment 189937 [details] [review] Bug 39229: Search unique extended attributes on patron quicksearch To test: 1) Apply patch 2) Create a unique extended patron attribute, set it to "Searchable" and and "Searched by default" 3) Edit a patron and set a value for the created attribute. 4) Enable UniqueExtendedAttributesQuickSearch syspref 5) Edit members/member.pl, before "my $searchfieldstype = ..." around line 101, write "exit;" and save the file. 6) Perform a search on the patron attribute value 7) A redirect to the patron page should occur 8) Search for something else not matching the attribute 9) You should now recieve a 500 error (since the script exits prematurely, and the normal search is never run) 10) Repeat steps 6 to 9 using userid instead of extended attribute value Sponsored-by: Gothenburg University Library Created attachment 189938 [details] [review] Bug 39229: Also try to find patron by userid Created attachment 189939 [details] [review] Bug 39229: Also handle the case when performing a patron checkout It applied cleanly for me, so no rebase appeared to be needed. But fixed some typos in the test plan. @Esther Melander I tested it out and worked for me, perhaps you forgot to make the attribute unique? The testplan could perhaps be made clearer on that point. |