We have a couple of macros to show SQL query where one of the sample code is as below
--------------------------------------
## @Param ReportTitle:title=Report Title|type=string|required=false
#set($paramReportTitle="Resource Planning Report - " + $content.currentDate)
#set($doubleQuote = '"' )
#set($sqlQuery = "SELECT id AS ${doubleQuote}JI ID${doubleQuote} FROM jiraissue LIMIT 1;")
$sqlQuery
---------------------------------------
It was working fine till the confluence 7.6 version but after 7.7 the output got changed
Below is the result with confluence 7.6-
Below is the result with confluence 7.7-
We expect native behavior of confluence where '"' should be in the output in the query instead of '"' in 7.7 version of the confluence.
Please suggest a solution or workaround to get proper output with confluence 7.7.
As per https://community.atlassian.com/t5/Confluence-questions/User-macro-fails-after-update-from-7-4-to-7-13/qaq-p/1857468 , For Confluence 7.7 and above, it seems Confluence performs htmlencoding for every variable that is used as output, except the name of the variable ends with "Html". So in the discussed case here, name the variable "includelineHtml" instead of "includeline". That should work then"
So in the case of your User macro, you have to add html at the end of doubleQuote variable.
USE THIS
## @noparams ## @Param ReportTitle:title=report-title|type=string|required=false #set($paramReportTitle="resource-planning-report-" + $content.currentDate) #set($doubleQuoteHtml = '"' ) #set($sqlQuery = "SELECT id AS ${doubleQuoteHtml}JI ID${doubleQuoteHtml} FROM jiraissue LIMIT 1;") $sqlQuery
Instead of
@Param ReportTitle:title=Report Title|type=string|required=false #set($paramReportTitle="Resource Planning Report - " + $content.currentDate) #set($doubleQuote = '"' ) #set($sqlQuery = "SELECT id AS ${doubleQuote}JI ID${doubleQuote} FROM jiraissue LIMIT 1;")$sqlQuery
I tested this in my local instance running 7.7.2 and it works
Regards,
Anuj Sharma
Could you point us and other user macro enthusiast to where this is documented, please?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.