[Koha-bugs] [Bug 15962] New: Currency deletion doesn't correctly identify currencies in use

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Mar 2 18:29:33 CET 2016


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 at lists.koha-community.org
          Reporter: oleonard at myacpl.org
        QA Contact: testopia at 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.


More information about the Koha-bugs mailing list