[Rt-commit] r2943 - in DBIx-SearchBuilder/trunk: . SearchBuilder
glasser at bestpractical.com
glasser at bestpractical.com
Tue May 24 13:06:49 EDT 2005
Author: glasser
Date: Tue May 24 13:06:49 2005
New Revision: 2943
Modified:
DBIx-SearchBuilder/trunk/ (props changed)
DBIx-SearchBuilder/trunk/SearchBuilder/Handle.pm
Log:
r32881 at tin-foil: glasser | 2005-05-24 11:41:40 -0400
Fix from Ruslan to the reblessing code.
Modified: DBIx-SearchBuilder/trunk/SearchBuilder/Handle.pm
==============================================================================
--- DBIx-SearchBuilder/trunk/SearchBuilder/Handle.pm (original)
+++ DBIx-SearchBuilder/trunk/SearchBuilder/Handle.pm Tue May 24 13:06:49 2005
@@ -92,11 +92,19 @@
DisconnectHandleOnDestroy => undef,
@_);
+ if( $args{'Driver'} && !$self->isa( 'DBIx::SearchBuilder::Handle::'. $args{'Driver'} ) ) {
+ if ( $self->_UpgradeHandle($args{Driver}) ) {
+ return ($self->Connect( %args ));
+ }
+ }
+
+
my $dsn = $self->DSN || '';
# Setting this actually breaks old RT versions in subtle ways. So we need to explicitly call it
$self->{'DisconnectHandleOnDestroy'} = $args{'DisconnectHandleOnDestroy'};
+
$self->BuildDSN(%args);
@@ -111,8 +119,6 @@
#Set the handle
$self->dbh($handle);
- $self->_UpgradeHandle($args{Driver}) if ref($self) eq 'DBIx::SearchBuilder::Handle';
-
return (1);
}
@@ -132,7 +138,6 @@
sub _UpgradeHandle {
my $self = shift;
- return unless ref($self) eq 'DBIx::SearchBuilder::Handle';
my $driver = shift;
my $class = 'DBIx::SearchBuilder::Handle::' . $driver;
@@ -140,7 +145,7 @@
return if $@;
bless $self, $class;
- return;
+ return 1;
}
# }}}
More information about the Rt-commit
mailing list