Bugzilla – Attachment 160391 Details for
Bug 25384
Label maker font list is not configurable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25384: Use dclone when copying font lookup hash
Bug-25384-Use-dclone-when-copying-font-lookup-hash.patch (text/plain), 2.30 KB, created by
David Nind
on 2024-01-01 23:38:18 UTC
(
hide
)
Description:
Bug 25384: Use dclone when copying font lookup hash
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-01-01 23:38:18 UTC
Size:
2.30 KB
patch
obsolete
>From ab59cbba60790c06976d7d3eb0858e7dbf3ef9e7 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Mon, 17 Aug 2020 00:31:34 +0000 >Subject: [PATCH] Bug 25384: Use dclone when copying font lookup hash > >This patch includes the logic from Bug 25852. That is, >use dclone to copy the hash used as the font lookup. > >While the original patch perfectly copied the top level >keys, the next level down were hash references (due to Perl's >inherent hash design), and changes to the 2nd level of depth >would be changes to these references which would impact >the original hash. > >Signed-off-by: David Nind <david@davidnind.com> >--- > C4/Creators/Lib.pm | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > >diff --git a/C4/Creators/Lib.pm b/C4/Creators/Lib.pm >index f5ccd5aaaf..239bd16495 100644 >--- a/C4/Creators/Lib.pm >+++ b/C4/Creators/Lib.pm >@@ -443,14 +443,14 @@ This function returns a reference to an array of hashes containing all font type > > sub get_font_types { > my @available_fonts = (); >- my %available_font_lookup = %default_font_types; >+ my $available_font_lookup = dclone(\%default_font_types); > > #Add new fonts or rename default fonts > my $ttf = C4::Context->config('ttf'); > if ($ttf && $ttf->{font} && ref $ttf->{font} eq 'ARRAY'){ > foreach my $font ( @{$ttf->{font}} ){ > if ($font->{type} && $font->{name} && $font->{content}){ >- $available_font_lookup{ $font->{type} } = { name => $font->{name}, }; >+ $available_font_lookup->{ $font->{type} } = { name => $font->{name}, }; > } > } > } >@@ -458,15 +458,15 @@ sub get_font_types { > #Output default font types first (in default order) > _use_font({ > font_types => \@default_font_type_codes, >- font_lookup => \%available_font_lookup, >+ font_lookup => $available_font_lookup, > available_fonts => \@available_fonts, > }); > > #Output configured font types last (in alphabetical order) >- my @remaining_types = sort keys %available_font_lookup; >+ my @remaining_types = sort keys %$available_font_lookup; > _use_font({ > font_types => \@remaining_types, >- font_lookup => \%available_font_lookup, >+ font_lookup => $available_font_lookup, > available_fonts => \@available_fonts, > }); > >-- >2.30.2
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 25384
:
104390
|
104505
|
108377
|
108378
|
160390
| 160391