Bug 35254

Summary: Adding files to basket from a staged file uses wrong inputs for order information when not all records are selected
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: AcquisitionsAssignee: Nick Clemens (kidclamp) <nick>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: caroline.cyr-la-rose, f.demians, fridolin.somers, pedro.amorim, victor
Version: MainKeywords: rel_22_11_candidate
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.06,22.11.13
Circulation function:
Bug Depends on:    
Bug Blocks: 35823    
Attachments: Bug 35254: Add import_record_id to order inputs
Bug 35254: Add import_record_id to order inputs
Bug 35254: Add import_record_id to order inputs
Bug 35254: [22.11.x] Add import_record_id to order inputs

Description Nick Clemens (kidclamp) 2023-11-03 17:56:36 UTC
Bug 32166 fixed the issue of items and inputs not matching up for item level details, however, the problem still exists for order level information

To recreate:
1 - Find a vendor in acquisitions
2 - Create or find an open basket
3 - Add to basket form a new file
4 - Stage file and add to basket
5 - Select the second record in the list
6 - Enter price info
7 - Save (don't forget, you need to set item type in the second tab)
8 - The order has no price info!
Comment 1 Nick Clemens (kidclamp) 2023-11-03 20:12:59 UTC
Created attachment 158366 [details] [review]
Bug 35254: Add import_record_id to order inputs

This patch follows the logic of bug 32166 and adds specific inputs for each order to avoid any misalignment when some records are not imported

To test:
1 - Find a vendor in acquisitions
2 - Create or find an open basket
3 - Add to basket form a new file
4 - Stage file and add to basket
5 - Select the second record in the list
6 - Enter price info
7 - Save (don't forget, you need to set item type in the second tab)
8 - The order has no price info!
9 - Apply patch
10 - Repeat 3-7 above, staging file fresh
11 - Confirm order has correct prices
12 - Test with a file with many records
13 - Confirm any combination of choosing/skipping records works as expected
Comment 2 Katrin Fischer 2023-11-04 12:07:33 UTC
Created attachment 158374 [details] [review]
Bug 35254: Add import_record_id to order inputs

This patch follows the logic of bug 32166 and adds specific inputs for each order to avoid any misalignment when some records are not imported

To test:
1 - Find a vendor in acquisitions
2 - Create or find an open basket
3 - Add to basket form a new file
4 - Stage file and add to basket
5 - Select the second record in the list
6 - Enter price info
7 - Save (don't forget, you need to set item type in the second tab)
8 - The order has no price info!
9 - Apply patch
10 - Repeat 3-7 above, staging file fresh
11 - Confirm order has correct prices
12 - Test with a file with many records
13 - Confirm any combination of choosing/skipping records works as expected

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 3 Katrin Fischer 2023-11-04 12:08:02 UTC
I really wonder why we didn't stumble on this much sooner?
Comment 4 Victor Grousset/tuxayo 2023-11-06 18:54:00 UTC
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt
Auto-merging acqui/addorderiso2709.pl
CONFLICT (content): Merge conflict in acqui/addorderiso2709.pl

Not trivial for addorderiso2709.tt
Comment 5 Victor Grousset/tuxayo 2023-11-06 19:14:39 UTC
My bad, was trying to apply bug 32166 which is why I wasn't finding the last commit were it applies well. Continuing review.
Comment 6 Victor Grousset/tuxayo 2023-11-06 20:55:58 UTC
Created attachment 158565 [details] [review]
Bug 35254: Add import_record_id to order inputs

This patch follows the logic of bug 32166 and adds specific inputs for each order to avoid any misalignment when some records are not imported

To test:
1 - Find a vendor in acquisitions
2 - Create or find an open basket
3 - Add to basket form a new file
4 - Stage file and add to basket
5 - Select the second record in the list
6 - Enter price info
7 - Save (don't forget, you need to set item type in the second tab)
8 - The order has no price info!
9 - Apply patch
10 - Repeat 3-7 above, staging file fresh
11 - Confirm order has correct prices
12 - Test with a file with many records
13 - Confirm any combination of choosing/skipping records works as expected

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 7 Victor Grousset/tuxayo 2023-11-06 20:58:51 UTC
Works, makes sense, QA script happy, code looks good, passing QA :)

---

(In reply to Katrin Fischer from comment #3)
> I really wonder why we didn't stumble on this much sooner?

Indeed!
Comment 8 Tomás Cohen Arazi (tcohen) 2023-11-08 20:55:34 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 9 Fridolin Somers 2023-11-11 07:08:45 UTC
Pushed to 23.05.x for 23.05.06
Comment 10 Nick Clemens (kidclamp) 2023-12-11 14:57:41 UTC
Any reason this was not backported to 22.11?
Comment 11 Nick Clemens (kidclamp) 2023-12-11 15:23:34 UTC
Created attachment 159713 [details] [review]
Bug 35254: [22.11.x] Add import_record_id to order inputs

This patch follows the logic of bug 32166 and adds specific inputs for each order to avoid any misalignment when some records are not imported

To test:
1 - Find a vendor in acquisitions
2 - Create or find an open basket
3 - Add to basket form a new file
4 - Stage file and add to basket
5 - Select the second record in the list
6 - Enter price info
7 - Save (don't forget, you need to set item type in the second tab)
8 - The order has no price info!
9 - Apply patch
10 - Repeat 3-7 above, staging file fresh
11 - Confirm order has correct prices
12 - Test with a file with many records
13 - Confirm any combination of choosing/skipping records works as expected

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 12 Frédéric Demians 2023-12-13 11:26:57 UTC
Pushed to 22.11.x for 22.11.13
Comment 13 Caroline Cyr La Rose 2024-05-15 19:49:36 UTC
Why is this set to REOPENED?
Comment 14 Nick Clemens (kidclamp) 2024-05-15 19:58:22 UTC
My fault, I did that for attention for backporting 

Closing now
Comment 15 Caroline Cyr La Rose 2024-05-15 20:14:47 UTC
Okay thanks! I thought maybe there was a problem with the patch that needed to be fixed.