[Bast-commits] r8749 -
DBIx-Class/0.08/branches/pri_key_refactor/lib/DBIx/Class/Relationship
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Fri Feb 19 09:07:40 GMT 2010
Author: ribasushi
Date: 2010-02-19 09:07:40 +0000 (Fri, 19 Feb 2010)
New Revision: 8749
Modified:
DBIx-Class/0.08/branches/pri_key_refactor/lib/DBIx/Class/Relationship/Base.pm
Log:
trap unresolvable conditions due to incomplete relationship specification
Modified: DBIx-Class/0.08/branches/pri_key_refactor/lib/DBIx/Class/Relationship/Base.pm
===================================================================
--- DBIx-Class/0.08/branches/pri_key_refactor/lib/DBIx/Class/Relationship/Base.pm 2010-02-18 23:35:01 UTC (rev 8748)
+++ DBIx-Class/0.08/branches/pri_key_refactor/lib/DBIx/Class/Relationship/Base.pm 2010-02-19 09:07:40 UTC (rev 8749)
@@ -200,9 +200,15 @@
my $query = ((@_ > 1) ? {@_} : shift);
my $source = $self->result_source;
- my $cond = $source->_resolve_condition(
- $rel_info->{cond}, $rel, $self
- );
+
+ # condition resolution may fail if an incomplete master-object prefetch
+ # is encountered
+ my $cond =
+ eval { $source->_resolve_condition( $rel_info->{cond}, $rel, $self ) }
+ ||
+ $DBIx::Class::ResultSource::UNRESOLVABLE_CONDITION
+ ;
+
if ($cond eq $DBIx::Class::ResultSource::UNRESOLVABLE_CONDITION) {
my $reverse = $source->reverse_relationship_info($rel);
foreach my $rev_rel (keys %$reverse) {
More information about the Bast-commits
mailing list