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 <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
Galen Charlton 2014-05-27 17:57:33 +00:00 committed by Tomas Cohen Arazi
parent 967f5cb513
commit b264e39840
1 changed files with 6 additions and 1 deletions

View File

@ -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;
}