Bugzilla – Attachment 35159 Details for
Bug 12375
Store serials enumeration data in separate fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12375 [5] [QA Followup] - Don't assume X Y and Z are used in order
Bug-12375-5-QA-Followup---Dont-assume-X-Y-and-Z-ar.patch (text/plain), 3.04 KB, created by
Kyle M Hall (khall)
on 2015-01-13 13:49:51 UTC
(
hide
)
Description:
Bug 12375 [5] [QA Followup] - Don't assume X Y and Z are used in order
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-01-13 13:49:51 UTC
Size:
3.04 KB
patch
obsolete
>From 9b99aeb17c95947e9d75455438cbc8986f282025 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 21 Jul 2014 09:55:02 -0400 >Subject: [PATCH] Bug 12375 [5] [QA Followup] - Don't assume X Y and Z are used in order > >--- > installer/data/mysql/updatedatabase.pl | 31 +++++++++++++++++++++++-------- > 1 files changed, 23 insertions(+), 8 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 6d2c568..5966745 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -9672,7 +9672,17 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { > foreach my $subscription (@subscriptions) { > my $number_pattern = $subscription->numberpattern(); > >- my @splits = split( /\{[XYZ]\}/, $number_pattern->numberingmethod() ); >+ my $numbering_method = $number_pattern->numberingmethod(); >+ # Get all the data between the enumeration values, we need >+ # to split each enumeration string based on these values. >+ my @splits = split( /\{[XYZ]\}/, $numbering_method ); >+ # Get the order in which the X Y and Z values are used >+ my %indexes; >+ foreach my $i (qw(X Y Z)) { >+ $indexes{$i} = index( $numbering_method, "{$i}" ); >+ delete $indexes{$i} if $indexes{$i} == -1; >+ } >+ my @indexes = sort { $indexes{$a} <=> $indexes{$b} } keys(%indexes); > > my @serials = > $schema->resultset('Serial') >@@ -9680,24 +9690,29 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { > > foreach my $serial (@serials) { > my $serialseq = $serial->serialseq(); >- my ( $x, $y, $z ); >+ my %enumeration_data; > > ## We cannot split on multiple values at once, > ## so let's replace each of those values with __SPLIT__ > if (@splits) { > map( $serialseq =~ s/$_/__SPLIT__/, @splits ); >- ( undef, $x, $y, $z ) = split( /__SPLIT__/, $serialseq ); >+ ( >+ undef, >+ $enumeration_data{ $indexes[0] }, >+ $enumeration_data{ $indexes[1] }, >+ $enumeration_data{ $indexes[2] } >+ ) = split( /__SPLIT__/, $serialseq ); > } > else >- { ## Nothing to split on means the only thing in serialseq is {X} >- $x = $serialseq; >+ { ## Nothing to split on means the only thing in serialseq is a single placeholder e.g. {X} >+ $enumeration_data{ $indexes[0] } = $serialseq; > } > > $serial->update( > { >- serialseq_x => $x, >- serialseq_y => $y, >- serialseq_z => $z, >+ serialseq_x => $enumeration_data{'X'}, >+ serialseq_y => $enumeration_data{'Y'}, >+ serialseq_z => $enumeration_data{'Z'}, > } > ); > } >-- >1.7.2.5
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 12375
:
28675
|
28676
|
28677
|
28678
|
28679
|
28680
|
28681
|
28682
|
28683
|
28843
|
28844
|
28845
|
28846
|
29928
|
29929
|
30099
|
30100
|
30101
|
30102
|
30103
|
30104
|
30108
|
35155
|
35156
|
35157
|
35158
|
35159
|
35160
|
35161
|
40710
|
40711
|
40712
|
40713
|
40714
|
40715
|
40716
|
46122
|
46123
|
46124
|
46125
|
46126
|
46127
|
46128
|
46319