Bug 30344

Summary: Changing a patron from a category that allows guarantees to one that doesn't should remove that link
Product: Koha Reporter: Kyle M Hall <kyle>
Component: PatronsAssignee: Bugs List <koha-bugs>
Status: CLOSED WORKSFORME QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: andrewfh, gmcharlt, kyle.m.hall, patrick.robitaille
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 12446    
Bug Blocks: 30351    
Attachments: Bug 30344: Changing a patron from a category that allows guarantees to one that doesn't should remove that link
Bug 30344: Changing a patron from a category that allows guarantees to one that doesn't should remove that link

Description Kyle M Hall 2022-03-23 18:18:21 UTC
If a child typo patron is changed to an adult type patron, it hides the patron's guarantors, but does not remove that link. We should be removing that link.
Comment 1 Kyle M Hall 2022-03-23 19:05:47 UTC
Updated description:

If an adult type patron is changed to a child type patron, it hides the patron's guarantees, but does not remove that link. We should be removing that link as we do when a guarantee becomes an adult type patron.
Comment 2 Kyle M Hall 2022-03-24 11:00:19 UTC
Created attachment 132117 [details] [review]
Bug 30344: Changing a patron from a category that allows guarantees to one that doesn't should remove that link

If an adult type patron is changed to a child type patron, it hides the patron's guarantees, but does not remove that link.
We should be removing that link as we do when a guarantee becomes an adult type patron.

Test Plan:
1) Create an adult with a guarantor
2) Turn that adult into a child patron tyupe
3) Note the guarantees show on the patron details, but not in the patron
   editor
4) Turn that patron back into an adult
5) Note the guarantees how again in the editor
6) Apply this patch
7) Restart all the things!
8) Turn that patron back into a child again
9) Note the guarantees no longer show on the patron details
10) Turn that patron back into an adult
11) Note the patron still has no guarantees
Comment 3 Andrew Fuerste-Henry 2022-07-29 16:14:58 UTC
Added a dependency on 12446, which just made it possible to have guarantors for adults. This patch no longer applies.
Comment 4 Kyle M Hall 2022-11-14 14:19:21 UTC
Created attachment 143829 [details] [review]
Bug 30344: Changing a patron from a category that allows guarantees to one that doesn't should remove that link

If an adult type patron is changed to a child type patron, it hides the patron's guarantees, but does not remove that link.
We should be removing that link as we do when a guarantee becomes an adult type patron.

Test Plan:
1) Create an adult with a guarantor
2) Turn that adult into a child patron tyupe
3) Note the guarantees show on the patron details, but not in the patron
   editor
4) Turn that patron back into an adult
5) Note the guarantees how again in the editor
6) Apply this patch
7) Restart all the things!
8) Turn that patron back into a child again
9) Note the guarantees no longer show on the patron details
10) Turn that patron back into an adult
11) Note the patron still has no guarantees
Comment 5 Andrew Fuerste-Henry 2022-11-14 16:35:17 UTC
I can no longer reproduce the original issue on master without these patches. Here's what I get before I apply any of this:

1: create a patron in a category where canbeguarantee=1
2: give that patron a guarantor, confirm it shows in details and editor
3: edit that patron to a category where canbeguarantee=0
4: confirm on details and in editor that patron's guarantor no longer shows
5: edit patron back to their original category
6: confirm their guarantor *still* doesn't show

So I'm marking this resolved, Works for Me, but please adjust if you can reproduce the issue.
Comment 6 Andrew Fuerste-Henry 2022-11-14 16:50:36 UTC
That said, please see bug 32195 and bug 32196 for issues where a patron category is edited and leaves un-editable relationships.