From ac08aef495ca03c8a83e961e76d201eeca02fb01 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 18 Apr 2008 17:11:42 -0500 Subject: [PATCH] added another check to MARC framework test Check verifies that all subfields for each tag are assigned to the same editor tab (or are ignored). This situation can lead to data corruption, because if an incoming MARC record has a field whose subfields are assigned to different tabs, the first time that record is saved in the bib editor, the field will be split into multiple versions, each containing the subfields assigned to a given tab. Errors identified by this test known in the MARC21 frameworks - I'm working on a patch to correct those. Signed-off-by: Joshua Ferraro --- admin/checkmarc.pl | 17 ++++++++++ .../prog/en/modules/admin/checkmarc.tmpl | 33 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/admin/checkmarc.pl b/admin/checkmarc.pl index 2283f20fbf..0632cd4703 100755 --- a/admin/checkmarc.pl +++ b/admin/checkmarc.pl @@ -181,6 +181,23 @@ if ($res) { $total++; } +# verify that all of a field's subfields (except the ones explicitly ignore) +# are in the same tab +$sth = $dbh->prepare("SELECT tagfield, frameworkcode, frameworktext, GROUP_CONCAT(DISTINCT tab) AS tabs + FROM marc_subfield_structure + LEFT JOIN biblio_framework USING (frameworkcode) + WHERE tab != -1 + GROUP BY tagfield, frameworkcode, frameworktext + HAVING COUNT(DISTINCT tab) > 1"); +$sth->execute; +my $inconsistent_tabs = $sth->fetchall_arrayref({}); +if (scalar(@$inconsistent_tabs) > 0) { + $total++; + $template->param(inconsistent_tabs => 1); + $template->param(tab_info => $inconsistent_tabs); +} + $template->param(total => $total, ); + output_html_with_http_headers $input, $cookie, $template->output; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/checkmarc.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/checkmarc.tmpl index 81a04cb8a0..dd6e1f6c2b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/checkmarc.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/checkmarc.tmpl @@ -155,6 +155,39 @@ + + + subfields not in same tabs + Not all subfields for the following tags are in the same tab (or marked 'ignored'). + + + + + + + + + + + + + + + + + + + +
CodekDescriptionTagTabs in use
Default framework
+ + + + + OK + all subfields for each tag are in the same tab (or ignored) + + + -- 2.39.5