@@ -, +, @@ - select an existing comment on a subscription - check the logs, note the error (Can't return outside a subroutine) - apply this patch - select an existing comment again - error should be gone --- koha-tmpl/intranet-tmpl/prog/js/mana.js | 23 +++++++++++------------ svc/mana/increment | 2 +- 2 files changed, 12 insertions(+), 13 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/js/mana.js +++ a/koha-tmpl/intranet-tmpl/prog/js/mana.js @@ -3,20 +3,19 @@ function mana_increment(mana_id, resource, fieldvalue, stepvalue ) { $("#mana_comment_progress").show(); if( !stepvalue ){ stepvalue = 1; } - $.ajax({ - type: "POST", - url: "/cgi-bin/koha/svc/mana/increment", - data: {id: mana_id, resource: resource, field: fieldvalue, step: stepvalue}, - datatype: "json", - }) - .done(function() { - $(".mana_comment_status").hide(); - $("#mana_comment_success").show(); + $.ajax({ + type: "POST", + url: "/cgi-bin/koha/svc/mana/increment", + data: {id: mana_id, resource: resource, field: fieldvalue, step: stepvalue}, + dataType: "json", }) - .fail(function( error ) { + .done(function( data ) { $(".mana_comment_status").hide(); - $("#mana_comment_errortext").html( error.status + " " + error.statusText ); - $("#mana_comment_failed").show(); + if ( data.code == "200" ) { + $("#mana_comment_success").show(); + } else { + $("#mana_comment_failed").show(); + } }) .always(function() { mana_comment_close(); --- a/svc/mana/increment +++ a/svc/mana/increment @@ -45,4 +45,4 @@ my $result = Koha::SharedContent::increment_entity_value( scalar $input->param('step') ); -return $result; +print(to_json($result)); --