Bugzilla – Attachment 108378 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.25 KB, created by
David Cook
on 2020-08-17 00:34:52 UTC
(
hide
)
Description:
Bug 25384: Use dclone when copying font lookup hash
Filename:
MIME Type:
Creator:
David Cook
Created:
2020-08-17 00:34:52 UTC
Size:
2.25 KB
patch
obsolete
>From 94ea476cf68c75767ffd39efb7aa4a285308bd6b 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. >--- > 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 068e5e7df3..9955b55d0d 100644 >--- a/C4/Creators/Lib.pm >+++ b/C4/Creators/Lib.pm >@@ -445,14 +445,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}, }; > } > } > } >@@ -460,15 +460,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.11.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 25384
:
104390
|
104505
|
108377
|
108378
|
160390
|
160391