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

(-)a/C4/Items.pm (-6 / +5 lines)
Lines 2822-2831 sub PrepareItemrecordDisplay { Link Here
2822
    $frameworkcode = &GetFrameworkCode($bibnum) if $bibnum;
2822
    $frameworkcode = &GetFrameworkCode($bibnum) if $bibnum;
2823
    my ( $itemtagfield, $itemtagsubfield ) = &GetMarcFromKohaField( "items.itemnumber", $frameworkcode );
2823
    my ( $itemtagfield, $itemtagsubfield ) = &GetMarcFromKohaField( "items.itemnumber", $frameworkcode );
2824
2824
2825
    # it would be perhaps beneficial (?) to call GetMarcStructure with 'unsafe' parameter
2825
    # Note: $tagslib obtained from GetMarcStructure() in 'unsafe' mode is
2826
    # for performance reasons, but $tagslib may be passed to $plugin->build(), and there
2826
    # a shared data structure. No plugin (including custom ones) should change
2827
    # is no way to ensure that this structure is not getting corrupted somewhere in there
2827
    # its contents. See also GetMarcStructure.
2828
    my $tagslib = &GetMarcStructure( 1, $frameworkcode );
2828
    my $tagslib = &GetMarcStructure( 1, $frameworkcode, { unsafe => 1 } );
2829
2829
2830
    # return nothing if we don't have found an existing framework.
2830
    # return nothing if we don't have found an existing framework.
2831
    return q{} unless $tagslib;
2831
    return q{} unless $tagslib;
Lines 2849-2861 sub PrepareItemrecordDisplay { Link Here
2849
    $query .= qq{ ORDER BY lib};
2849
    $query .= qq{ ORDER BY lib};
2850
    my $authorised_values_sth = $dbh->prepare( $query );
2850
    my $authorised_values_sth = $dbh->prepare( $query );
2851
    foreach my $tag ( sort keys %{$tagslib} ) {
2851
    foreach my $tag ( sort keys %{$tagslib} ) {
2852
        my $previous_tag = '';
2853
        if ( $tag ne '' ) {
2852
        if ( $tag ne '' ) {
2854
2853
2855
            # loop through each subfield
2854
            # loop through each subfield
2856
            my $cntsubf;
2855
            my $cntsubf;
2857
            foreach my $subfield ( sort keys %{ $tagslib->{$tag} } ) {
2856
            foreach my $subfield ( sort keys %{ $tagslib->{$tag} } ) {
2858
                next if IsMarcStructureInternal($tagslib->{$tag}{$subfield});
2857
                next if IsMarcStructureInternal($tagslib->{$tag}{$subfield});
2858
                next unless ( $tagslib->{$tag}->{$subfield}->{'tab'} );
2859
                next if ( $tagslib->{$tag}->{$subfield}->{'tab'} ne "10" );
2859
                next if ( $tagslib->{$tag}->{$subfield}->{'tab'} ne "10" );
2860
                my %subfield_data;
2860
                my %subfield_data;
2861
                $subfield_data{tag}           = $tag;
2861
                $subfield_data{tag}           = $tag;
2862
- 

Return to bug 16365