Bugzilla – Attachment 25827 Details for
Bug 11634
Allow renewal of item with unfilled holds if other available items can fill those holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Make Koha::Database use C4::Context->dbh
Make-KohaDatabase-use-C4Context-dbh.patch (text/plain), 2.13 KB, created by
Kyle M Hall (khall)
on 2014-03-04 18:28:28 UTC
(
hide
)
Description:
Make Koha::Database use C4::Context->dbh
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-03-04 18:28:28 UTC
Size:
2.13 KB
patch
obsolete
>From 1969cee15fbf1c15bd2bd6dcef417d575e473410 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 4 Mar 2014 13:26:03 -0500 >Subject: [PATCH] Make Koha::Database use C4::Context->dbh > >http://bugs.koha-community.org/show_bug.cgi?id=11634 >--- > Koha/Database.pm | 11 +---------- > Koha/Schema.pm | 2 +- > Koha/Storage.pm | 16 ++++++++++++++++ > 3 files changed, 18 insertions(+), 11 deletions(-) > create mode 100644 Koha/Storage.pm > >diff --git a/Koha/Database.pm b/Koha/Database.pm >index 12758bf..fa6518a 100644 >--- a/Koha/Database.pm >+++ b/Koha/Database.pm >@@ -46,16 +46,7 @@ __PACKAGE__->mk_accessors(qw( )); > # returns it. > sub _new_schema { > my $context = C4::Context->new(); >- my $db_driver = C4::Context::db_scheme2dbi($context->config("db_scheme")); >- >- my $db_name = $context->config("database"); >- my $db_host = $context->config("hostname"); >- my $db_port = $context->config("port") || ''; >- my $db_user = $context->config("user"); >- my $db_passwd = $context->config("pass"); >- my $schema = Koha::Schema->connect( >- "DBI:$db_driver:dbname=$db_name;host=$db_host;port=$db_port", >- $db_user, $db_passwd ); >+ my $schema = Koha::Schema->connect( sub { $context->dbh } ); > return $schema; > } > >diff --git a/Koha/Schema.pm b/Koha/Schema.pm >index cffc631..111855c 100644 >--- a/Koha/Schema.pm >+++ b/Koha/Schema.pm >@@ -15,6 +15,6 @@ __PACKAGE__->load_namespaces; > # Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 > # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oDUxXckmfk6H9YCjW8PZTw > >+__PACKAGE__->storage_type('Koha::Storage'); > >-# You can replace this text with custom content, and it will be preserved on regeneration > 1; >diff --git a/Koha/Storage.pm b/Koha/Storage.pm >new file mode 100644 >index 0000000..599b6a1 >--- /dev/null >+++ b/Koha/Storage.pm >@@ -0,0 +1,16 @@ >+use utf8; >+package Koha::Storage; >+ >+use strict; >+use warnings; >+ >+use base 'DBIx::Class::Storage::DBI'; >+sub DESTROY { >+ my $self = shift; >+ >+ # destroy just the object if not native to this process/thread >+ $self->_preserve_foreign_dbh; >+ >+ $self->_dbh(undef); >+} >+1; >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11634
:
24866
|
25032
|
25148
|
25822
|
25825
|
25826
|
25827
|
25837
|
28212
|
28213
|
28214
|
31706
|
31707
|
31708
|
31709
|
32034
|
32035
|
32036
|
32037
|
32875
|
32876
|
32877
|
32878
|
33492