diff --git a/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js b/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js index ddb3a34e..aafbc367 100644 --- a/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js +++ b/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js @@ -44,6 +44,8 @@ module.exports = class AggregationMapConfigAdapter { const aggregationColumns = this._getAggregationColumns(aggregation); const layerColumns = mapConfig.getColumnsByLayer(index); + console.log(aggregationColumns, layerColumns); + if (layerColumns.length === 0) { continue; } @@ -210,12 +212,11 @@ module.exports = class AggregationMapConfigAdapter { const hasAggregationColumns = aggregation !== undefined && typeof aggregation !== 'boolean' && typeof aggregation.columns === 'object'; + let aggregationColumns = []; if (hasAggregationColumns) { - aggregationColumns = Object.keys(aggregation.columns).map(key => { - return aggregation.columns[key].aggregated_column; - }); + aggregationColumns = Object.keys(aggregation.columns); } return aggregationColumns;