From 2689d05e4e5a27860ef48f89ed801516198e6432 Mon Sep 17 00:00:00 2001 From: Srdjan Date: Wed, 30 Mar 2016 17:34:45 +1300 Subject: [PATCH] bug_15562: Revert "Bug 13690: use Koha::Schema only when it's needed" This reverts commit c52bc9756a5fa1e4f6bba7ce5c58124f150c5efc. I don't see any place where we would use KOha::Database without wanting Koha::Schema. require Koha::Schema interferes with some plack setups - for some reason it calls C4::Context->import() even when C4::Context is already used. --- Koha/Database.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Koha/Database.pm b/Koha/Database.pm index a8f4eab..d40eb52 100644 --- a/Koha/Database.pm +++ b/Koha/Database.pm @@ -35,6 +35,7 @@ Koha::Database use Modern::Perl; use Carp; use C4::Context; +use Koha::Schema; use base qw(Class::Accessor); use vars qw($database); @@ -47,8 +48,6 @@ __PACKAGE__->mk_accessors(qw( )); # returns it. sub _new_schema { - require Koha::Schema; - my $context = C4::Context->new(); my $db_driver = $context->{db_driver}; -- 2.5.0