handle lack of source_name in join tagging code
Matt S Trout [Mon, 16 Apr 2012 16:52:54 +0000 (16:52 +0000)]
lib/DBIx/Class/Storage/DBIHacks.pm

index f71e0ef..656c659 100644 (file)
@@ -287,9 +287,11 @@ sub _resolve_aliastypes_from_select_args {
       unless $from_dq->{right}{type} eq DQ_ALIAS;
     push @alias_dq, $from_dq->{right};
     $join_dq{$from_dq->{right}} = $from_dq;
-    my @columns = $schema->source($from_dq->{right}{'dbix-class.source_name'})
-                         ->columns;
-    @col_map{@columns} = ($from_dq->{right}{to}) x @columns;
+    if (my $source_name = $from_dq->{right}{'dbix-class.source_name'}) {
+      my @columns = $schema->source($source_name)
+                           ->columns;
+      @col_map{@columns} = ($from_dq->{right}{to}) x @columns;
+    }
     $from_dq = $from_dq->{left};
   }
   die "Don't understand this from"