@@ -, +, @@ --- C4/SQLHelper.pm | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) --- a/C4/SQLHelper.pm +++ a/C4/SQLHelper.pm @@ -234,22 +234,22 @@ Get the Primary Key field names of the table sub GetPrimaryKeys($) { my $tablename=shift; - my $result; + my @result; my $cache; if (Koha::Cache->is_cache_active()) { $cache = Koha::Cache->new(); if (defined $cache) { - $result = $cache->get_from_cache("sqlhelper:GetPrimaryKeys:$tablename"); + @result = $cache->get_from_cache("sqlhelper:GetPrimaryKeys:$tablename"); } } - unless (defined $result) { + unless (@result) { my $hash_columns=_get_columns($tablename); - $result = grep { $hash_columns->{$_}->{'Key'} =~/PRI/i} keys %$hash_columns; + @result = grep { $hash_columns->{$_}->{'Key'} =~/PRI/i} keys %$hash_columns; if (Koha::Cache->is_cache_active() && defined $cache) { - $cache->set_in_cache("sqlhelper:GetPrimaryKeys:$tablename", $result); + $cache->set_in_cache("sqlhelper:GetPrimaryKeys:$tablename", @result); } } - return $result; + return @result; } --