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

(-)a/C4/Biblio.pm (-9 / +8 lines)
Lines 1831-1845 sub UpsertMarcControlField { Link Here
1831
1831
1832
sub GetFrameworkCode {
1832
sub GetFrameworkCode {
1833
    my ($biblionumber) = @_;
1833
    my ($biblionumber) = @_;
1834
    my $cache = Koha::Cache::Memory::Lite->get_instance();
1834
    my $cache          = Koha::Cache::Memory::Lite->get_instance();
1835
    my $cache_key = "FrameworkCode-$biblionumber";
1835
    my $cache_key      = "FrameworkCode-$biblionumber";
1836
    my $frameworkcode = $cache->get_from_cache($cache_key);
1836
    my $frameworkcode  = $cache->get_from_cache($cache_key);
1837
    unless (defined $frameworkcode) {
1837
    unless ( defined $frameworkcode ) {
1838
        my $dbh = C4::Context->dbh;
1838
        my $dbh = C4::Context->dbh;
1839
        my $sth = $dbh->prepare("SELECT frameworkcode FROM biblio WHERE biblionumber=?");
1839
        ($frameworkcode) = $dbh->selectrow_array(
1840
        $sth->execute($biblionumber);
1840
            "SELECT frameworkcode FROM biblio WHERE biblionumber=?",
1841
        ($frameworkcode) = $sth->fetchrow;
1841
            undef, $biblionumber );
1842
        $cache->set_in_cache($cache_key, $frameworkcode);
1842
        $cache->set_in_cache( $cache_key, $frameworkcode );
1843
    }
1843
    }
1844
    return $frameworkcode;
1844
    return $frameworkcode;
1845
}
1845
}
1846
- 

Return to bug 32060