From e29afabd753141da987bd635c783149cd6cf283d Mon Sep 17 00:00:00 2001 From: Mason James Date: Thu, 29 Dec 2016 14:50:23 +1300 Subject: [PATCH] Revert "Bug 14598: [QA Follow-up] Small changes" This reverts commit 8c14c3b32a57fd9a3be4c7e44a79e1a4b8cc8acf. Conflicts: installer/data/mysql/updatedatabase.pl --- installer/data/mysql/updatedatabase.pl | 47 +------------------------- t/db_dependent/Circulation.t | 10 ------ 2 files changed, 1 insertion(+), 56 deletions(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 4aa2da6f35..70036be930 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -12821,52 +12821,7 @@ if ( CheckVersion($DBversion) ) { $DBversion = '16.05.05.002'; if ( CheckVersion($DBversion) ) { - - my $sth = $dbh->prepare(q{ - SELECT s.itemnumber, i.itype, b.itemtype - FROM - ( SELECT DISTINCT itemnumber - FROM statistics - WHERE ( type = "return" OR type = "localuse" ) AND - itemtype IS NULL - ) s - LEFT JOIN - ( SELECT itemnumber,biblionumber, itype - FROM items - UNION - SELECT itemnumber,biblionumber, itype - FROM deleteditems - ) i - ON (s.itemnumber=i.itemnumber) - LEFT JOIN - ( SELECT biblionumber, itemtype - FROM biblioitems - UNION - SELECT biblionumber, itemtype - FROM deletedbiblioitems - ) b - ON (i.biblionumber=b.biblionumber); - }); - $sth->execute(); - - my $update_sth = $dbh->prepare(q{ - UPDATE statistics - SET itemtype=? - WHERE itemnumber=? AND itemtype IS NULL - }); - my $ilevel_itypes = C4::Context->preference('item-level_itypes'); - - while ( my ($itemnumber,$item_itype,$biblio_itype) = $sth->fetchrow_array ) { - - my $effective_itemtype = $ilevel_itypes - ? $item_itype // $biblio_itype - : $biblio_itype; - warn "item-level_itypes set but no itype defined for item ($itemnumber)" - if $ilevel_itypes and !defined $item_itype; - $update_sth->execute( $effective_itemtype, $itemnumber ); - } - - print "Upgrade to $DBversion done (Bug 14598: itemtype is not set on statistics by C4::Circulation::AddReturn)\n"; + print "Upgrade to $DBversion done (NO-OP, revert of BZ-14598)\n"; SetVersion($DBversion); } diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index 41704ccd28..df992ebd32 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -17,18 +17,8 @@ use Modern::Perl; -use Test::More tests => 88; - -BEGIN { - require_ok('C4::Circulation'); -} - use DateTime; - use t::lib::Mocks; -use t::lib::TestBuilder; - -use C4::Circulation; use C4::Biblio; use C4::Branch; use C4::Items; -- 2.39.5