Revert "Bug 14598: [QA Follow-up] Small changes"
This reverts commit 8c14c3b32a.
Conflicts:
installer/data/mysql/updatedatabase.pl
This commit is contained in:
parent
0fcd9e9f72
commit
e29afabd75
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue