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

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

Return to bug 32060