Bugzilla – Attachment 166535 Details for
Bug 36815
Add the option to 'Reset to default' in the notices editor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36815: (follow-up) Fix logic for new languages
Bug-36815-follow-up-Fix-logic-for-new-languages.patch (text/plain), 1.67 KB, created by
Martin Renvoize (ashimema)
on 2024-05-10 12:17:11 UTC
(
hide
)
Description:
Bug 36815: (follow-up) Fix logic for new languages
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-05-10 12:17:11 UTC
Size:
1.67 KB
patch
obsolete
>From 6cc9dd50997753e1ce44937b111d893e4ba13202 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 10 May 2024 13:15:39 +0100 >Subject: [PATCH] Bug 36815: (follow-up) Fix logic for new languages > >If a notice doesn't already have any data in it we weren't able to use >the object to lookup the sample.. with this patch we now always load the >samples if they exist for each installed and enabled language, >regardless of whether there's already a notice stored in that language. >--- > tools/letter.pl | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > >diff --git a/tools/letter.pl b/tools/letter.pl >index dbe84aa26cb..24c434cd5d5 100755 >--- a/tools/letter.pl >+++ b/tools/letter.pl >@@ -227,10 +227,16 @@ sub add_form { > tt_error => $letter->{tt_error}, > }; > $letters{ $lang }{params} = $letter; >+ } > >- my $object = Koha::Notice::Templates->find( { id => $letter->{id} } ); >- $letters{ $lang }{templates}{$mtt}{sample} = $object->get_default; >- $letters{ $lang }{templates}{$mtt}{id} = $letter->{id}; >+ # Fetch sample notices >+ while (my ($lang_key, $lang_value) = each %letters) { >+ while (my ($mtt_key, $mtt_value) = each %{ $lang_value->{templates} }) { >+ my $object = Koha::Notice::Template->new( >+ { module => $module, code => $code, message_transport_type => $mtt_key, lang => $lang_key } ); >+ $mtt_value->{sample} = $object->get_default; >+ $mtt_value->{id} = lc("$module" . "_" . $code . "_" . $mtt_key . "_" . $lang_key); >+ } > } > } > else { >-- >2.45.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 36815
:
166429
|
166430
|
166449
|
166450
|
166475
|
166476
|
166535
|
166678
|
166679
|
166680
|
166684
|
166685
|
166686
|
166689
|
166693
|
166694
|
166695
|
166696
|
166763
|
166764
|
166765
|
166766
|
168190
|
168191
|
168192
|
168193
|
168194