check for relationship before collating
Tara L Andrews [Fri, 20 Apr 2012 17:13:35 +0000 (19:13 +0200)]
lib/Text/Tradition/Collation/RelationshipStore.pm

index 314d003..3024f20 100644 (file)
@@ -605,7 +605,8 @@ sub filter_collations {
                        $c->relations->_drop_collations( "$rdg" );
                }
                $anchor
-                       ? map { $c->add_relationship( $anchor, $_, { 'type' => 'collated' } ) } @need_collations
+                       ? map { $c->add_relationship( $anchor, $_, { 'type' => 'collated' } )
+                                               unless $c->get_relationship( $anchor, $_ ) } @need_collations
                        : warn "No anchor found at $r";
        }
 }