@@ -, +, @@ UPDATE biblio SET title='' WHERE biblionumber=XXX UPDATE biblio SET title='50 shades of Grey' WHERE biblionumber=XXX --- .../search_for_data_inconsistencies.pl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) --- a/misc/maintenance/search_for_data_inconsistencies.pl +++ a/misc/maintenance/search_for_data_inconsistencies.pl @@ -19,9 +19,11 @@ use Modern::Perl; use Koha::Script; use Koha::Items; +use Koha::Biblios; use Koha::Biblioitems; use Koha::ItemTypes; use Koha::Authorities; +use C4::Biblio; { my $items = Koha::Items->search({ -or => { homebranch => undef, holdingbranch => undef }}); @@ -108,6 +110,20 @@ use Koha::Authorities; } } +{ + 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 =="; --