From f5b61d7cffa919bc31ae6941a1056b5387b025eb Mon Sep 17 00:00:00 2001 From: miker Date: Thu, 13 Nov 2008 15:10:25 +0000 Subject: [PATCH] make aggregate and no_i18n flags perl friendly git-svn-id: svn://svn.open-ils.org/ILS/trunk@11159 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/c-apps/oils_cstore.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/c-apps/oils_cstore.c b/Open-ILS/src/c-apps/oils_cstore.c index d739035643..a4b5321b97 100644 --- a/Open-ILS/src/c-apps/oils_cstore.c +++ b/Open-ILS/src/c-apps/oils_cstore.c @@ -1953,7 +1953,10 @@ static char* SELECT ( if (is_agg->size || (flags & SELECT_DISTINCT)) { - if (!jsonBoolIsTrue( jsonObjectGetKey( selfield, "aggregate" ) )) { + if ( + !jsonBoolIsTrue( jsonObjectGetKey( selfield, "aggregate" ) ) || + ((int)jsonObjectGetNumber(jsonObjectGetKey( selfield, "aggregate" ))) == 1 // support 1/0 for perl's sake + ) { if (gfirst) { gfirst = 0; } else { @@ -2321,8 +2324,10 @@ static char* buildSELECT ( jsonObject* search_hash, jsonObject* order_hash, osrf if (locale) { char* i18n = osrfHashGet(field, "i18n"); - if (jsonBoolIsTrue(jsonObjectGetKey( order_hash, "no_i18n" ))) - i18n = NULL; + if ( + !jsonBoolIsTrue( jsonObjectGetKey( order_hash, "no_i18n" ) ) || + ((int)jsonObjectGetNumber(jsonObjectGetKey( order_hash, "no_i18n" ))) == 1 // support 1/0 for perl's sake + ) i18n = NULL; if ( i18n && !strncasecmp("true", i18n, 4)) { char* pkey = osrfHashGet(idlClass, "primarykey"); -- 2.11.0