From: Peter Rabbitson Date: Wed, 24 Jun 2015 11:04:28 +0000 (+0200) Subject: Remove no longer needed try{} block in related rel instantiation X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=00ba5e6ecf1a6a550b31c913c674cd0cf8f2f879;p=dbsrgits%2FDBIx-Class.git Remove no longer needed try{} block in related rel instantiation This try{} is no longer necessary after 3b4c4d72, but was missed due its function not being readily apparent. The only known case where this exception could be raised and be silenced is if an uninserted object had some filter relations populated directly via {_inflated_column} *before* related_resultset() has ever been called. This would result in a cascade of failures during the relationship resolution, and bubble up here. Starting with 3b4c4d72 the empty related resultset is instantiated ahead of time, and everything works properly from there on. In the unlikely case this does cause issues downstream, a way will be found to address this ( worst case scenario by reintroducing the try{} ) --- diff --git a/lib/DBIx/Class/Relationship/Base.pm b/lib/DBIx/Class/Relationship/Base.pm index 1587403..c7daf57 100644 --- a/lib/DBIx/Class/Relationship/Base.pm +++ b/lib/DBIx/Class/Relationship/Base.pm @@ -523,15 +523,7 @@ sub related_resultset { if (@_ > 1 && (@_ % 2 == 1)); my $query = ((@_ > 1) ? {@_} : shift); - # condition resolution may fail if an incomplete master-object prefetch - # is encountered - that is ok during prefetch construction (not yet in_storage) - my ($cond, $is_crosstable) = try { - $rsrc->_resolve_condition( $rel_info->{cond}, $rel, $self, $rel ) - } - catch { - $self->throw_exception ($_) if $self->in_storage; - UNRESOLVABLE_CONDITION; # RV, no return() - }; + my ($cond, $is_crosstable) = $rsrc->_resolve_condition( $rel_info->{cond}, $rel, $self, $rel ); # keep in mind that the following if() block is part of a do{} - no return()s!!! if ($is_crosstable and ref $rel_info->{cond} eq 'CODE') {