Bugzilla – Attachment 13138 Details for
Bug 8015
Add MARC Modifications Templates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8015: Catch error in the SetUTF8Flag routine
Bug-8015-Catch-error-in-the-SetUTF8Flag-routine.patch (text/plain), 2.25 KB, created by
Jonathan Druart
on 2012-10-31 13:35:03 UTC
(
hide
)
Description:
Bug 8015: Catch error in the SetUTF8Flag routine
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2012-10-31 13:35:03 UTC
Size:
2.25 KB
patch
obsolete
>From 5b69fc2acb7c51b2a692b0cc1fa6c791a4eab7e0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 31 Oct 2012 14:31:07 +0100 >Subject: [PATCH] Bug 8015: Catch error in the SetUTF8Flag routine > >The eval avoids the interface to run endlessly if an error occurred. >--- > C4/Charset.pm | 37 ++++++++++++++++++++----------------- > C4/ImportBatch.pm | 2 +- > 2 files changed, 21 insertions(+), 18 deletions(-) > >diff --git a/C4/Charset.pm b/C4/Charset.pm >index c294b36..fbfa8a5 100644 >--- a/C4/Charset.pm >+++ b/C4/Charset.pm >@@ -131,23 +131,26 @@ But since it handles charset, and MARC::Record, it finds its way in that package > =cut > > sub SetUTF8Flag{ >- my ($record, $nfd)=@_; >- return unless ($record && $record->fields()); >- foreach my $field ($record->fields()){ >- if ($field->tag()>=10){ >- my @subfields; >- foreach my $subfield ($field->subfields()){ >- push @subfields,($$subfield[0],NormalizeString($$subfield[1],$nfd)); >- } >- my $newfield=MARC::Field->new( >- $field->tag(), >- $field->indicator(1), >- $field->indicator(2), >- @subfields >- ); >- $field->replace_with($newfield); >- } >- } >+ my ($record, $nfd)=@_; >+ return unless ($record && $record->fields()); >+ foreach my $field ($record->fields()){ >+ if ($field->tag()>=10){ >+ my @subfields; >+ foreach my $subfield ($field->subfields()){ >+ push @subfields,($$subfield[0],NormalizeString($$subfield[1],$nfd)); >+ } >+ eval { >+ my $newfield=MARC::Field->new( >+ $field->tag(), >+ $field->indicator(1), >+ $field->indicator(2), >+ @subfields >+ ); >+ $field->replace_with($newfield); >+ }; >+ warn "ERROR occurred in SetUTF8Flag $@" if $@; >+ } >+ } > } > > =head2 NormalizeString >diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm >index 71a109c..20a9ab2 100644 >--- a/C4/ImportBatch.pm >+++ b/C4/ImportBatch.pm >@@ -324,7 +324,7 @@ sub ModAuthInBatch { > > =cut > >-sub BatchStageMarcRecords { >+sub BatchStageMarcRecords { > my $record_type = shift; > my $encoding = shift; > my $marc_records = shift; >-- >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 8015
:
9313
|
9329
|
9330
|
9331
|
10089
|
11579
|
11607
|
11608
|
12280
|
12288
|
12569
|
12570
|
12571
|
12572
|
12839
|
12856
|
12857
|
12858
|
12859
|
12860
|
13121
|
13138
|
13495
|
14030
|
14031
|
14032
|
14033
|
14034
|
14035
|
14040
|
16330
|
16331
|
16332
|
16333
|
16334
|
16335
|
16363
|
16376
|
16377
|
16378
|
16379
|
16413
|
16415
|
16423
|
16455
|
16468
|
16470
|
16471
|
16472
|
16473
|
16475
|
16476
|
16477
|
16478
|
16479
|
16480
|
17036
|
17037
|
17038
|
18372
|
18441
|
21024
|
21025
|
21026
|
21027
|
21028
|
21029
|
21030
|
21031
|
21032
|
21033
|
21034
|
21035
|
21036
|
21037
|
21038
|
21371
|
21484
|
21485
|
21486
|
21487
|
21808
|
21809
|
21876
|
21901
|
21902
|
21903
|
21904
|
21905
|
21906
|
21907
|
21908
|
21909
|
21910
|
21911
|
21912
|
21913
|
21914
|
21915
|
21916
|
21917
|
21918
|
21919
|
21920
|
22185
|
22186
|
22187
|
22188
|
22189
|
22190
|
22284
|
22285
|
22290
|
22293
|
22392
|
22393
|
22394
|
22395
|
22396
|
22397
|
22398
|
22399
|
22400
|
22401