Bug 42098: (follow-up) Enable plugin in ImportBatch.t test

The Handler::run change to skip disabled plugins broke the
RecordsFromMarcPlugin subtest in ImportBatch.t. The MarcFieldValues
plugin was installed but never enabled, so Handler::run returned
early. Add $plugin->enable() before calling RecordsFromMarcPlugin.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
(cherry picked from commit 764a468ec3)
Signed-off-by: Chloé Zermatten <chloe.zermatten@openfifth.co.uk>
This commit is contained in:
Martin Renvoize 2026-03-20 07:50:33 +00:00 committed by Chloé Zermatten
parent 57234c9ad3
commit a2daaa6c32
No known key found for this signature in database
1 changed files with 2 additions and 0 deletions

View File

@ -308,9 +308,11 @@ subtest "RecordsFromMarcPlugin" => sub {
$plugins->InstallPlugins;
my ($plugin) = $plugins->GetPlugins( { all => 1, metadata => { name => 'MarcFieldValues' } } );
isnt( $plugin, undef, "Plugin found" );
$plugin->enable();
my $records = C4::ImportBatch::RecordsFromMarcPlugin( $name, ref $plugin, 'UTF-8' );
is( @$records, 2, 'Two results returned' );
is( ref $records->[0], 'MARC::Record', 'Returned MARC::Record object' );
if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) {
is(
$records->[0]->subfield( '200', 'a' ), 'Silence in the library',