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?p=scpubgit%2Fstemmatology.git;a=commitdiff_plain;h=a1411d50483bfd6cc561d7f8d81941cd6d6f61a9 better handling for errors, don't send filler text to server --- diff --git a/stemmaweb/lib/stemmaweb/Controller/Relation.pm b/stemmaweb/lib/stemmaweb/Controller/Relation.pm index bd7d527..0842124 100644 --- a/stemmaweb/lib/stemmaweb/Controller/Relation.pm +++ b/stemmaweb/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/stemmaweb/root/js/relationship.js b/stemmaweb/root/js/relationship.js index a2b242d..cd3d867 100644 --- a/stemmaweb/root/js/relationship.js +++ b/stemmaweb/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();