From dfae6286760f90eec22d236d57014f68149161ad Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 16 Aug 2009 03:13:58 +0100 Subject: [PATCH] Fix new textstring indirection --- yarrg/web/qtextstringcheck | 6 ------ yarrg/web/query_route | 8 ++++---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/yarrg/web/qtextstringcheck b/yarrg/web/qtextstringcheck index 4196018..4018455 100644 --- a/yarrg/web/qtextstringcheck +++ b/yarrg/web/qtextstringcheck @@ -59,12 +59,6 @@ if ($format =~ /json/) { }; print to_json_shim($jobj); } -if ($format =~ /return/) { - return { - Error => $emsg, - Results => length $emsg ? $results : undef - }; -} if ($format =~ /dump/) { $r->content_type('text/plain'); print Dumper($emsg, $canontext, $results); diff --git a/yarrg/web/query_route b/yarrg/web/query_route index b91e55c..dc1ebc9 100644 --- a/yarrg/web/query_route +++ b/yarrg/web/query_route @@ -168,15 +168,15 @@ $results_head= sub { if (!$qa->{Dropdowns}) { if (length $routestring) { $results_head->(); - my $rsr= $m->comp('routetextstring', + my ($emsg,$canonstring,$results)= $m->comp('check_routestring', ocean => $qa->{Ocean}, string => $routestring, format => 'return' ); - if (length $rsr->{Error}) { - print encode_entities($rsr->{Error}); + if (length $emsg) { + print encode_entities($emsg); } else { - foreach my $entry (@{ $rsr->{Results} }) { + foreach my $entry (@$results) { push @archipelagoes, defined $entry->[1] ? undef : $entry->[0]; push @islandids, $entry->[1]; -- 2.30.2