Bug 32060: Use selectrow_array
Trivial ergonomic patch, use selectrow_array, no need to prepare the query + perltidy the sub Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
b6ae2c1ee3
commit
d78bbbeddd
16
C4/Biblio.pm
16
C4/Biblio.pm
|
|
@ -1833,15 +1833,15 @@ sub UpsertMarcControlField {
|
|||
|
||||
sub GetFrameworkCode {
|
||||
my ($biblionumber) = @_;
|
||||
my $cache = Koha::Cache::Memory::Lite->get_instance();
|
||||
my $cache_key = "FrameworkCode-$biblionumber";
|
||||
my $frameworkcode = $cache->get_from_cache($cache_key);
|
||||
unless (defined $frameworkcode) {
|
||||
my $cache = Koha::Cache::Memory::Lite->get_instance();
|
||||
my $cache_key = "FrameworkCode-$biblionumber";
|
||||
my $frameworkcode = $cache->get_from_cache($cache_key);
|
||||
unless ( defined $frameworkcode ) {
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $sth = $dbh->prepare("SELECT frameworkcode FROM biblio WHERE biblionumber=?");
|
||||
$sth->execute($biblionumber);
|
||||
($frameworkcode) = $sth->fetchrow;
|
||||
$cache->set_in_cache($cache_key, $frameworkcode);
|
||||
($frameworkcode) = $dbh->selectrow_array(
|
||||
"SELECT frameworkcode FROM biblio WHERE biblionumber=?",
|
||||
undef, $biblionumber );
|
||||
$cache->set_in_cache( $cache_key, $frameworkcode );
|
||||
}
|
||||
return $frameworkcode;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue