foreach my $p ( keys %{$c->request->params} ) {
if( $p =~ /^morphology_(\d+)$/ ) {
# Set the form on the correct lexeme
+ my $morphval = $c->request->param( $p );
+ next unless $morphval;
my $midx = $1;
- $c->log->debug( "Fetching lexeme $midx" );
my $lx = $rdg->lexeme( $midx );
- my $strrep = $rdg->language . ' // '
- . $c->request->param( $p );
+ my $strrep = $rdg->language . ' // ' . $morphval;
my $idx = $lx->has_form( $strrep );
unless( defined $idx ) {
# Make the word form and add it to the lexeme.
- $c->log->debug("Adding new form for $strrep");
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;
}
&& ajaxSettings.type == 'POST' && jqXHR.status == 403 ) {
var errobj = jQuery.parseJSON( jqXHR.responseText );
$('#status').append( '<p class="error">Error: ' + errobj.error + '</br>The relationship cannot be made.</p>' );
- $(event.target).parent().find('.ui-button').button("enable");
}
+ $(event.target).parent().find('.ui-button').button("enable");
} );
$( "#delete-form" ).dialog({
&& ajaxSettings.type == 'POST' && jqXHR.status == 403 ) {
var errobj = jQuery.parseJSON( jqXHR.responseText );
$('#reading_status').append( '<p class="error">Error: ' + errobj.error + '</p>' );
- $(event.target).parent().find('.ui-button').button("enable");
}
+ $(event.target).parent().find('.ui-button').button("enable");
});