Bugzilla – Attachment 46335 Details for
Bug 15477
Error handling on editing item type translations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15477: (follow-up) Bug 14100: Better errors handling
Bug-15477-follow-up-Bug-14100-Better-errors-handli.patch (text/plain), 2.76 KB, created by
Jonathan Druart
on 2016-01-06 16:24:06 UTC
(
hide
)
Description:
Bug 15477: (follow-up) Bug 14100: Better errors handling
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-01-06 16:24:06 UTC
Size:
2.76 KB
patch
obsolete
>From 25e29010c4afd23374865b6121c1bbe4310fe36c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 6 Jan 2016 11:17:00 +0000 >Subject: [PATCH] Bug 15477: (follow-up) Bug 14100: Better errors handling > >On bug 14100, the patch "Better errors handling" introduced an ... >error. >The user always get "An error occurred when updating this translation" >although it has been updated in DB. > >Test plan: >Edit translations for an item type: you should not get an error when >everything went fine. >--- > koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt | 8 +++++--- > svc/localization | 3 +++ > 2 files changed, 8 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt >index 2730a08..2d6e5b4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt >@@ -53,12 +53,14 @@ > type: 'PUT', > url: '/cgi-bin/koha/svc/localization', > success: function (data) { >- if ( data.is_changed ) { >+ if ( data.error ) { >+ $(cell).css('background-color', '#FF0000'); >+ show_message({ type: 'error_on_update', data: data }); >+ } else if ( data.is_changed == 1 ) { > $(cell).css('background-color', '#00FF00'); > show_message({ type: 'success_on_update', data: data }); >- } else { >- show_message({ type: 'error_on_update', data: data }); > } >+ > if ( $(cell).hasClass('lang') ) { > $(cell).text(data.lang) > } else if ( $(cell).hasClass('translation') ) { >diff --git a/svc/localization b/svc/localization >index 2bf3c69..95b1d28 100755 >--- a/svc/localization >+++ b/svc/localization >@@ -37,7 +37,9 @@ sub update_translation { > $localization->translation( $translation ) > } > my %params; >+ my $is_changed; > if ( $localization->is_changed ) { >+ $is_changed = 1; > unless ( Koha::Localizations->search( { entity => $localization->entity, code => $localization->code, lang => $lang, localization_id => { '!=' => $localization->localization_id }, } )->count ) { > $localization->store; > } else { >@@ -52,6 +54,7 @@ sub update_translation { > code => Encode::encode('utf-8', $localization->code), > lang => Encode::encode('utf-8', $localization->lang), > translation => Encode::encode('utf-8', $localization->translation), >+ is_changed => $is_changed, > ); > C4::Service->return_success( $response ); > } >-- >2.1.0
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 15477
:
46315
|
46335
|
46336
|
46384
|
46390
|
46408