we no longer use position; stop breaking relationship adding
Tara L Andrews [Wed, 21 Dec 2011 19:39:41 +0000 (20:39 +0100)]
lib/Text/Tradition/Collation/Relationship.pm
lib/Text/Tradition/Parser/Self.pm

index 14e00fb..c2ad3ae 100644 (file)
@@ -82,11 +82,6 @@ sub BUILD {
 
     $self->set_attribute( 'class', 'relationship' );
 
-    my( $source, $target ) = @{$self->this_relation};
-    if( $source->has_position && $target->has_position ) {
-       # Harmonize the positions.
-       $source->match_position( $target );
-    }
     unless( $self->primary_relation ) {
        $self->primary_relation( [ $self->this_relation->[0]->label,
                                   $self->this_relation->[1]->label ] );
index 895ca4d..a34c9f5 100644 (file)
@@ -201,7 +201,10 @@ sub parse {
                $opts->{'non_independent'} = $e->{'non_independent'} 
                        if exists $e->{'non_independent'};
                warn "No relationship type for relationship edge!" unless $opts->{'type'};
-               $collation->add_relationship( $from->{$IDKEY}, $to->{$IDKEY}, $opts );
+               my( $ok, @result ) = $collation->add_relationship( $from->{$IDKEY}, $to->{$IDKEY}, $opts );
+               unless( $ok ) {
+                       warn "Did not add relationship: @result";
+               }
         } 
     }