Bug 42166: Check for 008 before adding the date to it

To test:
1. Edit or create a framework that does not require the 008.
2. Make or edit a record in that framework without a 008.
3. Turn on EnableAdvancedCatalogingEditor, and make sure you are using the advanced editor.
4. Go to the record from step 2 and click "Edit as new (duplicate)"
5. The record won't load in the advanced editor.
6. APPLY PATCH
7. Try again, this time the record should load when using "Edit as new (duplicate)".

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Lucas Gass 2026-03-24 16:50:43 +00:00
parent 6aa88ceb28
commit de5917821a
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 4 additions and 1 deletions

View File

@ -414,7 +414,10 @@
if( remove_control_num ){ record.removeField("001"); }
if( parts[0] === 'duplicate' ) {
let today = new Date();
record.field('008').subfield('@', today.toISOString().substring(2,10).replaceAll('-','') + record.field('008').subfield('@').substring(6));
let field008 = record.field('008');
if ( field008 ) {
record.field('008').subfield('@', today.toISOString().substring(2,10).replaceAll('-','') + record.field('008').subfield('@').substring(6));
}
}
editor.displayRecord( record );
editor.focus();