Bug 34689: Ignore itemnumber when creating item hash
authorMatt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Fri, 29 Sep 2023 12:44:11 +0000 (12:44 +0000)
committerMatt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Tue, 17 Oct 2023 16:56:24 +0000 (16:56 +0000)
commit24e48496a7e4a60e74a2cf90b675c2fb85ecee83
treed2a8381e3a87cf1a23c64889265bd2b637bf6752
parent21e774ba4609eaca81cd149c7597cd6c7b7309b1
Bug 34689: Ignore itemnumber when creating item hash

A primary key error can be thrown when an item number is included in a new title hash. We need the item creation to ignore an itemnumber even if it is included in a MARC Framework

Test plan:
1) Edit the MARC framework relating to books (BKS in KTD)
2) In the 952$9 field (Koha itemnumber (autogenerated)), change the value of "Managed in tab" to "items (10)"
3) In the catalog, find a record that uses that MARC framework
4) Click "New" and choose to add a new item
5) Enter a barcode and click the "Add & duplicate" button
6) The page will refresh and an item will have been added
7) Enter a new barcode and click the same button again
8) An error will be thrown
9) Click the back button in the browser
10) Apply patch and restart_all
11) Click the add and duplicate button again
12) This time no error will be thrown and the page will refresh with another new item added
13) Sign off!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5b9dbe558f6b9c548786691f29b940e4f2f66b86)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 71dda507622e35d5ab083a8a45cab50a29211596)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
cataloguing/additem.pl