From 3e94e3288fa6a75cbb78ebacc06ac7f0355c4e07 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Fri, 6 May 2016 17:09:41 +0200 Subject: [PATCH] Use sql as replacement variable --- lib/cartodb/models/analysis-mapconfig-adapter.js | 2 +- test/acceptance/analysis/analysis-layers.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cartodb/models/analysis-mapconfig-adapter.js b/lib/cartodb/models/analysis-mapconfig-adapter.js index c7e788f9..2897114b 100644 --- a/lib/cartodb/models/analysis-mapconfig-adapter.js +++ b/lib/cartodb/models/analysis-mapconfig-adapter.js @@ -142,7 +142,7 @@ AnalysisMapConfigAdapter.prototype.getMapConfig = function(analysisConfiguration var analysisSql = layerQuery(layerNode.getQuery(), layerNode.getColumns()); var sqlQueryWrap = layer.options.sql_wrap; if (sqlQueryWrap) { - analysisSql = sqlQueryWrap.replace(/<%=\s*__analysis_query\s*%>/g, analysisSql); + analysisSql = sqlQueryWrap.replace(/<%=\s*sql\s*%>/g, analysisSql); } layer.options.sql = analysisSql; var layerDataviews = getLayerDataviews(layer, dataviews); diff --git a/test/acceptance/analysis/analysis-layers.js b/test/acceptance/analysis/analysis-layers.js index 560c938b..a19128b0 100644 --- a/test/acceptance/analysis/analysis-layers.js +++ b/test/acceptance/analysis/analysis-layers.js @@ -337,7 +337,7 @@ describe('analysis-layers', function() { "source": { "id": "2570e105-7b37-40d2-bdf4-1af889598745" }, - "sql_wrap": "SELECT * FROM (<%= __analysis_query %>) __wrapped WHERE adm0cap = 1", + "sql_wrap": "SELECT * FROM (<%= sql %>) __wrapped WHERE adm0cap = 1", "cartocss": DEFAULT_MULTITYPE_STYLE, "cartocss_version": "2.3.0" }