Summary: | Add and duplicate item - Error 500 | ||
---|---|---|---|
Product: | Koha | Reporter: | Christophe TORIN <christophe.torin> |
Component: | Cataloging | Assignee: | Matt Blenkinsop <matt.blenkinsop> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P3 | CC: | fridolin.somers, jonathan.druart, m.de.rooy, martin.renvoize, matt.blenkinsop, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31179 | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
23.11.00,23.05.05,22.11.11
|
|
Circulation function: | |||
Bug Depends on: | 27526 | ||
Bug Blocks: | |||
Attachments: |
Bug 34689: Ignore itemnumber when creating item hash
Bug 34689: Ignore itemnumber when creating item hash Bug 34689: Ignore itemnumber when creating item hash |
Description
Christophe TORIN
2023-09-01 11:53:39 UTC
Confirmed.. looking into it now I can't for the life of me replicate this locally on a 22.11 checkout (or master).. but I can replicate it on a live site.. there must be something in the configuration that's causing this somewhere but I'm not seeing it yet. Christophe, which exact version of Koha are you using? Do you recreate the problem on a sandbox? I've traced the issue on this and managed to re-produce in KTD. It depends on the MARC framework you are using and what you have in the 952 field for the itemnumber field (subfield 9). If that subfield (952$9) is set to anything other than "ignore" in the "Managed in tab" then it will pull the item number that has just been created from the UI and try to add that as part of the duplicated item. We need to tell the duplication code to ignore the itemnumber field Patch incoming Created attachment 156390 [details] [review] 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! Created attachment 156431 [details] [review] 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> Created attachment 156451 [details] [review] 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> Works, makes sense, QA script happy, code looks good, passing QA :) We need confirmation from Christophe that the patch fixes his problem. Hi, I just applied the patch on our platform and it fixes the problem on our side ! Thank you (In reply to Christophe TORIN from comment #10) > Hi, > > I just applied the patch on our platform and it fixes the problem on our > side ! > > Thank you Great, thanks for the quick reply! Pushed to master for 23.11. Nice work everyone, thanks! Pushed to 23.05.x for 23.05.05 Nice work everyone! Pushed to oldstable for 22.11.x |