From e7211b502f97d3eec68982f5c08192c74dc397cf Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 3 Jul 2023 13:30:56 -0300 Subject: [PATCH] Bug 33974: (follow-up) biblionumber column needs special handling This patch makes a particular use case be handled correctly: i.e. no context is passed (e.g. 'biblio' explicitly) and the query is done against the `biblio_id` attribute. This results in the following DBIC error: [ERROR] GET /api/v1/biblios: unhandled exception (DBIx::Class::Exception)<> With this patch, this is no longuer the case :-D Signed-off-by: Tomas Cohen Arazi (cherry picked from commit ba80c71e63549e60fcdd5666bd2484b75e5a174d) Signed-off-by: Martin Renvoize (cherry picked from commit 35d1f812778dcd8d538f1781b224d41a09be3e79) Signed-off-by: Matt Blenkinsop --- Koha/Biblios.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Koha/Biblios.pm b/Koha/Biblios.pm index e43b63fbff..0cc05aaba8 100644 --- a/Koha/Biblios.pm +++ b/Koha/Biblios.pm @@ -93,6 +93,8 @@ sub api_query_fixer { } else { $query =~ s/${quotes}(age_restriction|cn_class|cn_item|cn_sort|cn_source|cn_suffix|collection_issn|collection_title|collection_volume|ean|edition_statement|illustrations|isbn|issn|item_type|lc_control_number|notes|number|pages|publication_place|publication_year|publisher|material_size|serial_total_issues|url|volume|volume_date|volume_description)${quotes}/${quotes}biblioitem\.$1${quotes}/g; + $query =~ # handle ambiguous 'biblionumber' + s/${quotes}(biblio_id)${quotes}/${quotes}me\.$1${quotes}/g; } return $query; -- 2.39.5