[Bug 34689] New: Add and duplicate item - Error 500
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34689 Bug ID: 34689 Summary: Add and duplicate item - Error 500 Change sponsored?: --- Product: Koha Version: 22.11 Hardware: All OS: All Status: NEW Severity: normal Priority: P3 Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: christophe.torin@univ-rennes2.fr QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl Test case : - Select any biblio - Add an item - fill the form, and submit with the "Add & duplicate" button - Item is added, and the form is duplicated - Fill the missing info (barcode), and save the new item - Error 500 In koha logs, I have the following error : DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Duplicate entry '1100882' for key 'PRIMARY' at /home/koha/src/Koha/Object.pm line 170 After investigations, the id 1100882 is the id of the item that was added before. It looks like the new itemnumber is still present after duplicate ! Thanks, Christophe -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34689 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Confirmed.. looking into it now -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34689 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=31179 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34689 --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- 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. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34689 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #3 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Christophe, which exact version of Koha are you using? Do you recreate the problem on a sandbox? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34689 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |matt.blenkinsop@ptfs-europe |ity.org |.com CC| |matt.blenkinsop@ptfs-europe | |.com --- Comment #4 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- 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 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34689 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34689 --- Comment #5 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 156390 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156390&action=edit 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! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34689 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|22.11 |master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34689 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34689 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156390|0 |1 is obsolete| | --- Comment #6 from David Nind <david@davidnind.com> --- Created attachment 156431 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156431&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34689 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156431|0 |1 is obsolete| | --- Comment #7 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Created attachment 156451 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156451&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34689 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net Status|Signed Off |Passed QA --- Comment #8 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Works, makes sense, QA script happy, code looks good, passing QA :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34689 --- Comment #9 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- We need confirmation from Christophe that the patch fixes his problem. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34689 --- Comment #10 from Christophe TORIN <christophe.torin@univ-rennes2.fr> --- Hi, I just applied the patch on our platform and it fixes the problem on our side ! Thank you -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34689 --- Comment #11 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (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! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34689 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |23.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34689 --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34689 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Depends on| |27526 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27526 [Bug 27526] Remove Mod/AddItemFromMarc from additem.pl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34689 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Patch complexity|--- |Trivial patch Version(s)|23.11.00 |23.11.00,23.05.05 released in| | --- Comment #13 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.05.x for 23.05.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34689 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|23.11.00,23.05.05 |23.11.00,23.05.05,22.11.11 released in| | Status|Pushed to stable |Pushed to oldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34689 --- Comment #14 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Nice work everyone! Pushed to oldstable for 22.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org