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

(-)a/C4/Search.pm (-5 / +3 lines)
Lines 2007-2025 sub searchResults { Link Here
2007
        foreach my $hostfield ( $marcrecord->field($analyticsfield)) {
2007
        foreach my $hostfield ( $marcrecord->field($analyticsfield)) {
2008
            my $hostbiblionumber = $hostfield->subfield("0");
2008
            my $hostbiblionumber = $hostfield->subfield("0");
2009
            my $linkeditemnumber = $hostfield->subfield("9");
2009
            my $linkeditemnumber = $hostfield->subfield("9");
2010
            if(!$hostbiblionumber eq undef){
2010
            if( $hostbiblionumber ) {
2011
                my $hostbiblio = GetMarcBiblio({
2011
                my $hostbiblio = GetMarcBiblio({
2012
                    biblionumber => $hostbiblionumber,
2012
                    biblionumber => $hostbiblionumber,
2013
                    embed_items  => 1 });
2013
                    embed_items  => 1 });
2014
                my ($itemfield, undef) = GetMarcFromKohaField( 'items.itemnumber', GetFrameworkCode($hostbiblionumber) );
2014
                my ($itemfield, undef) = GetMarcFromKohaField( 'items.itemnumber', GetFrameworkCode($hostbiblionumber) );
2015
                if(!$hostbiblio eq undef){
2015
                if( $hostbiblio ) {
2016
                    my @hostitems = $hostbiblio->field($itemfield);
2016
                    my @hostitems = $hostbiblio->field($itemfield);
2017
                    foreach my $hostitem (@hostitems){
2017
                    foreach my $hostitem (@hostitems){
2018
                        if ($hostitem->subfield("9") eq $linkeditemnumber){
2018
                        if ($hostitem->subfield("9") eq $linkeditemnumber){
2019
                            my $linkeditem =$hostitem;
2019
                            my $linkeditem =$hostitem;
2020
                            # append linked items if they exist
2020
                            # append linked items if they exist
2021
                            if (!$linkeditem eq undef){
2021
                            push @fields, $linkeditem if $linkeditem;
2022
                                push (@fields, $linkeditem);}
2023
                        }
2022
                        }
2024
                    }
2023
                    }
2025
                }
2024
                }
2026
- 

Return to bug 20696