See also bug 35536 comment60 # Failed test 'AddAuthority calls the hook with action=create, id passed' # at /kohadevbox/koha/t/db_dependent/Koha/Plugins/authority_hooks.t line 57. # found warning: Cannot determine authority type for record: 1740 at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch.pm line 573. # found warning: Plugin error (Test Plugin): Exception 'Koha::Exception' thrown 'after_authority_action called with action: create, id: 1740' # expected to find warning: (?^u:after_authority_action called with action: create, id: \d+) # Failed test 'ModAuthority calls the hook with action=modify, id passed' # at /kohadevbox/koha/t/db_dependent/Koha/Plugins/authority_hooks.t line 61. # found warning: Cannot determine authority type for record: 1740 at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch.pm line 573. # found warning: Plugin error (Test Plugin): Exception 'Koha::Exception' thrown 'after_authority_action called with action: modify, id: 1740' # expected to find warning: (?^u:after_authority_action called with action: modify, id: 1740) # Looks like you failed 2 tests of 3.
Failing test warning_like { ( $id ) = C4::AuthoritiesMarc::AddAuthority( MARC::Record->new, undef, 'PERSO_NAME' ); } qr/after_authority_action called with action: create, id: \d+/, 'AddAuthority calls the hook with action=create, id passed'; It triggers another warning about no authtype when using Elastic: Crashes on this part in marc_records_to_documents my $authtypecode = GuessAuthTypeCode( $record ); if( $authtypecode ){ if( $authtypecode !~ m/_SUBD/ ){ #Subdivision records will not be used for linking and so don't require match-heading to be built my $field = $record->field( $auth_match_headings{ $authtypecode } ); my $heading = C4::Heading->new_from_field( $field, undef, 1 ); #new auth heading push @{$record_document->{'match-heading'}}, $heading->search_form if $heading; } } else { warn "Cannot determine authority type for record: " . $record->field('001')->as_string;
Created attachment 163668 [details] [review] Bug 36397: Quick fix for Koha/Plugins/authority_hooks.t Lazy approach for now: just ignore the other warnings that are logical when passing blank records to SearchEngine. Elastic is a bit more sensitive than Zebra here.. Test plan: Run t/db_dependent/Koha/Plugins/authority_hooks.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 163672 [details] [review] Bug 36397: Quick fix for Koha/Plugins/authority_hooks.t Lazy approach for now: just ignore the other warnings that are logical when passing blank records to SearchEngine. Elastic is a bit more sensitive than Zebra here.. Test plan: Run t/db_dependent/Koha/Plugins/authority_hooks.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com>
Pushed for 24.05! Well done everyone, thank you!
Depends on bug 35536 ?