Bugzilla – Attachment 183688 Details for
Bug 40284
MARC21: Adjust maxlength for 005, 006 and 007
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40284: Adjust maxlength for 005-007.
Bug-40284-Adjust-maxlength-for-005-007.patch (text/plain), 3.26 KB, created by
Marcel de Rooy
on 2025-07-02 11:27:30 UTC
(
hide
)
Description:
Bug 40284: Adjust maxlength for 005-007.
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2025-07-02 11:27:30 UTC
Size:
3.26 KB
patch
obsolete
>From 91854972a63fc6a6742d7df71e427a16bbdb7d2f Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 2 Jul 2025 13:18:00 +0200 >Subject: [PATCH] Bug 40284: Adjust maxlength for 005-007. >Content-Type: text/plain; charset=utf-8 > >Test plan: >Run dbrev or new install. >Verify the maxlength for 005-007 in marc_subfield_structure. >Restart all. Check maxlength on input tags in the basic editor >for fields 005-007. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../data/mysql/atomicupdate/bug_40284.pl | 31 +++++++++++++++++++ > .../mandatory/marc21_framework_DEFAULT.yml | 4 +++ > 2 files changed, 35 insertions(+) > create mode 100755 installer/data/mysql/atomicupdate/bug_40284.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_40284.pl b/installer/data/mysql/atomicupdate/bug_40284.pl >new file mode 100755 >index 0000000000..e7683bff3f >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_40284.pl >@@ -0,0 +1,31 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_success say_info); >+ >+return { >+ bug_number => 40284, >+ description => "Add maxlength for fields 005 to 007 in MARC21", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ if ( C4::Context->preference('marcflavour') eq 'MARC21' ) { >+ my ( $count ) = $dbh->selectrow_array( >+ q{SELECT COUNT(*) FROM marc_subfield_structure WHERE tagfield in ('005','006','007') AND maxlength=9999} >+ ); >+ $dbh->do( >+ q{UPDATE marc_subfield_structure SET maxlength=16 WHERE tagfield='005' AND maxlength=9999} >+ ); >+ $dbh->do( >+ q{UPDATE marc_subfield_structure SET maxlength=18 WHERE tagfield='006' AND maxlength=9999} >+ ); >+ $dbh->do( >+ q{UPDATE marc_subfield_structure SET maxlength=23 WHERE tagfield='007' AND maxlength=9999} >+ ); >+ my ( $count2 ) = $dbh->selectrow_array( >+ q{SELECT COUNT(*) FROM marc_subfield_structure WHERE tagfield in ('005','006','007') AND maxlength=9999} >+ ); >+ say_success( $out, "Adjusted maxlength in $count records/fields" ) if $count; >+ say_warning( $out, "$count2 records remaining" ) if $count2; >+ } >+ }, >+}; >diff --git a/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml b/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml >index a0717cccf7..319d344cd5 100644 >--- a/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml >+++ b/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml >@@ -82873,6 +82873,10 @@ tables: > > sql_statements: > - "UPDATE marc_subfield_structure SET maxlength=24 WHERE tagfield='000';" >+ - "UPDATE marc_subfield_structure SET maxlength=16 WHERE tagfield='005';" >+ - "UPDATE marc_subfield_structure SET maxlength=18 WHERE tagfield='006';" >+ # 007 allows length 23 when 007/0 == m (motion picture) >+ - "UPDATE marc_subfield_structure SET maxlength=23 WHERE tagfield='007';" > - "UPDATE marc_subfield_structure SET maxlength=40 WHERE tagfield='008';" > > # Create the ACQ framework based on the default framework, fields 000 and 952 only >-- >2.39.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 40284
: 183688