[Bug 15962] New: Currency deletion doesn't correctly identify currencies in use
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15962 Bug ID: 15962 Summary: Currency deletion doesn't correctly identify currencies in use Change sponsored?: --- Product: Koha Version: master Hardware: All URL: /cgi-bin/koha/admin/currency.pl?op=delete_confirm OS: All Status: NEW Severity: normal Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: oleonard@myacpl.org QA Contact: testopia@bugs.koha-community.org currency.pl tries to see if a currency is active before deleting it: my $total_row = $dbh->selectrow_hashref( 'select count(*) as total from aqbooksellers where currency=?', {}, $curr ); However it doesn't look like the currency column in aqbooksellers is used (anymore?). It looks to me like there are two columns to check: List prices aqbooksellers.listprice) and invoice price (aqbooksellers.invoiceprice). If you try to delete a currency which is in use as a list or invoice price in a vendor record the process will fail silently: currency.pl: DBD::mysql::db do failed: Cannot delete or update a parent row: a foreign key constraint fails (`koha`.`aqbasket`, CONSTRAINT `aqbasket_ibfk_3` FOREIGN KEY (`basketgroupid`) REFERENCES `aqbasketgroups` (`id`) ON UPDATE CASCADE) -- 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=15962 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #1 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Nice catch! I think you are right about currency being no longer in use - I had to track down the deletion problem a little while ago. -- 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=15962 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=15962 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 48773 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=48773&action=edit Bug 15962: Add messages on the currency admin page Bug 15084 rewrote the currency admin page but forgot to add the messages block. Test plan: Add/update/delete vendors. You should get information messages. -- 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=15962 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 48774 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=48774&action=edit Bug 15962: Block the currency deletion if used A currency should not be deleted if used by a vendor or a basket. Test plan: 1/ Add a new currency 2/ Create a vendor using this currency 3/ Create a basket using this currency 4/ Try to delete the currency 5/ Delete the basket 6/ Try to delete the currency 7/ Delete the vendor 8/ Delete the currency -- 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=15962 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- You will need the last patch on bug 15084 (typo currency vs currency_code) to test this patch. -- 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=15962 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |jonathan.druart@bugs.koha-c |ity.org |ommunity.org -- 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=15962 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=15993 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15962 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |15084 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15084 [Bug 15084] Move the currency related code to Koha::Acquisition::Currenc[y|ies] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15962 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #5 from Owen Leonard <oleonard@myacpl.org> --- In testing the "active" status for a currency keeps getting unset: 1. Edit active currency. 2. Save without making changes (the "active" checkbox is checked). 3. The currency is saved without the "active" status and I get a warning, "No active currency is defined." -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15962 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Owen Leonard from comment #5)
In testing the "active" status for a currency keeps getting unset:
1. Edit active currency. 2. Save without making changes (the "active" checkbox is checked). 3. The currency is saved without the "active" status and I get a warning, "No active currency is defined."
Confirmed, but on master :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15962 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jonathan Druart from comment #6)
(In reply to Owen Leonard from comment #5)
In testing the "active" status for a currency keeps getting unset:
1. Edit active currency. 2. Save without making changes (the "active" checkbox is checked). 3. The currency is saved without the "active" status and I get a warning, "No active currency is defined."
Confirmed, but on master :)
Fixed on bug 16053. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15962 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #48773|0 |1 is obsolete| | --- Comment #8 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 49047 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=49047&action=edit [SIGNED-OFF] Bug 15962: Add messages on the currency admin page Bug 15084 rewrote the currency admin page but forgot to add the messages block. Test plan: Add/update/delete vendors. You should get information messages. 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=15962 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #48774|0 |1 is obsolete| | --- Comment #9 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 49048 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=49048&action=edit [SIGNED-OFF] Bug 15962: Block the currency deletion if used A currency should not be deleted if used by a vendor or a basket. Test plan: 1/ Add a new currency 2/ Create a vendor using this currency 3/ Create a basket using this currency 4/ Try to delete the currency 5/ Delete the basket 6/ Try to delete the currency 7/ Delete the vendor 8/ Delete the currency 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=15962 Owen Leonard <oleonard@myacpl.org> 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=15962 --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 49374 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=49374&action=edit [PASSED QA] Bug 15962: Block the currency deletion if used A currency should not be deleted if used by a vendor or a basket. Test plan: 1/ Add a new currency 2/ Create a vendor using this currency 3/ Create a basket using this currency 4/ Try to delete the currency 5/ Delete the basket 6/ Try to delete the currency 7/ Delete the vendor 8/ Delete the currency Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15962 Katrin Fischer <katrin.fischer@bsz-bw.de> 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=15962 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #49048|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=15962 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #49374|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=15962 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #49047|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=15962 --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 49375 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=49375&action=edit [PASSED QA] Bug 15962: Add messages on the currency admin page Bug 15084 rewrote the currency admin page but forgot to add the messages block. Test plan: Add/update/delete vendors. You should get information messages. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15962 --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 49376 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=49376&action=edit [PASSED QA] Bug 15962: Block the currency deletion if used A currency should not be deleted if used by a vendor or a basket. Test plan: 1/ Add a new currency 2/ Create a vendor using this currency 3/ Create a basket using this currency 4/ Try to delete the currency 5/ Delete the basket 6/ Try to delete the currency 7/ Delete the vendor 8/ Delete the currency Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15962 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |brendan@bywatersolutions.co | |m --- Comment #13 from Brendan Gallagher <brendan@bywatersolutions.com> --- Pushed to Master - Should be in the May 2016 release. Thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15962 --- Comment #14 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 50232 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=50232&action=edit [3.22.x] Bug 15962: Block the currency deletion if used Patch for 3.22.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15962 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |julian.maurice@biblibre.com --- Comment #15 from Julian Maurice <julian.maurice@biblibre.com> --- Patch pushed to 3.22.x, will be in 3.22.6 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15962 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |frederic@tamil.fr --- Comment #16 from Frédéric Demians <frederic@tamil.fr> --- Pushed to 3.22.x, will be in 3.20.11. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org