Bugzilla – Attachment 90413 Details for
Bug 22248
Error when incrementing Mana comment
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22248: make svc/mana/increment print valid output
Bug-22248-make-svcmanaincrement-print-valid-output.patch (text/plain), 2.32 KB, created by
Alex Arnaud
on 2019-06-07 10:34:40 UTC
(
hide
)
Description:
Bug 22248: make svc/mana/increment print valid output
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2019-06-07 10:34:40 UTC
Size:
2.32 KB
patch
obsolete
>From d1fe280b8a292de0dff1980b110ef75a3b324060 Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Fri, 7 Jun 2019 12:33:12 +0200 >Subject: [PATCH] Bug 22248: make svc/mana/increment print valid output > >Test plan: > - 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(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/mana.js b/koha-tmpl/intranet-tmpl/prog/js/mana.js >index c36faec..d16fbbe 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/mana.js >+++ b/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(); >diff --git a/svc/mana/increment b/svc/mana/increment >index 5b58496..9cb7824 100755 >--- a/svc/mana/increment >+++ b/svc/mana/increment >@@ -45,4 +45,4 @@ my $result = Koha::SharedContent::increment_entity_value( > scalar $input->param('step') > ); > >-return $result; >+print(to_json($result)); >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22248
: 90413