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

(-)a/C4/Items.pm (-1 / +2 lines)
Lines 304-310 sub ModItemFromMarc { Link Here
304
    my $item_object = Koha::Items->find($itemnumber);
304
    my $item_object = Koha::Items->find($itemnumber);
305
    my $item = TransformMarcToKoha( $localitemmarc, $frameworkcode, 'items' );
305
    my $item = TransformMarcToKoha( $localitemmarc, $frameworkcode, 'items' );
306
306
307
    my $has_permanent_location = exists $item->{permanent_location};
307
    my ( $perm_loc_tag, $perm_loc_subfield ) = C4::Biblio::GetMarcFromKohaField( "items.permanent_location" );
308
    my $has_permanent_location = defined $item_marc->subfield( $perm_loc_tag, $perm_loc_subfield );
308
309
309
    # Retrieving the values for the fields that are not linked
310
    # Retrieving the values for the fields that are not linked
310
    my @mapped_fields = Koha::MarcSubfieldStructures->search(
311
    my @mapped_fields = Koha::MarcSubfieldStructures->search(
(-)a/t/db_dependent/Items.t (-2 / +1 lines)
Lines 1117-1127 subtest 'ModItemFromMarc' => sub { Link Here
1117
        $item->permanent_location("");
1117
        $item->permanent_location("");
1118
        $item->location('E');
1118
        $item->location('E');
1119
        $marc = C4::Items::Item2Marc( $item->unblessed, $item->biblionumber );
1119
        $marc = C4::Items::Item2Marc( $item->unblessed, $item->biblionumber );
1120
        $marc->field('952')->add_subfields( "C", "" );
1120
        ModItemFromMarc( $marc, $item->biblionumber, $item->itemnumber );
1121
        ModItemFromMarc( $marc, $item->biblionumber, $item->itemnumber );
1121
        $item = $item->get_from_storage;
1122
        $item = $item->get_from_storage;
1122
        is( $item->location, 'E', 'next new location set as expected' );
1123
        is( $item->location, 'E', 'next new location set as expected' );
1123
        is( $item->permanent_location, undef, 'permanent location is not updated if previously set as blank string' );
1124
        is( $item->permanent_location, undef, 'permanent location is not updated if previously set as blank string' );
1124
1125
    };
1125
    };
1126
1126
1127
    $schema->storage->txn_rollback;
1127
    $schema->storage->txn_rollback;
1128
- 

Return to bug 27837