From: Tara L Andrews Date: Sun, 24 Jun 2012 11:53:34 +0000 (+0200) Subject: better handling for errors, don't send filler text to server X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=465848bc527d0c75768926e7efc3fc8b89e8a7ac;p=scpubgit%2Fstemmaweb.git better handling for errors, don't send filler text to server --- diff --git a/lib/stemmaweb/Controller/Relation.pm b/lib/stemmaweb/Controller/Relation.pm index bd7d527..0842124 100644 --- a/lib/stemmaweb/Controller/Relation.pm +++ b/lib/stemmaweb/Controller/Relation.pm @@ -324,9 +324,12 @@ sub reading :Chained('text') :PathPart :Args(1) { try { $idx = $lx->add_matching_form( $strrep ) - 1; } catch( Text::Tradition::Error $e ) { - # TODO catch other errors e.g. Moose ones $c->response->status( '403' ); $errmsg = $e->message; + } catch { + # Something else went wrong, probably a Moose error + $c->response->status( '403' ); + $errmsg = 'Something went wrong with the request'; } } $lx->disambiguate( $idx ) if defined $idx; diff --git a/root/js/relationship.js b/root/js/relationship.js index a2b242d..cd3d867 100644 --- a/root/js/relationship.js +++ b/root/js/relationship.js @@ -772,9 +772,11 @@ $(document).ready(function () { 'normal_form': $('#reading_normal_form').val() }; // Add the morphology values $('.reading_morphology').each( function() { - var rmid = $(this).attr('id'); - rmid = rmid.substring(8); - form_values[rmid] = $(this).val(); + if( $(this).val() != '(Click to select)' ) { + var rmid = $(this).attr('id'); + rmid = rmid.substring(8); + form_values[rmid] = $(this).val(); + } }); // Make the JSON call ncpath = getReadingURL( reading_id ); @@ -803,6 +805,7 @@ $(document).ready(function () { $("#dialog_overlay").height( $("#enlargement_container").height() ); $("#dialog_overlay").width( $("#enlargement_container").innerWidth() ); $("#dialog_overlay").offset( $("#enlargement_container").offset() ); + $("#reading-form").parent().find('.ui-button').button("enable"); }, close: function() { $("#dialog_overlay").hide();