To recreate: - create a club template - create a club - enroll a patron in the club - from the clubs page, select Search To Hold for your club - do a search, see that it says "Hold for [club name]" in your search results page - go back to the clubs page and delete your club - try to perform a search - get error "Can't call method "name" on an undefined value at /kohadevbox/koha/catalogue/search.pl line 207" Koha's trying to retain your deleted club as its Search To Hold target.
Created attachment 120168 [details] [review] Bug 28213: Prevent crash if patron or club deleted after search to hold Deleting a patron or patron club causes server error on searching. To recreate: - create a club template - create a club - enroll a patron in the club - from the clubs page, select Search To Hold for your club - do a search, see that it says "Hold for [club name]" in your search results page - go back to the clubs page and delete your club - try to perform a search => Without this patch you get "Can't call method "name" on an undefined value at /kohadevbox/koha/catalogue/search.pl line 207" Same when placing a hold for a patron
Looks like there's still an error on the bib detail page. I searched for hold from a patron and deleted them. The search results page didn't give an error, but I got this when I clicked through to bib details: Can't call method "surname" on an undefined value at /kohadevbox/koha/catalogue/detail.pl line 97
Created attachment 120177 [details] [review] Bug 28213: Prevent crash if patron or club deleted after search to hold Deleting a patron or patron club causes server error on searching. To recreate: - create a club template - create a club - enroll a patron in the club - from the clubs page, select Search To Hold for your club - do a search, see that it says "Hold for [club name]" in your search results page - go back to the clubs page and delete your club - try to perform a search => Without this patch you get "Can't call method "name" on an undefined value at /kohadevbox/koha/catalogue/search.pl line 207" Same when placing a hold for a patron (check the search result and the detail pages)
Created attachment 120182 [details] [review] Bug 28213: Prevent crash if patron or club deleted after search to hold Deleting a patron or patron club causes server error on searching. To recreate: - create a club template - create a club - enroll a patron in the club - from the clubs page, select Search To Hold for your club - do a search, see that it says "Hold for [club name]" in your search results page - go back to the clubs page and delete your club - try to perform a search => Without this patch you get "Can't call method "name" on an undefined value at /kohadevbox/koha/catalogue/search.pl line 207" Same when placing a hold for a patron (check the search result and the detail pages) Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Thanks for the quick patch!
*** Bug 28214 has been marked as a duplicate of this bug. ***
Created attachment 120238 [details] [review] Bug 28213: Prevent crash if patron or club deleted after search to hold Deleting a patron or patron club causes server error on searching. To recreate: - create a club template - create a club - enroll a patron in the club - from the clubs page, select Search To Hold for your club - do a search, see that it says "Hold for [club name]" in your search results page - go back to the clubs page and delete your club - try to perform a search => Without this patch you get "Can't call method "name" on an undefined value at /kohadevbox/koha/catalogue/search.pl line 207" Same when placing a hold for a patron (check the search result and the detail pages) Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Trivial and obvious fix.. works as expected. Passing QA
Pushed to master for 21.05, thanks to everybody involved!
Pushed to 20.11.x for 20.11.06
Pushed to 20.05.x for 20.05.12
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.