Hide error when merging a new item
[scpubgit/stemmaweb.git] / lib / stemmaweb / Controller / Root.pm
index 11e54af..66a0d92 100644 (file)
@@ -123,12 +123,15 @@ sub newtradition :Local :Args(0) {
        my $name = $c->request->param('name') || 'Uploaded tradition';
        my $lang = $c->request->param( 'language' ) || 'Default';
        my $public = $c->request->param( 'public' ) ? 1 : undef;
+       my $direction = $c->request->param('direction') || 'LR';
+
        my( $ext ) = $upload->filename =~ /\.(\w+)$/;
        my %newopts = (
                'name' => $name,
                'language' => $lang,
                'public' => $public,
-               'file' => $upload->tempname
+               'file' => $upload->tempname,
+               'direction' => $direction,
                );
 
        my $tradition;
@@ -449,7 +452,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');
        }
 }