Bugzilla – Attachment 13840 Details for
Bug 9192
UNIMARC_sync_date_created_with_marc_biblio.pl field creation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
0001-Bug-9192-UNIMARC_sync_date_created_with_marc_biblio..patch (text/plain), 2.66 KB, created by
Fridolin Somers
on 2012-12-03 13:10:05 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2012-12-03 13:10:05 UTC
Size:
2.66 KB
patch
obsolete
>From ccb416e723a685036fbe71da60aa354c2e79735e Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Mon, 3 Dec 2012 14:08:07 +0100 >Subject: [PATCH] Bug 9192: UNIMARC_sync_date_created_with_marc_biblio.pl > field creation > >--- > .../UNIMARC_sync_date_created_with_marc_biblio.pl | 43 +++++++++++++++----- > 1 file changed, 33 insertions(+), 10 deletions(-) > >diff --git a/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl b/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl >index 244c2ac..b5c78e5 100755 >--- a/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl >+++ b/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl >@@ -133,7 +133,16 @@ sub updateMarc { > > # date created field > unless ($c_marc_field) { >- $biblio->add_fields( new MARC::Field( $c_field, '', '' ) ); >+ if ( defined $c_subfield ) { >+ $biblio->add_fields( >+ new MARC::Field( >+ $c_field, ' ', ' ', $c_subfield => $c_db_value >+ ) >+ ); >+ } >+ else { >+ $biblio->add_fields( new MARC::Field( $c_field, $c_db_value ) ); >+ } > $debug and warn "[WARN] $c_field did not exist."; > $c_marc_field = $biblio->field($c_field); > >@@ -142,24 +151,38 @@ sub updateMarc { > $m_marc_field = $c_marc_field; > } > } >- if ( defined $c_subfield ) { >- $c_marc_field->update( $c_subfield, $c_db_value ); >- } > else { >- $c_marc_field->update($c_db_value); >+ if ( defined $c_subfield ) { >+ $c_marc_field->update( $c_subfield, $c_db_value ); >+ } >+ else { >+ $c_marc_field->update($c_db_value); >+ } > } > > # date last modified field > unless ($m_marc_field) { >- $biblio->add_fields( new MARC::Field( $m_field, '', '' ) ); >+ if ( defined $m_subfield ) { >+ $biblio->add_fields( >+ new MARC::Field( >+ $m_field, ' ', ' ', $m_subfield => $m_db_value >+ ) >+ ); >+ } >+ else { >+ $biblio->add_fields( new MARC::Field( $m_field, $m_db_value ) ); >+ } >+ > $debug and warn "[WARN] $m_field did not exist."; > $m_marc_field = $biblio->field($m_field); > } >- if ( defined $m_subfield ) { >- $m_marc_field->update( $m_subfield, $m_db_value ); >- } > else { >- $m_marc_field->update($m_db_value); >+ if ( defined $m_subfield ) { >+ $m_marc_field->update( $m_subfield, $m_db_value ); >+ } >+ else { >+ $m_marc_field->update($m_db_value); >+ } > } > > # apply to databse >-- >1.7.9.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 9192
:
13840
|
14281
|
14939
|
15327
|
20866
|
20867
|
22173