View | Details | Raw Unified | Return to bug 34943
Collapse All | Expand All

(-)a/C4/Biblio.pm (-1 / +4 lines)
Lines 2889-2895 sub ModBiblioMarc { Link Here
2889
        Koha::Util::MARC::set_marc_field($record, C4::Context->preference('MarcFieldForModifierName'), $borrowername);
2889
        Koha::Util::MARC::set_marc_field($record, C4::Context->preference('MarcFieldForModifierName'), $borrowername);
2890
    }
2890
    }
2891
2891
2892
    Koha::Plugins->call( 'before_biblio_metadata_store', $record );
2892
    Koha::Plugins->call(
2893
        'before_biblio_action',
2894
        { action => 'save', payload => { biblio_id => $biblionumber, record => $record } }
2895
    );
2893
2896
2894
    $m_rs->metadata( $record->as_xml_record($encoding) );
2897
    $m_rs->metadata( $record->as_xml_record($encoding) );
2895
    $m_rs->store;
2898
    $m_rs->store;
(-)a/t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t (-1 / +1 lines)
Lines 88-94 subtest 'after_biblio_action() and after_item_action() hooks tests' => sub { Link Here
88
    Koha::Plugins::Methods->delete;
88
    Koha::Plugins::Methods->delete;
89
};
89
};
90
90
91
subtest 'before_biblio_metadata_store() hooks tests' => sub {
91
subtest 'before_biblio_action() hooks tests' => sub {
92
92
93
    plan tests => 5;
93
    plan tests => 5;
94
94
(-)a/t/lib/plugins/Koha/Plugin/Test.pm (-3 / +7 lines)
Lines 149-156 sub after_hold_create { Link Here
149
    Koha::Exception->throw("after_hold_create called with parameter " . ref($param) );
149
    Koha::Exception->throw("after_hold_create called with parameter " . ref($param) );
150
}
150
}
151
151
152
sub before_biblio_metadata_store {
152
sub before_biblio_action {
153
    my ( $self, $record ) = @_;
153
    my ( $self, $params ) = @_;
154
155
    my $action   = $params->{action} // '';
156
    my $payload  = $params->{payload};
157
    my $bibli_id = $payload->{biblio_id};
158
    my $record   = $payload->{record};
154
159
155
    $record->insert_fields_ordered(
160
    $record->insert_fields_ordered(
156
        MARC::Field->new(
161
        MARC::Field->new(
157
- 

Return to bug 34943