[Bug 34346] New: Adding duplicate tag to a framework leads to error page, should give user readable error message
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34346 Bug ID: 34346 Summary: Adding duplicate tag to a framework leads to error page, should give user readable error message Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: System Administration Assignee: koha-bugs@lists.koha-community.org Reporter: caroline.cyr-la-rose@inlibro.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com I tried adding a tag to the default framework and got a 500 error. It was because the tag already existed. Elsewhere in Koha, we get a user readable message saying something like "An error occurred when inserting this patron category. The patron category might already exist." To replicate: 1. In the staff interface, go to Administration > MARC bibliographic framework 2. Click the Actions button next to the default framework and choose MARC structure 3. Click New tag 4. Fill out the form to add an already existing tag number Tag: 699 Label for lib: Local subject Label for OPAC: Local subject 5. Click Save changes --> 500 error -- 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=34346 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #1 from David Cook <dcook@prosentient.com.au> --- I've just had a librarian bump into this same issue today. (Turns out if you try to add a duplicate subfield, your new subfield overwrites the old subfield. Interesting!) -- 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=34346 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |minor Assignee|koha-bugs@lists.koha-commun |dcook@prosentient.com.au |ity.org | Component|System Administration |MARC Bibliographic data | |support --- Comment #2 from David Cook <dcook@prosentient.com.au> --- I've written a fix. It's not perfect, but I think it's good enough. -- 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=34346 --- Comment #3 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #2)
I've written a fix. It's not perfect, but I think it's good enough.
I think a better solution would be to show the error message on the edit page, but that would involve more refactoring. This seemed like the shortest path forward... but no worries if people rather go the refactoring route. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34346 David Cook <dcook@prosentient.com.au> 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=34346 --- Comment #4 from David Cook <dcook@prosentient.com.au> --- Created attachment 170149 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=170149&action=edit Bug 34346: Show error message instead of 500 for duplicate tags This change shows a user-friendly error message instead of a 500 error if adding a duplicate MARC tag to a MARC bibliographic framework. Test plan: 0. Add patch and koha-plack --reload kohadev 1. Go to http://localhost:8081/cgi-bin/koha/admin/marctagstructure.pl?searchfield=264&frameworkcode= 2. Click "New tag" 3. Enter "264" in "Tag:" field 4. Click "Save changes" 5. See error message on screen (instead of 500 error) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34346 --- Comment #5 from David Cook <dcook@prosentient.com.au> --- Created attachment 170150 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=170150&action=edit Bug 34346: Tidy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34346 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34346 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #170149|0 |1 is obsolete| | Attachment #170150|0 |1 is obsolete| | --- Comment #6 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 170181 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=170181&action=edit Bug 34346: Show error message instead of 500 for duplicate tags This change shows a user-friendly error message instead of a 500 error if adding a duplicate MARC tag to a MARC bibliographic framework. Test plan: 0. Add patch and koha-plack --reload kohadev 1. Go to http://localhost:8081/cgi-bin/koha/admin/marctagstructure.pl?searchfield=264&frameworkcode= 2. Click "New tag" 3. Enter "264" in "Tag:" field 4. Click "Save changes" 5. See error message on screen (instead of 500 error) Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34346 --- Comment #7 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 170182 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=170182&action=edit Bug 34346: Tidy Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34346 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #8 from David Cook <dcook@prosentient.com.au> --- Moving this to "Signed Off" as I think Owen intended to? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34346 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34346 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #170181|0 |1 is obsolete| | --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 170429 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=170429&action=edit Bug 34346: Show error message instead of 500 for duplicate tags This change shows a user-friendly error message instead of a 500 error if adding a duplicate MARC tag to a MARC bibliographic framework. Test plan: 0. Add patch and koha-plack --reload kohadev 1. Go to http://localhost:8081/cgi-bin/koha/admin/marctagstructure.pl?searchfield=264&frameworkcode= 2. Click "New tag" 3. Enter "264" in "Tag:" field 4. Click "Save changes" 5. See error message on screen (instead of 500 error) Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Bug 34346: Tidy Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34346 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to David Cook from comment #2)
I've written a fix. It's not perfect, but I think it's good enough.
Thanks for your patch. Just noting the missing Koha objects for marc_tag_structure, and the nice mix of DBIx::Class and old DBI in this patch :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34346 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #170182|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34346 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34346 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Adding duplicate tag to a |Adding duplicate tag to a |framework leads to error |framework should give user |page, should give user |readable message |readable error message | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34346 --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Slightly adjusted error message inline: From: <div class="dialog message">MARC field not added to MARC bibliographic framework. MARC tag already exists in framework field.</div> To: <div class="dialog message">MARC field not added to MARC bibliographic framework. MARC tag already exists in framework.</div> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34346 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |24.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34346 --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34346 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Pushed to main |Pushed to stable Version(s)|24.11.00 |24.11.00,24.05.06 released in| | --- Comment #13 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Backported to 24.05.x for upcoming 24.05.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34346 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=34346 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|24.11.00,24.05.06 |24.11.00,24.05.06,23.11.11 released in| | CC| |fridolin.somers@biblibre.co | |m Status|Pushed to oldstable |Pushed to oldoldstable --- Comment #14 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34346 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldoldstable |RESOLVED CC| |wainuiwitikapark@catalyst.n | |et.nz Resolution|--- |FIXED --- Comment #15 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org