Bug 36552: (QA follow-up) Add a theoretical check on $record
Theoretically, it might be empty? Note the check too in the other script. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
34746f5706
commit
cc834ba187
|
|
@ -639,12 +639,12 @@ if ($op eq "cud-add") {
|
|||
} else {
|
||||
if ( $op eq "duplicate" ) {
|
||||
$authid = "";
|
||||
if ( C4::Context->preference('marcflavour') eq 'MARC21' && $record->field('008') ) {
|
||||
if ( C4::Context->preference('marcflavour') eq 'MARC21' && $record && $record->field('008') ) {
|
||||
my $s008 = $record->field('008')->data;
|
||||
my $date = POSIX::strftime( "%y%m%d", localtime );
|
||||
substr( $s008, 0, 6, $date );
|
||||
$record->field('008')->update($s008);
|
||||
} elsif ( C4::Context->preference('marcflavour') eq 'UNIMARC' && $record->subfield( '100', 'a' ) ) {
|
||||
} elsif ( C4::Context->preference('marcflavour') eq 'UNIMARC' && $record && $record->subfield( '100', 'a' ) ) {
|
||||
my $s100a = $record->subfield( '100', 'a' );
|
||||
my $date = POSIX::strftime( "%Y%m%d", localtime );
|
||||
substr( $s100a, 0, 8, $date );
|
||||
|
|
|
|||
Loading…
Reference in New Issue