Hi, when testing an ACF webapp in Lucee 5.2.x I get a strange occurrence where Javascript that is saved to the database gets all single quotes doubled up. So whereas this works nicely in ACF (as I want it, just write the Javascript as-is to the database-field) in Lucee everything seems to be escaped or so? Using double quotes in the Javascripts does not trigger this behaviour. So this:
<script type="text/javascript">
var hcOption_#randomCode# = '';
hcOption_#randomCode# = jQuery.extend(true,{},highChartDefaultOptions);
hcOption_#randomCode#.chart.height = 400;
hcOption_#randomCode#.chart.renderTo = 'highChartContainer_#randomCode#';
hcOption_#randomCode#.legend.enabled = #IIf(object.get("showLegend") eq 0 or object.get("showLegend") eq "",false,true)#;
hcOption_#randomCode#.xAxis.title.text = '#object.get("xAxisLabel")#';
</script>
turns into this:
<script type="text/javascript">
var hcOption_#randomCode# = '''';
hcOption_#randomCode# = jQuery.extend(true,{},highChartDefaultOptions);
hcOption_#randomCode#.chart.height = 400;
hcOption_#randomCode#.chart.renderTo = ''highChartContainer_#randomCode#'';
hcOption_#randomCode#.legend.enabled = #IIf(object.get("showLegend") eq 0 or object.get("showLegend") eq "",false,true)#;
hcOption_#randomCode#.xAxis.title.text = ''#object.get("xAxisLabel")#'';
</script>
Notice the double single quotes? This breaks my HighCharts rendering as the Javascript is broken. Any ideas why this happens and where I can “untrigger” this behaviour? I cannot find any settings on this in the datasource or anywhere else in Lucee Admin. All content-settings are set to UTF-8, also the template-setting.
The SQL is pretty straightforward:
UPDATE table
SET tableColumn1 = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#object.get('graphhtmlandjavascript')#">
, tableColumn2 = <cfqueryparam cfsqltype="cf_sql_float" value="#now()#">
WHERE tableID = <cfqueryparam cfsqltype="cf_sql_char" value="#object.get('objectID')#">