The try catch introduced in bug 14708 breaks deletion of borrowers totally via the staff interface, giving 500 error and also it hides the error message in log because it is in try catch so this is very hard to spot in error logs. To reproduce: go to any patron record and try to delete, you will get http 500 error back.
Created attachment 114145 [details] [review] Bug 27144: Fix syntax error that prevents deleting patrons To test: 1) In staff interface open up a patron record 2) Click More -> Delete, and then "Yes, delete" 3) Notice 500 error 4) Apply patch 5) Notice error is now gone when deleting
Created attachment 114147 [details] [review] Bug 27144: Fix syntax error that prevents deleting patrons To test: 1) In staff interface open up a patron record 2) Click More -> Delete, and then "Yes, delete" 3) Notice 500 error 4) Apply patch 5) Notice error is now gone when deleting Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This might have caused some corruption/duplicated data in the DB, to check if you have any use: > select count(*) FROM deletedborrowers WHERE borrowernumber IN (SELECT borrowernumber FROM borrowers);
(In reply to Joonas Kylmälä from comment #3) > This might have caused some corruption/duplicated data in the DB, to check > if you have any use: > > > select count(*) FROM deletedborrowers WHERE borrowernumber IN (SELECT borrowernumber FROM borrowers); Why, can you detail please?
(In reply to Jonathan Druart from comment #4) > (In reply to Joonas Kylmälä from comment #3) > > This might have caused some corruption/duplicated data in the DB, to check > > if you have any use: > > > > > select count(*) FROM deletedborrowers WHERE borrowernumber IN (SELECT borrowernumber FROM borrowers); > > Why, can you detail please? deletedborrowers pollution happens because first "$patron->move_to_deleted;" succeeds, but then try/catch with "$patron->delete" fails, keeping those deleted records as duplicates.
(add) i.e. that might happen on those servers where this fail happened so manual post-check and cleanup in "deletedborrowers" might be required.
Created attachment 114182 [details] [review] Bug 27144: Fix syntax error that prevents deleting patrons To test: 1) In staff interface open up a patron record 2) Click More -> Delete, and then "Yes, delete" 3) Notice 500 error 4) Apply patch 5) Notice error is now gone when deleting Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Pushed to master for 20.05, thanks to everybody involved!
(In reply to Jonathan Druart from comment #8) > Pushed to master for 20.05, thanks to everybody involved! I think the script might need updating? :) 21.05
Pushed to 20.11.x for 20.11.01
(In reply to Katrin Fischer from comment #9) > (In reply to Jonathan Druart from comment #8) > > Pushed to master for 20.05, thanks to everybody involved! > > I think the script might need updating? :) 21.05 Yes! Pushed to master for 21.05
*** Bug 27189 has been marked as a duplicate of this bug. ***
Created attachment 114341 [details] After fixing bug 27144 Dear All, I patched this bug by adding semicolon(;) at deletemem.pl, but still I get an unusual error even after setting AnonymousPatron in Global System Preference. Please checkout attachment. Advice is anticipated! Thanks!
(In reply to Nishath Ahmed from comment #13) > Created attachment 114341 [details] > After fixing bug 27144 > > Dear All, > I patched this bug by adding semicolon(;) at deletemem.pl, but still I get > an unusual error even after setting AnonymousPatron in Global System > Preference. > Please checkout attachment. > > Advice is anticipated! > > Thanks! Are you trying to delete the anonymous patron? Do you get this error with another patron?
Dear Jonathan Druart, No I set a different user as AnonymousPatron in Global System Preferences and I want to delete other patrons like students and staff category. Thanks!
Pushed to 20.05.x for 20.05.07
Missing dependencies for 19.11.x, can't backport.