Description
Jonathan Druart
2020-04-29 12:38:33 UTC
Created attachment 103930 [details] [review] Bug 25311: Better error handling when creating a patron This is still not ideal but brings a bit of enhancement. One possible problem is that the patron creation will fail if the streetnumber field is too long (borrowers.streetnumber is varchar(10). Test plan: 0. Don't apply this patch 1. Create a new patron with a streetnumber longer than 10 characters 2. Save => The patron has not been created and the app explodes The error is about extended_attributes and not meaningful Can't call method "extended_attributes" on an undefined value at /kohadevbox/koha/members/memberentry.pl line 560 3. Apply the patch 4. Repeat 1. and 2 => You get a warning on the interface and you still see the creation form 5. Check the logs => The error is meaningful "Data too long for column 'streetnumber'" Created attachment 103931 [details] [review] Bug 25311: Better error handling when updating a patron Same as the precedent patch for patron's modification Test plan is identical but with an existing patron Code looks good.. just running through testing it. Created attachment 103939 [details] [review] Bug 25311: Better error handling when creating a patron This is still not ideal but brings a bit of enhancement. One possible problem is that the patron creation will fail if the streetnumber field is too long (borrowers.streetnumber is varchar(10). Test plan: 0. Don't apply this patch 1. Create a new patron with a streetnumber longer than 10 characters 2. Save => The patron has not been created and the app explodes The error is about extended_attributes and not meaningful Can't call method "extended_attributes" on an undefined value at /kohadevbox/koha/members/memberentry.pl line 560 3. Apply the patch 4. Repeat 1. and 2 => You get a warning on the interface and you still see the creation form 5. Check the logs => The error is meaningful "Data too long for column 'streetnumber'" Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 103940 [details] [review] Bug 25311: Better error handling when updating a patron Same as the precedent patch for patron's modification Test plan is identical but with an existing patron Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Works well for me following the test plan and is a clear improvement. I also tested housebound modifications, patron messaging preference modifications too. Signing off. This doesn't work like described in the test plan for me. When I create or update a patron with a streetnumber longer than 10 charactres, it saves nicely, but the entry is cut off at 10 characters. Am I missing something? Ok, the message only shows when <strict_sql_modes>1</strict_sql_modes> is set. I don't like the silent failure, but I think that's because the DBMS is silently being mean. Need to fix that elsewhere. Created attachment 104154 [details] [review] Bug 25311: Better error handling when updating a patron Same as the precedent patch for patron's modification Test plan is identical but with an existing patron Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 104155 [details] [review] Bug 25311: (QA follow-up) Add misssing filter Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 104156 [details] [review] Bug 25311: Better error handling when creating a patron This is still not ideal but brings a bit of enhancement. One possible problem is that the patron creation will fail if the streetnumber field is too long (borrowers.streetnumber is varchar(10). Test plan: 0. Don't apply this patch 1. Create a new patron with a streetnumber longer than 10 characters 2. Save => The patron has not been created and the app explodes The error is about extended_attributes and not meaningful Can't call method "extended_attributes" on an undefined value at /kohadevbox/koha/members/memberentry.pl line 560 3. Apply the patch 4. Repeat 1. and 2 => You get a warning on the interface and you still see the creation form 5. Check the logs => The error is meaningful "Data too long for column 'streetnumber'" Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 104157 [details] [review] Bug 25311: Better error handling when updating a patron Same as the precedent patch for patron's modification Test plan is identical but with an existing patron Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 104158 [details] [review] Bug 25311: (QA follow-up) Add misssing filter Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Nice work everyone! Pushed to master for 20.05 the recent devs on memberentrygen.tt has made this too difficult for me to rebase to 19.11.x Can this be rebased to 19.11.x? Thanks Created attachment 104743 [details] [review] [19.11.x] Bug 25311: Better error handling when creating a patron This is still not ideal but brings a bit of enhancement. One possible problem is that the patron creation will fail if the streetnumber field is too long (borrowers.streetnumber is varchar(10). Test plan: 0. Don't apply this patch 1. Create a new patron with a streetnumber longer than 10 characters 2. Save => The patron has not been created and the app explodes The error is about extended_attributes and not meaningful Can't call method "extended_attributes" on an undefined value at /kohadevbox/koha/members/memberentry.pl line 560 3. Apply the patch 4. Repeat 1. and 2 => You get a warning on the interface and you still see the creation form 5. Check the logs => The error is meaningful "Data too long for column 'streetnumber'" Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 104744 [details] [review] [19.11.x] Bug 25311: Better error handling when updating a patron Same as the precedent patch for patron's modification Test plan is identical but with an existing patron Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 104745 [details] [review] [19.11.x] Bug 25311: (QA follow-up) Add misssing filter Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Backported to 19.11.x for 19.11.06 It doesn't apply cleanly on 19.05.x and the conflict isn't simple to solve. If there is an interest in having this backported, feel free to submit a patch for 19.05. |