From 0129daba3c7ddec8c806f08ea6f334ffac4cde92 Mon Sep 17 00:00:00 2001 From: Jeff Davis Date: Thu, 4 May 2023 11:13:42 -0700 Subject: [PATCH] LP#2018534: treat year as numeric when retrieving item circs by year The open-ils.pcrud.search.circbyyr API uses EXTRACT to extract the year from circulation timestamps. In recent versions of Postgres, the return type for EXTRACT was changed from double precision to numeric (thanks to Jason Boyer for noticing this!); for obscure reasons, this causes pcrud to return the year as a string instead of a number. So, let's get the staff client to force those values to be numbers before doing math with them. Signed-off-by: Jeff Davis Signed-off-by: Mike Rylander --- Open-ILS/web/js/ui/default/staff/cat/item/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Open-ILS/web/js/ui/default/staff/cat/item/app.js b/Open-ILS/web/js/ui/default/staff/cat/item/app.js index f7220130bd..4869605bf2 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/item/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/item/app.js @@ -1129,7 +1129,7 @@ console.debug($scope.copy_alert_count); $scope.circ_counts = counts.reduce(function(circ_counts, circbyyr) { var count = Number(circbyyr.count()); - var year = circbyyr.year(); + var year = Number(circbyyr.year()); var index = circ_counts.findIndex(function(existing_count) { return existing_count.year === year; -- 2.11.0