From b264e398401723e05e1f5dff62c426254e7066ec Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 27 May 2014 17:57:33 +0000 Subject: [PATCH] Bug 11891: (follow-up) set DBIC storage flags correctly Since we're passing an existing DBI database handle to DBIC, and that handle doesn't have RaiseError set to true by default, don't let DBIC override that -- for now. Test plan: verify that the DB-dependent test suite passes. Signed-off-by: Galen Charlton Signed-off-by: Chris Cormack Signed-off-by: Tomas Cohen Arazi --- Koha/Database.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Koha/Database.pm b/Koha/Database.pm index 99888c6841..92e83ec8fa 100644 --- a/Koha/Database.pm +++ b/Koha/Database.pm @@ -45,7 +45,12 @@ __PACKAGE__->mk_accessors(qw( )); # database connection from the data given in the current context, and # returns it. sub _new_schema { - my $schema = Koha::Schema->connect( sub { C4::Context->dbh } ); + + my $context = C4::Context->new(); + + # we are letting C4::Context->dbh not set the RaiseError handle attribute + # for now for compatbility purposes + my $schema = Koha::Schema->connect( sub { C4::Context->dbh }, { unsafe => 1 } ); return $schema; } -- 2.39.5