[Koha-patches] [PATCH] bug_15562: Revert "Bug 13690: use Koha::Schema only when it's needed"
Srdjan
srdjan at catalyst.net.nz
Wed Mar 30 06:56:07 CEST 2016
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
More information about the Koha-patches
mailing list