Bug 31179

Summary: Duplicate item is duplicating internal item fields
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: CatalogingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: critical    
Priority: P5 - low CC: arthur.suzuki, bwsdonna, jonathan.druart, lucas, m.de.rooy, martin.renvoize, mspagnuolo, sbrown, victor
Version: MainKeywords: rel_21_11_candidate
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34689
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00, 22.05.04, 21.11.11
Circulation function:
Bug Depends on: 27526    
Bug Blocks:    
Attachments: Bug 31179: Don't copy invisible subfields when duplicating items
Bug 31179: Don't copy invisible subfields when duplicating items
Bug 31179: (QA follow-up) POD fix
Bug 31179: (QA follow-up) Set field as hidden for tests
Bug 31179: Don't copy invisible subfields when duplicating items
Bug 31179: (QA follow-up) POD fix
Bug 31179: (QA follow-up) Set field as hidden for tests

Description Nick Clemens (kidclamp) 2022-07-18 17:01:05 UTC
Duplicate item is intended to duplicate the visible cataloging fields of an item, however, currently it is duplicating the complete internal record of the item

To recreate:
1 - find an item in Koha staff client, copy the barcode
2 - Issue this item to a patron
3 - Return to the record
4 - Edit items
5 - Click 'Actions->Duplicate' for the item in question
6 - Save the item
7 - Note in the items table above for that 'Total checkouts' 'Due date'
 etc. have been copied to new item
Comment 1 Jonathan Druart 2022-07-19 13:51:59 UTC
If this is a regression it's certainly coming from bug 27526.
Comment 2 Jonathan Druart 2022-07-19 14:11:03 UTC
Created attachment 137872 [details] [review]
Bug 31179: Don't copy invisible subfields when duplicating items

Duplicate item is intended to duplicate the visible cataloging fields of an item, however,
currently it is duplicating the complete internal record of the item

To recreate:
1 - find an item in Koha staff client, copy the barcode
2 - Issue this item to a patron
3 - Return to the record
4 - Edit items
5 - Click 'Actions->Duplicate' for the item in question
6 - Save the item
7 - Note in the items table above for that 'Total checkouts' 'Due date'
 etc. have not been copied to new item
Comment 3 Nick Clemens (kidclamp) 2022-07-19 15:30:34 UTC
Created attachment 137875 [details] [review]
Bug 31179: Don't copy invisible subfields when duplicating items

Duplicate item is intended to duplicate the visible cataloging fields of an item, however,
currently it is duplicating the complete internal record of the item

To recreate:
1 - find an item in Koha staff client, copy the barcode
2 - Issue this item to a patron
3 - Return to the record
4 - Edit items
5 - Click 'Actions->Duplicate' for the item in question
6 - Save the item
7 - Note in the items table above for that 'Total checkouts' 'Due date'
 etc. have not been copied to new item

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 4 Nick Clemens (kidclamp) 2022-07-19 15:30:37 UTC
Created attachment 137876 [details] [review]
Bug 31179: (QA follow-up) POD fix

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 5 Nick Clemens (kidclamp) 2022-07-19 15:30:41 UTC
Created attachment 137877 [details] [review]
Bug 31179: (QA follow-up) Set field as hidden for tests

We want the tests to pass in the case where field is set to visibile in Koha

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Tomás Cohen Arazi (tcohen) 2022-07-19 18:07:13 UTC
Created attachment 137881 [details] [review]
Bug 31179: Don't copy invisible subfields when duplicating items

Duplicate item is intended to duplicate the visible cataloging fields of an item, however,
currently it is duplicating the complete internal record of the item

To recreate:
1 - find an item in Koha staff client, copy the barcode
2 - Issue this item to a patron
3 - Return to the record
4 - Edit items
5 - Click 'Actions->Duplicate' for the item in question
6 - Save the item
7 - Note in the items table above for that 'Total checkouts' 'Due date'
 etc. have not been copied to new item

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 7 Tomás Cohen Arazi (tcohen) 2022-07-19 18:07:19 UTC
Created attachment 137882 [details] [review]
Bug 31179: (QA follow-up) POD fix

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 8 Tomás Cohen Arazi (tcohen) 2022-07-19 18:07:24 UTC
Created attachment 137883 [details] [review]
Bug 31179: (QA follow-up) Set field as hidden for tests

We want the tests to pass in the case where field is set to visibile in Koha

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 9 Tomás Cohen Arazi (tcohen) 2022-07-20 12:10:08 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 10 Michael Spagnuolo 2022-08-03 19:57:29 UTC
Any chance this can be backported to 21.11. We just upgraded to 21.11 and have started to notice this duplicate item behavior.
Comment 11 Sara Brown 2022-08-05 18:22:30 UTC
+1 - backporting would be helpful! Libraries might not notice the internal duplication until after the fact, which may make cleanup difficult.
Comment 12 Jonathan Druart 2022-08-09 10:39:09 UTC
*** Bug 31285 has been marked as a duplicate of this bug. ***
Comment 13 Jonathan Druart 2022-08-09 10:41:00 UTC
Upping severity. Lucas, Arthur, don't forget to backport this one for the next release!
Comment 14 Lucas Gass (lukeg) 2022-08-12 14:35:51 UTC
Backported to 22.05.x for 22.05.04
Comment 15 Arthur Suzuki 2022-08-16 08:45:06 UTC
pushed to 21.11.x for 21.11.11
Comment 16 Victor Grousset/tuxayo 2022-08-19 20:23:16 UTC
Missing dependencies for 21.05.x, it shouldn't be affected, no backport.
Nothing to document, marking resolved.