Bugzilla – Attachment 128675 Details for
Bug 29684
Warning File not found: js/locale_data.js
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29684: fix warn about not found file js/locale_data.js
Bug-29684-fix-warn-about-not-found-file-jslocaleda.patch (text/plain), 3.10 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-12-17 14:55:33 UTC
(
hide
)
Description:
Bug 29684: fix warn about not found file js/locale_data.js
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-12-17 14:55:33 UTC
Size:
3.10 KB
patch
obsolete
>From 439537b295cb416a05f89300c06cdf2493033e54 Mon Sep 17 00:00:00 2001 >From: Petro Vashchuk <stalkernoid@gmail.com> >Date: Wed, 15 Dec 2021 16:49:15 +0200 >Subject: [PATCH] Bug 29684: fix warn about not found file js/locale_data.js > >Value of 'lang' unexpectedly was set to 'default', to prevent it, >the feature was added to detect 'lang' getting overlaid in template and >prevent + warn the developer about it. > >To reproduce (memberentry.pl): >1) Head over to the patron details page, press edit button to open the >memberentry.pl page. >2) The error message should have appeared in your log file about >"File not found : default/js/locale_data.js". >3) Apply the patch. >4) Open the edit page again, ensure that the new error massage like >that didn't appear. > >To reproduce (paycollect.pl): >1) Prepare or use some existing patron with outstanding fines, go to >the accounting section and open page where you make payment towards all >fines. >2) The error message should have appeared in your log file about >"File not found : default/js/locale_data.js". >3) Apply the patch. >4) Open the edit page again, ensure that the new error massage like >that didn't appear. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > C4/Templates.pm | 7 +++++++ > members/memberentry.pl | 4 ++++ > members/paycollect.pl | 3 +++ > 3 files changed, 14 insertions(+) > >diff --git a/C4/Templates.pm b/C4/Templates.pm >index d41c9b534e..0d1be549d5 100644 >--- a/C4/Templates.pm >+++ b/C4/Templates.pm >@@ -113,6 +113,13 @@ sub output { > $vars->{opaclayoutstylesheet} = > C4::Context->preference('opaclayoutstylesheet'); > >+ >+ if(exists $self->{VARS}{lang}) { >+ warn "Preventing \$template->lang='" . ($self->{vars}{lang}//'-undef-') >+ . "' to be overwritten by template->{VARS}{lang}='" . ($self->{VARS}{lang}//'-undef-') . "'"; >+ delete $self->{VARS}{lang}; >+ } >+ > # add variables set via param to $vars for processing > $vars = { %$vars, %{ $self->{VARS} } }; > >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 38f2a2b149..b4fae040cb 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -813,6 +813,10 @@ if (C4::Context->preference('EnhancedMessagingPreferences')) { > } > > $template->param( "show_guarantor" => ( $category_type =~ /A|I|S|X/ ) ? 0 : 1 ); # associate with step to know where you are >+ >+# we should remove 'lang' from borrower data otherwise it overlays Template's lang variable: >+delete $data{lang}; >+ > $template->param(%data); > $template->param( "step_$step" => 1) if $step; # associate with step to know where u are > $template->param( step => $step ) if $step; # associate with step to know where u are >diff --git a/members/paycollect.pl b/members/paycollect.pl >index d5cbd60bfc..a6eab11ab9 100755 >--- a/members/paycollect.pl >+++ b/members/paycollect.pl >@@ -239,6 +239,9 @@ if ( $total_paid and $total_paid ne '0.00' ) { > $total_paid = '0.00'; #TODO not right with pay_individual > } > >+# we should remove 'lang' from borrower data otherwise it overlays Template's lang variable: >+delete $borrower->{lang}; >+ > $template->param(%$borrower); > > if ( $input->param('error_over') ) { >-- >2.32.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 29684
:
128571
|
128675
|
129532
|
129534
|
129536
|
130184
|
130185
|
130186
|
130210
|
130211
|
130212
|
130413
|
130417
|
130421
|
130477
|
131510
|
131511
|
131512
|
131513
|
131514
|
131515