Bug 35774

Summary: add_item_to_item_group additem.pl should be $item->itemnumber instead of biblioitemnumber
Product: Koha Reporter: Lucas Gass <lucas>
Component: CatalogingAssignee: Lucas Gass <lucas>
Status: Pushed to oldstable --- QA Contact: Marcel de Rooy <m.de.rooy>
Severity: normal    
Priority: P5 - low CC: david, fridolin.somers, jonathan.druart, Laura.escamilla, m.de.rooy
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.05.00,23.11.03,23.05.09
Bug Depends on: 33639    
Bug Blocks:    
Attachments: Bug 35774: Use itemnumber instead of biblioitemnumber
Bug 35774: Use itemnumber instead of biblioitemnumber
Bug 35774: Use itemnumber instead of biblioitemnumber
Bug 35774: Use itemnumber instead of biblioitemnumber

Description Lucas Gass 2024-01-11 15:29:38 UTC
Opening this based on a comment in Bug 33639

446                     add_item_to_item_group( $item->biblionumber, $item->biblioitemnumber, $item_group, $item_group_description );

Should it be $item->itemnumber instead of biblioitemnumber here as well?


Looks like this should indeed be $item->itemnumber.
Comment 1 Lucas Gass 2024-01-12 18:10:18 UTC
Created attachment 160994 [details] [review]
Bug 35774: Use itemnumber instead of biblioitemnumber

To test: ( SAME PLAN AS BZ 33639)
Apply patch
1 - Browse to details page for a record
2 - Create or ensure the record has item group(s)
3 - Click New->New item
4 - Note the bottom of the page has a form to attach to existing group
5 - Note when a group is selected the enumchron field is populated
6 - Confirm item is saved to group when saved
Comment 2 David Nind 2024-01-12 20:19:00 UTC
I think I'm missing something for testing this bug.

Should I notice any change in behaviour before and after the patch is applied? Everything seems to work the same for me.

Also, I'm confused about step 5:

1. If you add a new item, put a value to 952$h, then add to a group, then the 952$h shouldn't change. (This is the behaviour I'm seeing.)

OR

2. If existing items have a value in 952$h, then when you add a new item, it should increment?

OR

3. Something else?
Comment 3 Lucas Gass 2024-01-17 22:35:16 UTC
(In reply to David Nind from comment #2)
> I think I'm missing something for testing this bug.
> 
> Should I notice any change in behaviour before and after the patch is
> applied? Everything seems to work the same for me.
> 
> Also, I'm confused about step 5:
> 
> 1. If you add a new item, put a value to 952$h, then add to a group, then
> the 952$h shouldn't change. (This is the behaviour I'm seeing.)
> 
> OR
> 
> 2. If existing items have a value in 952$h, then when you add a new item, it
> should increment?
> 
> OR
> 
> 3. Something else?

David, this is my fault. I attached the wrong test plan.
Comment 4 Lucas Gass 2024-01-17 22:38:14 UTC
Created attachment 161122 [details] [review]
Bug 35774: Use itemnumber instead of biblioitemnumber

With Bug 33639 already pushed to master there should be NO change in behavior.

To test:
1. APPLY PATCH
2. Create one or more item groups for a bib if needed
3. Create a new item, and at the bottom of the 'Add item' screen, select the item group to which you want this item added. Save.
4. The item should succesffuly be added to the item group.
5. Add a new item and to the same record and this time try the 'Create a new item group' from the dropdown.
6. Name the new item group.
7. Make sure it is correctly added to the item group.
Comment 5 David Nind 2024-01-18 06:05:43 UTC
Created attachment 161127 [details] [review]
Bug 35774: Use itemnumber instead of biblioitemnumber

With Bug 33639 already pushed to master there should be NO change in behavior.

To test:
1. APPLY PATCH
2. Create one or more item groups for a bib if needed
3. Create a new item, and at the bottom of the 'Add item' screen, select the item group to which you want this item added. Save.
4. The item should succesffuly be added to the item group.
5. Add a new item and to the same record and this time try the 'Create a new item group' from the dropdown.
6. Name the new item group.
7. Make sure it is correctly added to the item group.

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 David Nind 2024-01-18 06:06:18 UTC
(In reply to Lucas Gass from comment #3)

> David, this is my fault. I attached the wrong test plan.

No problem!

Now signed off.
Comment 7 Marcel de Rooy 2024-01-19 10:17:38 UTC
Created attachment 161182 [details] [review]
Bug 35774: Use itemnumber instead of biblioitemnumber

With Bug 33639 already pushed to master there should be NO change in behavior.

To test:
1. APPLY PATCH
2. Create one or more item groups for a bib if needed
3. Create a new item, and at the bottom of the 'Add item' screen, select the item group to which you want this item added. Save.
4. The item should succesffuly be added to the item group.
5. Add a new item and to the same record and this time try the 'Create a new item group' from the dropdown.
6. Name the new item group.
7. Make sure it is correctly added to the item group.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 8 Katrin Fischer 2024-01-29 11:29:17 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 9 Fridolin Somers 2024-02-01 15:09:16 UTC
Pushed to 23.11.x for 23.11.03
Comment 10 Lucas Gass 2024-02-02 16:11:24 UTC
Backported to 23.05.x for upcoming 23.05.09