Bugzilla – Attachment 148396 Details for
Bug 32775
Ordering when there are multiple languages within a language group is wrong
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32775: (QA follow-up) Fix tab and indenting issues
Bug-32775-QA-follow-up-Fix-tab-and-indenting-issue.patch (text/plain), 2.98 KB, created by
Fridolin Somers
on 2023-03-18 03:00:55 UTC
(
hide
)
Description:
Bug 32775: (QA follow-up) Fix tab and indenting issues
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2023-03-18 03:00:55 UTC
Size:
2.98 KB
patch
obsolete
>From 064def640d1bdf2139abc024780820f406f2c257 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 2 Feb 2023 12:44:44 +0000 >Subject: [PATCH] Bug 32775: (QA follow-up) Fix tab and indenting issues > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> >--- > C4/Languages.pm | 50 ++++++++++++++++++++++++++----------------------- > 1 file changed, 27 insertions(+), 23 deletions(-) > >diff --git a/C4/Languages.pm b/C4/Languages.pm >index 562050e331..827b514912 100644 >--- a/C4/Languages.pm >+++ b/C4/Languages.pm >@@ -371,33 +371,37 @@ sub _build_languages_arrayref { > > my %idx = map { $enabled_languages->[$_] => $_ } reverse 0 .. @$enabled_languages-1; > my @ordered_keys = sort { >- my $aa = ''; >- my $bb = ''; >- my $acount = @{$language_groups->{$a}}; >- my $bcount = @{$language_groups->{$b}}; >- if ( $language_groups->{$a}->[0]->{enabled} ) { >+ my $aa = ''; >+ my $bb = ''; >+ my $acount = @{ $language_groups->{$a} }; >+ my $bcount = @{ $language_groups->{$b} }; >+ if ( $language_groups->{$a}->[0]->{enabled} ) { > $aa = $language_groups->{$a}->[0]->{rfc4646_subtag}; >- } elsif ( $acount > 1 ) { >- for ( my $i=1;$i<$acount;$i++ ) { >+ } >+ elsif ( $acount > 1 ) { >+ for ( my $i = 1 ; $i < $acount ; $i++ ) { > if ( $language_groups->{$a}->[$i]->{enabled} ) { >- $aa = $language_groups->{$a}->[$i]->{rfc4646_subtag}; >- last; >- } >- } >- } >- if ( $language_groups->{$b}->[0]->{enabled} ) { >+ $aa = $language_groups->{$a}->[$i]->{rfc4646_subtag}; >+ last; >+ } >+ } >+ } >+ if ( $language_groups->{$b}->[0]->{enabled} ) { > $bb = $language_groups->{$b}->[0]->{rfc4646_subtag}; >- } elsif ( $bcount > 1 ) { >- for ( my $i=1;$i<$bcount;$i++ ) { >- if ($language_groups->{$b}->[$i]->{enabled} ) { >+ } >+ elsif ( $bcount > 1 ) { >+ for ( my $i = 1 ; $i < $bcount ; $i++ ) { >+ if ( $language_groups->{$b}->[$i]->{enabled} ) { > $bb = $language_groups->{$b}->[$i]->{rfc4646_subtag}; >- last; >- } >- } >- } >- ( exists $idx{$aa} and exists $idx{$bb} and ( $idx{$aa} cmp $idx{$bb} ) ) >- || ( exists $idx{$aa} and exists $idx{$bb} ) >- || exists $idx{$bb} >+ last; >+ } >+ } >+ } >+ ( exists $idx{$aa} >+ and exists $idx{$bb} >+ and ( $idx{$aa} cmp $idx{$bb} ) ) >+ || ( exists $idx{$aa} and exists $idx{$bb} ) >+ || exists $idx{$bb} > } keys %$language_groups; > > for my $key ( @ordered_keys ) { >-- >2.39.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 32775
:
145918
|
145919
|
145983
|
145984
|
145996
|
145997
|
145998
|
146194
|
146195
|
146196
|
146569
|
146570
|
146571
|
146572
|
146573
|
146574
|
146575
|
146576
|
148392
|
148393
|
148394
|
148395
| 148396 |
148397