Bugzilla – Attachment 5405 Details for
Bug 5725
Batch modifications for Biblios
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch follow-up 2
0001-Bug-5725-follow-upd-deal-with-leader.patch (text/plain), 2.93 KB, created by
Paul Poulain
on 2011-09-12 13:39:46 UTC
(
hide
)
Description:
proposed patch follow-up 2
Filename:
MIME Type:
Creator:
Paul Poulain
Created:
2011-09-12 13:39:46 UTC
Size:
2.93 KB
patch
obsolete
>From ca1d9c835de2a47d348237bb70068ef7109c715a Mon Sep 17 00:00:00 2001 >From: Paul Poulain <paul.poulain@biblibre.com> >Date: Mon, 12 Sep 2011 15:33:21 +0200 >Subject: [PATCH] Bug 5725 follow-upd, deal with leader > >As Owen comment 33 notices, leader update was not working. This patch fixes the problem (and fix a few reindenting glitches as well) >--- > C4/Biblio.pm | 25 ++++++++++++++++++------- > 1 files changed, 18 insertions(+), 7 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 90ecc5e..ee83caf 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -3712,11 +3712,22 @@ sub BatchModField { > return 1; > } else { > my $done=0; >+ if ($field eq '000') { >+ my $value=$record->leader(); >+ if ($value=~ s/$condition/$repval/){ >+ $record->leader($repval); >+ $done=1; >+ } >+ if ( $nocond eq 'true'){ >+ $record->leader($repval); >+ $done=1; >+ } >+ } > for my $rfield ($record->field($field)) { > if ($subfield && $subfield ne "@"){ > my @subfields = $rfield->subfields(); > my @subfields_to_add; >- foreach my $subf (@subfields) { >+ foreach my $subf (@subfields) { > if ($subf->[0] eq $subfield){ > $subf->[1]=NormalizeString($subf->[1]); > if ( $action eq "mod" ) { >@@ -3726,8 +3737,8 @@ sub BatchModField { > if ($nocond eq "true"){ > $subf->[1] = $repval; > $done=1; >- } >- } elsif ( $action eq "del" ) { >+ } >+ } elsif ( $action eq "del" ) { > if ( $subf->[1] =~ m/$condition/ || $nocond eq "true" ) { > $done=1; > next; >@@ -3735,11 +3746,11 @@ sub BatchModField { > } > } > push @subfields_to_add,@$subf; >- } >+ } > if ($done){ > if (@subfields_to_add){ > $rfield->replace_with(MARC::Field->new($rfield->tag,$rfield->indicator(1),$rfield->indicator(2),@subfields_to_add)); >- } >+ } > else { > my $count= $record->delete_field($rfield); > } >@@ -3754,8 +3765,8 @@ sub BatchModField { > if ($field < 10){ > my $value=$record->field($field)->data(); > if ($value=~ s/$condition/$repval/){ >- $record->field($field)->update($value); >- $done=1; >+ $record->field($field)->update($value); >+ $done=1; > > } > if ( $nocond eq 'true'){ >-- >1.7.4.1 >
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 5725
:
3105
|
3108
|
3191
|
3193
|
3234
|
3356
|
4734
|
4735
|
4736
|
4863
|
4864
|
4897
|
4898
|
4899
|
5404
|
5405
|
5684
|
5685
|
5697
|
5959
|
5960
|
5980
|
5981
|
5982
|
10610
|
10611
|
10612
|
11731
|
11732
|
11733