bugfix for returning edited stemma
[scpubgit/stemmaweb.git] / lib / stemmaweb / Controller / Root.pm
index c772122..7159680 100644 (file)
@@ -317,6 +317,10 @@ sub textinfo :Local :Args(1) {
                public => $tradition->public || 0,
                owner => $tradition->user ? $tradition->user->email : undef,
                witnesses => [ map { $_->sigil } $tradition->witnesses ],
+               # TODO Send them all with appropriate parameters so that the
+               # client side can choose what to display.
+               reltypes => [ map { $_->name } grep { !$_->is_weak && $_->is_colocation }
+                       $tradition->collation->relationship_types ]
        };
        ## TODO Make these into callbacks in the other controllers maybe?
        if( $tradition->can('language') ) {
@@ -445,7 +449,7 @@ sub stemma :Local :Args(2) {
                $c->stash->{'result'} = $stemma->as_svg();
                $c->forward('View::SVG');
        } else { # JSON
-               $c->stash->{'result'} = { _stemma_info( $stemma, $stemmaid ) };
+               $c->stash->{'result'} = _stemma_info( $stemma, $stemmaid );
                $c->forward('View::JSON');
        }
 }