Bug 35725

Summary: Generic master form does not keep patron and cardnumber when changing type
Product: Koha Reporter: Pedro Amorim <pedro.amorim>
Component: ILLAssignee: Pedro Amorim <pedro.amorim>
Status: RESOLVED FIXED QA Contact: Tomás Cohen Arazi (tcohen) <tomascohen>
Severity: normal    
Priority: P5 - low CC: david, lucas, m.de.rooy, magnus, martin.renvoize, nick, pedro.amorim, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00
Circulation function:
Bug Depends on: 35570    
Bug Blocks: 36221    
Attachments: 35725: Keep cardnumber and library data when changing request type
Bug 35725: Keep cardnumber and library data when changing request type
Bug 35725: Fix 'Create' button enabled/disabled
Bug 35725: Keep cardnumber and library data when changing request type
Bug 35725: Fix 'Create' button enabled/disabled
Bug 35725: Keep cardnumber and library data when changing request type
Bug 35725: Fix 'Create' button enabled/disabled

Description Pedro Amorim 2024-01-08 14:42:57 UTC
Test plan:
1) Apply 35570
2) Enable ILLModule sys pref through UI, or run:
   echo "update systempreferences set value = 1 where variable = \"ILLModule\";" | koha-mysql kohadev
3) Create a new Standard request, visit:
   http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
4) Input a cardnumber and/or set a library at the bottom under "Patron options".
5) Change the type (top of the form). Notice the data from step 4) is gone.
Comment 1 Pedro Amorim 2024-01-08 14:43:48 UTC Comment hidden (obsolete)
Comment 2 Pedro Amorim 2024-01-08 14:45:21 UTC
Created attachment 160630 [details] [review]
Bug 35725: Keep cardnumber and library data when changing request type

Test plan:
1) Apply 35570
2) Enable ILLModule sys pref through UI, or run:
   echo "update systempreferences set value = 1 where variable = \"ILLModule\";" | koha-mysql kohadev
3) Create a new Standard request, visit:
   http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
4) Input a cardnumber and/or set a library at the bottom under "Patron options".
5) Change the type (top of the form). Notice the data from step 4) is gone.
6) Apply patch. Repeat test plan and notice data is kept when changing request type.
Comment 3 Pedro Amorim 2024-01-08 16:56:19 UTC
Created attachment 160650 [details] [review]
Bug 35725: Fix 'Create' button enabled/disabled

The previous patch fixed what it stated, but uncovered a new issue:
If you input a cardnumber + a branchcode and then change type, the 'Create' button becomes disabled
This happens because the trigger for it is on change only, the current patch updates this to also happen
on DOMContentLoaded.

Test plan:
1) Apply previous patch
2) Do steps from previous patch plan up to and including step 5)
3) Click 'Create'. Notice it doesn't submit (nothing happens).
4) Apply this patch and do a hard reload (clearing browser js cache)
5) Repeat steps 1) to 3). Notice it now submits correctly.
Comment 4 David Nind 2024-01-08 21:27:21 UTC
Created attachment 160661 [details] [review]
Bug 35725: Keep cardnumber and library data when changing request type

Test plan:
1) Apply 35570
2) Enable ILLModule sys pref through UI, or run:
   echo "update systempreferences set value = 1 where variable = \"ILLModule\";" | koha-mysql kohadev
3) Create a new Standard request, visit:
   http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
4) Input a cardnumber and/or set a library at the bottom under "Patron options".
5) Change the type (top of the form). Notice the data from step 4) is gone.
6) Apply patch. Repeat test plan and notice data is kept when changing request type.

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 David Nind 2024-01-08 21:27:24 UTC
Created attachment 160662 [details] [review]
Bug 35725: Fix 'Create' button enabled/disabled

The previous patch fixed what it stated, but uncovered a new issue:
If you input a cardnumber + a branchcode and then change type, the 'Create' button becomes disabled
This happens because the trigger for it is on change only, the current patch updates this to also happen
on DOMContentLoaded.

Test plan:
1) Apply previous patch
2) Do steps from previous patch plan up to and including step 5)
3) Click 'Create'. Notice it doesn't submit (nothing happens).
4) Apply this patch and do a hard reload (clearing browser js cache)
5) Repeat steps 1) to 3). Notice it now submits correctly.

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 Marcel de Rooy 2024-01-26 10:41:39 UTC
Blocked for now, unblock if dep moves again
Comment 7 Tomás Cohen Arazi (tcohen) 2024-10-14 17:58:49 UTC
Created attachment 172738 [details] [review]
Bug 35725: Keep cardnumber and library data when changing request type

Test plan:
1) Apply 35570
2) Enable ILLModule sys pref through UI, or run:
   echo "update systempreferences set value = 1 where variable = \"ILLModule\";" | koha-mysql kohadev
3) Create a new Standard request, visit:
   http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
4) Input a cardnumber and/or set a library at the bottom under "Patron options".
5) Change the type (top of the form). Notice the data from step 4) is gone.
6) Apply patch. Repeat test plan and notice data is kept when changing request type.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 8 Tomás Cohen Arazi (tcohen) 2024-10-14 17:58:52 UTC
Created attachment 172739 [details] [review]
Bug 35725: Fix 'Create' button enabled/disabled

The previous patch fixed what it stated, but uncovered a new issue:
If you input a cardnumber + a branchcode and then change type, the 'Create' button becomes disabled
This happens because the trigger for it is on change only, the current patch updates this to also happen
on DOMContentLoaded.

Test plan:
1) Apply previous patch
2) Do steps from previous patch plan up to and including step 5)
3) Click 'Create'. Notice it doesn't submit (nothing happens).
4) Apply this patch and do a hard reload (clearing browser js cache)
5) Repeat steps 1) to 3). Notice it now submits correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 9 Katrin Fischer 2024-10-16 12:23:27 UTC
Can't be a bug if the feature hasn't been pushed yet :)
Comment 10 Katrin Fischer 2024-10-31 10:33:39 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 11 Lucas Gass (lukeg) 2024-12-05 21:25:49 UTC
Missing 24.05.x deps, no backport.