Description
Kyle M Hall (khall)
2014-01-07 17:19:24 UTC
Created attachment 23989 [details] [review] Bug 11489 - OPAC search results in 404 error when the only search result is supressed If hidelostitems is enabled, and the result of an opac search is a single lost item, then the opac will display a 404 error, rather than a "no results" screen. Test Plan: 1) Catalog a record/item such that it is the only result for some search e.g. Give it the title 'zxcvb' 2) Enable hidelostitems 3) Mark this item as lost 4) Perform an OPAC search that should result in a redirect to this record 5) Notice you a redirected to a 404 error 6) Apply this patch 7) Repeat step 4 8) Note you new get a "No results found!" page instead Created attachment 23990 [details] [review] Bug 11489 - OPAC search results in 404 error when the only search result is supressed If hidelostitems is enabled, and the result of an opac search is a single lost item, then the opac will display a 404 error, rather than a "no results" screen. Test Plan: 1) Catalog a record/item such that it is the only result for some search e.g. Give it the title 'zxcvb' 2) Enable hidelostitems 3) Mark this item as lost 4) Perform an OPAC search that should result in a redirect to this record 5) Notice you a redirected to a 404 error 6) Apply this patch 7) Repeat step 4 8) Note you new get a "No results found!" page instead Kyle, This issue appears to no longer apply. I tested on a sandbox against master, and with hidelostitems set to show, item shows as lost. If set to Don't show, record shows without any item showing. Please confirm test parameters. I'm still seeing this error in master: http://screencast.com/t/gvuoF4pyebF My bad. I don't know why it worked before. I just tested it again and now I am getting the same results. Thanks for confirming. Christopher Patch tested with a sandbox, by Christopher Brannon <cbrannon@cdalibrary.org> Created attachment 24291 [details] [review] Bug 11489 - OPAC search results in 404 error when the only search result is supressed If hidelostitems is enabled, and the result of an opac search is a single lost item, then the opac will display a 404 error, rather than a "no results" screen. Test Plan: 1) Catalog a record/item such that it is the only result for some search e.g. Give it the title 'zxcvb' 2) Enable hidelostitems 3) Mark this item as lost 4) Perform an OPAC search that should result in a redirect to this record 5) Notice you a redirected to a 404 error 6) Apply this patch 7) Repeat step 4 8) Note you new get a "No results found!" page instead Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Using a copy of our old data on a git install, I found we had a three copies of a book '101 Stupid Things Trainers Do To Sabotage Success' (1 biblio, 3 items), and one was lost. I deleted the two we had, and kept the lost one. I went to the system preferences and toggled it between looking at the OPAC search for 'stupid things' which was unique, and I have it showing and not showing the 1 item. (In reply to M. Tompsett from comment #8) > Using a copy of our old data on a git install, I found we had a three copies > of a book '101 Stupid Things Trainers Do To Sabotage Success' (1 biblio, 3 > items), and one was lost. I deleted the two we had, and kept the lost one. I > went to the system preferences and toggled it between looking at the OPAC > search for 'stupid things' which was unique, and I have it showing and not > showing the 1 item. I had a similar result the first time, which prompted my request for confirmation above. But when I went to try it today, it gave the error. I have tested twice now, and the patch does work. Christopher Oops... I got a cross-problem with the OpacHiddenItems. I'm doing further retesting. TEST PLAN --------- home cataloguing new from z39.50 purple search import (Abbott & Costello cartoons.) 9 set the default type. save > save and edit items add a lost item rather than wait, I reindexed it immediately: $ ./misc/migration_tools/rebuild_zebra.pl -b -a -z -v made sure system preference for hidelostitems was Show search Staff, found search OPAC, found toggle the systempreference search staff, found search OPAC, 404 apply patch search OPAC, no results -- facets still show. Created attachment 24292 [details] [review] Hide facets if there are no results to show (because they are hidden) I believe that the second patch from 11489 will make this patch better. Notice how facets still displayed. This patch will remove the facets. Comment on attachment 24292 [details] [review] Hide facets if there are no results to show (because they are hidden) It is a patch, but it isn't mine. It is from Jonathan Druart <jonathan.druart@biblibre.com>. Created attachment 24294 [details] [review] [SIGNED OFF] Bug 11489: Show facets only if there is result to display If all results are hidden, the facets are displayed. With this patch, the facets are hidden too. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> *** Bug 11432 has been marked as a duplicate of this bug. *** I have tested the patch and it works! OPAC hides lost/missing items and no longer displays 404 error. Created attachment 24496 [details] [review] Bug 11489 - OPAC search results in 404 error when the only search result is supressed If hidelostitems is enabled, and the result of an opac search is a single lost item, then the opac will display a 404 error, rather than a "no results" screen. Test Plan: 1) Catalog a record/item such that it is the only result for some search e.g. Give it the title 'zxcvb' 2) Enable hidelostitems 3) Mark this item as lost 4) Perform an OPAC search that should result in a redirect to this record 5) Notice you a redirected to a 404 error 6) Apply this patch 7) Repeat step 4 8) Note you new get a "No results found!" page instead Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Created attachment 24497 [details] [review] Bug 11489: Show facets only if there is result to display If all results are hidden, the facets are displayed. With this patch, the facets are hidden too. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Sorry, but there is a bug: Testing notes: - Record with 1 lost item, result list = 1 - Verified without both patches 404 error page is shown - Verified with 1st patch, no results page is shown - Verified with 2nd patch, the still showing facets are gone - Record with 1 lost item, result list > 1 - Record is hidden from result list, but - result count is wrong - result numbering is wrong > This is an old problem, just noting - Record with 1 lost and 1 available item, result list = 1 - Detail page is shown, only lost item is hidden - Record with 1 ost and 1 available item, result list > 1 - Only available item is shown in result list BUT: FACETS ARE HIDDEN. I think the problem was introduced by the second patch, but since it fixes a problem with the first patch, it also needs to be fixed before either patch can be passed QA. Actually, in that last case which causes the problem, the page should be auto-redirecting, because there is only 1 visible result. The problem is there is a [0] hard coded into the one result redirection. You misunderstood the test case - I did a search with a real result list, in my case 7 results matching the search term. The record with the lost item shows, but the lost item is not listed, because there is another item available. The only problem there is that the facets are gone. I'm still not understanding. You searched for something, and there are 7 results in total. That implies items. How many biblios? Was the lost item the same or different biblio than the available one? And does that mean the other 5 were checked out? 7 records one of which was my testing record with 1 item and 1 normal item. 1 lost item... and 1 available item. I am talking of a normal result list, where one of the records happens to have a hidden item. Created attachment 24733 [details] [review] Bug 11489: Show facets only if there is result to display If all results are hidden, the facets are displayed. With this patch, the facets are hidden too. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> I changed hits to total because of line 683 in opac/opac-search.pl, and since hits is not set as a parameter to the template. Both of these patches appear to be signed off, so I'm changing this bug's status. I'm not sure that is right, because I tweaked the second patch and signed it off. I think the second patch needs proper sign off by someone else before being marked as signed off. We test today on sandbox and everything seems OK : - request with 9 results, one of them with 2 items - we mark one of the 2 items "lost" - we enable prefsystem hidelostitems = "don't show" - we search again on opac - the lost item is hidden, in the list of results and on the biblio view - the facets are displayed We try another request with only one result and do the same process : - we have the message "No results found " and no facets. Patch tested with a sandbox, by Michot <nmichot@voila.fr> Created attachment 26061 [details] [review] Bug 11489 - OPAC search results in 404 error when the only search result is supressed If hidelostitems is enabled, and the result of an opac search is a single lost item, then the opac will display a 404 error, rather than a "no results" screen. Test Plan: 1) Catalog a record/item such that it is the only result for some search e.g. Give it the title 'zxcvb' 2) Enable hidelostitems 3) Mark this item as lost 4) Perform an OPAC search that should result in a redirect to this record 5) Notice you a redirected to a 404 error 6) Apply this patch 7) Repeat step 4 8) Note you new get a "No results found!" page instead Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Michot <nmichot@voila.fr> Created attachment 26062 [details] [review] Bug 11489: Show facets only if there is result to display If all results are hidden, the facets are displayed. With this patch, the facets are hidden too. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Michot <nmichot@voila.fr> Created attachment 26889 [details] [review] [PASSED QA] Bug 11489 - OPAC search results in 404 error when the only search result is supressed If hidelostitems is enabled, and the result of an opac search is a single lost item, then the opac will display a 404 error, rather than a "no results" screen. Test Plan: 1) Catalog a record/item such that it is the only result for some search e.g. Give it the title 'zxcvb' 2) Enable hidelostitems 3) Mark this item as lost 4) Perform an OPAC search that should result in a redirect to this record 5) Notice you a redirected to a 404 error 6) Apply this patch 7) Repeat step 4 8) Note you new get a "No results found!" page instead Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Michot <nmichot@voila.fr> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Created attachment 26890 [details] [review] [PASSED QA] Bug 11489: Show facets only if there is result to display If all results are hidden, the facets are displayed. With this patch, the facets are hidden too. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Michot <nmichot@voila.fr> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Passes all tests and QA script. Tested: - Record with 1 lost item, result list = 1 - Verified without both patches 404 error page is shown - Verified with 1st patch, no results page is shown - Verified with 2nd patch, the still showing facets are gone - Record with 1 lost item, result list > 1 - Record is hidden from result list, but - result count is wrong - result numbering is wrong > This is an old problem, just noting - Record with 1 lost and 1 available item, result list = 1 - Detail page is shown, only lost item is hidden - Record with 1 lost and 1 available item, result list > 1 - Only available item is shown in result list Also checked that the lost item shows up with hidelostitems off. Pushed to master. Thanks, Kyle! Pushed to 3.14.x, will be in 3.14.10 Picked for 3.12.15! |