From 9a1bc51fdbff79ee5d38f4198ebd3ea1ab5db123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Thu, 28 Dec 2017 13:12:41 +0100 Subject: [PATCH] Use aggregation-mapconfig's method to discover columns to be exposed used to aggregate --- .../mapconfig/adapter/aggregation-mapconfig-adapter.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js b/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js index 79bd6527..28cbffc9 100644 --- a/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js +++ b/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js @@ -101,18 +101,13 @@ module.exports = class AggregationMapConfigAdapter { aggregationSql = sqlQueryWrap.replace(/<%=\s*sql\s*%>/g, aggregationSql); } - if (!mapConfig.isDefaultLayerAggregation(index)) { - layer.options.sql = aggregationSql; - return resolve({ layer, index, adapted: shouldAdapt }); - } + layer.options.sql = aggregationSql; - const skipGeoms = true; - mapConfig.getLayerColumns(index, skipGeoms, (err, columns) => { + mapConfig.getLayerAggregationColumns(index, (err, columns) => { if (err) { return reject(err); } - layer.options.sql = aggregationSql; layer.options.columns = columns; return resolve({ layer, index, adapted: shouldAdapt });