Bugzilla – Attachment 17928 Details for
Bug 8896
Delete serials no more missing from missinglist
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8896 QA Followup for regex
Bug-8896-QA-Followup-for-regex.patch (text/plain), 2.13 KB, created by
Jonathan Druart
on 2013-05-03 13:05:40 UTC
(
hide
)
Description:
Bug 8896 QA Followup for regex
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-05-03 13:05:40 UTC
Size:
2.13 KB
patch
obsolete
>From c7f2fa9d9841b3d8fe06ae4f06896626ccf6c804 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 11 Apr 2013 12:48:26 +0200 >Subject: [PATCH] Bug 8896 QA Followup for regex > >Making sure that the regex does not kill more than it should. >Amended: does now only look at separating colons(;) not commas(,). >Amended: two index expressions in direct context replaced by same regex for >consistency. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > C4/Serials.pm | 13 +++++-------- > 1 file changed, 5 insertions(+), 8 deletions(-) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index 784916c..e2748ff 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -1134,21 +1134,18 @@ sub ModSerialStatus { > $sth->execute($subscriptionid); > my ( $missinglist, $recievedlist ) = $sth->fetchrow; > if ( $status == 2 ) { >- > $recievedlist .= "; $serialseq" >- unless ( index( "$recievedlist", "$serialseq" ) >= 0 ); >+ if $recievedlist!~/(^|;)\s*$serialseq(?=;|$)/; > } > # in case serial has been previously marked as missing > if (grep /$status/, (1,2,3,7)) { >- $missinglist =~ s/[,;]?\s?$serialseq//g; >+ $missinglist=~ s/(^|;)\s*$serialseq(?=;|$)//g; > } >- # warn "missinglist : $missinglist serialseq :$serialseq, ".index("$missinglist","$serialseq"); > $missinglist .= "; $serialseq" >- if ( $status == 4 >- and not index( "$missinglist", "$serialseq" ) >= 0 ); >+ if $status==4 && $missinglist!~/(^|;)\s*$serialseq(?=;|$)/; > $missinglist .= "; not issued $serialseq" >- if ( $status == 5 >- and index( "$missinglist", "$serialseq" ) >= 0 ); >+ if $status==5 && $missinglist!~/(^|;)\s*$serialseq(?=;|$)/; >+ > $query = "UPDATE subscriptionhistory SET recievedlist=?, missinglist=? WHERE subscriptionid=?"; > $sth = $dbh->prepare($query); > $recievedlist =~ s/^; //; >-- >1.7.10.4
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 8896
:
12754
|
14657
|
15436
|
17275
|
17362
|
17363
|
17364
|
17365
|
17366
|
17577
|
17927
| 17928