Bugzilla – Attachment 100922 Details for
Bug 23871
Add check for 'title exists' to `search_for_data_inconsistencies.pl`
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23871: data inconsistencies - check title exists
Bug-23871-data-inconsistencies---check-title-exist.patch (text/plain), 2.23 KB, created by
Bernardo Gonzalez Kriegel
on 2020-03-17 17:33:03 UTC
(
hide
)
Description:
Bug 23871: data inconsistencies - check title exists
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2020-03-17 17:33:03 UTC
Size:
2.23 KB
patch
obsolete
>From 1200b5dab685305100bfd1eb8660d97e7948feaa Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Tue, 22 Oct 2019 14:31:08 +0200 >Subject: [PATCH] Bug 23871: data inconsistencies - check title exists > >In biblio records, a field must be linked to biblio.title. >200$a in UNIMARC, 100$a MARC21 (and other). > >If this field is undefined, some pages like checkouts table can fail. > >Test plan : >1) Remove biblio title in SQL : > UPDATE biblio SET title='' WHERE biblionumber=XXX >2) Run misc/maintenance/search_for_data_inconsistencies.pl >3) You see the record as an inconsistency >4) Reset a title > UPDATE biblio SET title='50 shades of Grey' WHERE biblionumber=XXX >5) Run misc/maintenance/search_for_data_inconsistencies.pl >6) Record is no longer an inconsistency > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Fixed merge conflict, works as described. No errors >--- > .../search_for_data_inconsistencies.pl | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > >diff --git a/misc/maintenance/search_for_data_inconsistencies.pl b/misc/maintenance/search_for_data_inconsistencies.pl >index 1790495e88..fd66200985 100755 >--- a/misc/maintenance/search_for_data_inconsistencies.pl >+++ b/misc/maintenance/search_for_data_inconsistencies.pl >@@ -25,6 +25,7 @@ use Koha::BiblioFrameworks; > use Koha::Biblioitems; > use Koha::Items; > use Koha::ItemTypes; >+use C4::Biblio; > > { > my $items = Koha::Items->search({ -or => { homebranch => undef, holdingbranch => undef }}); >@@ -187,6 +188,20 @@ use Koha::ItemTypes; > } > } > >+{ >+ my $biblios = Koha::Biblios->search({ -or => { title => undef, title => '' }}); >+ if ( $biblios->count ) { >+ my ( $title_tag, $title_subtag ) = C4::Biblio::GetMarcFromKohaField( 'biblio.title' ); >+ my $title_field = $title_tag // ''; >+ $title_field .= '$'.$title_subtag if $title_subtag; >+ new_section("Biblio without title $title_field"); >+ while ( my $biblio = $biblios->next ) { >+ new_item(sprintf "Biblio with biblionumber=%s does not have title defined", $biblio->biblionumber); >+ } >+ new_hint("Edit these biblio records to defined a title"); >+ } >+} >+ > sub new_section { > my ( $name ) = @_; > say "\n== $name =="; >-- >2.17.1
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 23871
:
94545
|
100922
|
102833