Bug 38847 - Renewing an expired child patron without a guarantor and with ChildNeedsGuarantor set results in an internal server error
Summary: Renewing an expired child patron without a guarantor and with ChildNeedsGuara...
Status: Passed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Baptiste Wojtkowski (bwoj)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-08 15:22 UTC by Baptiste Wojtkowski (bwoj)
Modified: 2025-02-06 18:16 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes an internal server error when renewing an expired child patron without a guarantor, when the ChildNeedsGuarantor system preference is set to "must have". It now displays a standard error message with "This patron could not be renewed: they need a guarantor."
Version(s) released in:
Circulation function:


Attachments
Bug 38847 - Renewing a child without guarantor whith ChildNeedsGuarantor results in an internal server error (edit) o (5.67 KB, patch)
2025-01-08 15:57 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 38847: Fix error when renewing an expired child patron without a guarantor (5.91 KB, patch)
2025-01-24 22:49 UTC, David Nind
Details | Diff | Splinter Review
Bug 38847: Fix error when renewing an expired child patron without a guarantor (5.97 KB, patch)
2025-02-06 18:16 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Baptiste Wojtkowski (bwoj) 2025-01-08 15:22:33 UTC
To reproduce:
1 - Create a child, make sure it has no guarantor
2 - Set ChildNeedsGuarantor to Yes
3 - Renew the child -> you will have an internal server error
Comment 1 Baptiste Wojtkowski (bwoj) 2025-01-08 15:57:54 UTC
Created attachment 176249 [details] [review]
Bug 38847 - Renewing a child without guarantor whith ChildNeedsGuarantor results in an internal server error (edit) o

Test plan:
1 - Create a child, make sure it has no guarantor
2 - Set ChildNeedsGuarantor to Yes
3 - Renew the child (on morember.pl or circulation.pl) -> you will have an internal server error
4 - Apply patch
5 - Go to moremember.pl, try and renew the patron -> you will be
  redirected to moremember with an error message
6 - Go to circulation.pl, try and renew the patron -> you will be
  redirected to circultation.pl with an error message
7 - Create a guarantor for the patron
8 - Repeat 5 & 6 and notice it is now renewed
Comment 2 David Nind 2025-01-24 22:49:30 UTC
Created attachment 177135 [details] [review]
Bug 38847: Fix error when renewing an expired child patron without a guarantor

This fixes an internal server error when renewing an expired
child patron without a guarantor, when the ChildNeedsGuarantor
is set to "must have".

Test plan:
1. Create or edit a child patron:
   - Don't add a guarantor.
   - Set the "Expiry date" to a date in the past.
2. Set the ChildNeedsGuarantor system preference to "must have".
3. Refresh or view the patron's check out or details page, and
   select the "Renew" link under the attention heading -
   this generates an internal server error message.
4. Apply patch.
5. Repeat step 3, you will now get a standard error message
   "This patron could not be renewed: they need a guarantor."
6. Add a guarantor for the patron.
7. Repeat step 3, and click "Renew" - the patron is now renewed.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2025-01-24 22:51:53 UTC
Comment on attachment 176249 [details] [review]
Bug 38847 - Renewing a child without guarantor whith ChildNeedsGuarantor results in an internal server error (edit) o

I edited the commit message to be more consistent with the commit message guidelines - colon after the bug number in the title, description, improved the test plan, clarify that this is for when the patron's account is expired.
Comment 4 Nick Clemens (kidclamp) 2025-02-06 18:16:50 UTC
Created attachment 177589 [details] [review]
Bug 38847: Fix error when renewing an expired child patron without a guarantor

This fixes an internal server error when renewing an expired
child patron without a guarantor, when the ChildNeedsGuarantor
is set to "must have".

Test plan:
1. Create or edit a child patron:
   - Don't add a guarantor.
   - Set the "Expiry date" to a date in the past.
2. Set the ChildNeedsGuarantor system preference to "must have".
3. Refresh or view the patron's check out or details page, and
   select the "Renew" link under the attention heading -
   this generates an internal server error message.
4. Apply patch.
5. Repeat step 3, you will now get a standard error message
   "This patron could not be renewed: they need a guarantor."
6. Add a guarantor for the patron.
7. Repeat step 3, and click "Renew" - the patron is now renewed.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>