Bugzilla – Attachment 170796 Details for
Bug 37675
MARC basic editor loses data for records with thousands of the same field
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37675: Remove need for random numbers in MARC subfields
Bug-37675-Remove-need-for-random-numbers-in-MARC-s.patch (text/plain), 4.13 KB, created by
David Cook
on 2024-08-28 04:38:42 UTC
(
hide
)
Description:
Bug 37675: Remove need for random numbers in MARC subfields
Filename:
MIME Type:
Creator:
David Cook
Created:
2024-08-28 04:38:42 UTC
Size:
4.13 KB
patch
obsolete
>From ac8b17f8c70877e4003775288025e3b345a8aa24 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Wed, 28 Aug 2024 04:36:05 +0000 >Subject: [PATCH] Bug 37675: Remove need for random numbers in MARC subfields > >This change removes the need for random numbers in the index_tag >and index_subfield variables. Instead, respectively, we use the >tag number and an incrementing integer. > >This eliminates the possibility of duplicate ID/name values >in server-side generated content. > >Note that there is still a risk of a collision when generating >these values via the Javascript at this time. >--- > Koha/UI/Form/Builder/Biblio.pm | 10 +++++++++- > cataloguing/addbiblio.pl | 7 ++++++- > 2 files changed, 15 insertions(+), 2 deletions(-) > >diff --git a/Koha/UI/Form/Builder/Biblio.pm b/Koha/UI/Form/Builder/Biblio.pm >index 72d7db99dc..36865ea3c8 100644 >--- a/Koha/UI/Form/Builder/Biblio.pm >+++ b/Koha/UI/Form/Builder/Biblio.pm >@@ -78,8 +78,16 @@ sub generate_subfield_form { > my $breedingid = $params->{breedingid}; > my $tagslib = $params->{tagslib}; > my $mandatory_z3950 = $params->{mandatory_z3950} // {}; >+ my $subfield_counter = $params->{subfield_counter}; >+ if ( $subfield_counter->{$subfield} ){ >+ $subfield_counter->{$subfield}++; >+ } >+ else { >+ $subfield_counter->{$subfield} = 1; >+ } >+ my $subfield_number = $subfield_counter->{$subfield}; > >- my $index_subfield = $self->create_key(); # create a specific key for each subfield >+ my $index_subfield = $subfield_number; # create a specific key for each subfield > > # Apply optional framework default value when it is a new record, > # or when editing as new (duplicating a record), >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index 626c3cb4c4..9a5964b7ac 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -289,8 +289,9 @@ sub build_tabs { > $i++; > next if ! $tag; > my ($indicator1, $indicator2); >- my $index_tag = CreateKey($unique_keys); >+ my $index_tag = $tag; > >+ my $subfield_counter = {}; > # if MARC::Record is not empty =>use it as master loop, then add missing subfields that should be in the tab. > # if MARC::Record is empty => use tab as master loop. > if ( $record ne -1 && ( $record->field($tag) || $tag eq '000' ) ) { >@@ -334,6 +335,7 @@ sub build_tabs { > breedingid => scalar $input->param('breedingid'), > tagslib => $tagslib, > mandatory_z3950 => $mandatory_z3950, >+ subfield_counter => $subfield_counter, > } > ) > ); >@@ -360,6 +362,7 @@ sub build_tabs { > breedingid => scalar $input->param('breedingid'), > tagslib => $tagslib, > mandatory_z3950 => $mandatory_z3950, >+ subfield_counter => $subfield_counter, > } > ) > ); >@@ -401,6 +404,7 @@ sub build_tabs { > breedingid => scalar $input->param('breedingid'), > tagslib => $tagslib, > mandatory_z3950 => $mandatory_z3950, >+ subfield_counter => $subfield_counter, > } > ) > ); >@@ -468,6 +472,7 @@ sub build_tabs { > breedingid => scalar $input->param('breedingid'), > tagslib => $tagslib, > mandatory_z3950 => $mandatory_z3950, >+ subfield_counter => $subfield_counter, > } > ) > ); >-- >2.39.2
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 37675
:
170470
|
170580
|
170764
|
170795
| 170796 |
170800