Bug 16428: Use the biblio framework to know if a field is mapped

The subroutine _build_default_values_for_mod_marc takes the
frameworkcode in parameter, but ModItemFromMarc did not pass it.
It uses it to know if a field is mapped or not to a Koha field
(C4::Koha::IsKohaFieldLinked).
Consequently the default framework ("") was always used.

This bug has been found working on bug 13074 and has been put on a
separate bug report to ease the backport.

Test plan:
Without this change, the tests added by bug 16428 won't pass

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 52b1b8eae1)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 4ebfb709f6)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
This commit is contained in:
Jonathan Druart 2016-05-03 11:03:52 +01:00 committed by Julian Maurice
parent 679d0414a0
commit 9c03081053
1 changed files with 1 additions and 1 deletions

View File

@ -507,7 +507,7 @@ sub ModItemFromMarc {
my $localitemmarc = MARC::Record->new;
$localitemmarc->append_fields( $item_marc->field($itemtag) );
my $item = &TransformMarcToKoha( $dbh, $localitemmarc, $frameworkcode, 'items' );
my $default_values = _build_default_values_for_mod_marc();
my $default_values = _build_default_values_for_mod_marc($frameworkcode);
foreach my $item_field ( keys %$default_values ) {
$item->{$item_field} = $default_values->{$item_field}
unless exists $item->{$item_field};