Hi,
Before upgrading to 7.4.11, we had user macros with enum values as options with "&" symbol and they were working fine. But after upgrade we observe that user macro is not working when user selects the option with & symbol like "name&product".
When user selects "all" enum option in the macro below, it works fine and outputs
Parameter enum option = all
When user selects "name&product" enum option if condition does not work and outputs in the page - "Parameter $PeriodQueryString" - which is not correct
Expected output on the page is "Parameter enum option = name&product"
Sample custom user macro is like this
## This is an example macro
## @param GroupByField:title=Report grouped By Fields|type=enum|enumValues=all,name&product
#if($paramGroupByField == "all")
#set($PeriodQueryString=" enum option = $paramGroupByField")
#elseif($paramGroupByField == "name&product")
#set($PeriodQueryString=" enum option = $paramGroupByField")
#end
Parameter $PeriodQueryString
Can you please let me know what could be the reason for such a changed behavior?
Thank you
with warm regards
ramki
@Alexis Robert Thank you again, I tried escaping it did not work.
I continued my attempts. This worked when I changed the line
from
#elseif($paramGroupByField == "name&product")
to
#elseif($paramGroupByField.replace("&", "&") == "name&product")
added .replace("&", "&") to the user input parameter variable.
not sure about the any other impact, atleast I can get my macros work I think.
there could be a few reasons why your user macro stopped working.
First, to investigate this kind of issue you should start Confluence in Safe Mode and check if the problem is still present.
Then I would activate one by one the addons, because there might be a conflict with a specific new version that prevents your user macro from working.
Let me know if this helps,
--Alexis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Alexis Robert Thank you for the response. I will try that in my staging setup, but do you think that the problem not recognizing enumValue option with "&" can arise from other add-ons. My knowledge here is limited so please bear with me for this very basic question.
Also, I found that if I change the option from "name&product" to "name-product", the macro starts working. So, I think somewhere "&" symbol in velocity template lost its characteristic.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There might be a change in how Confluence handles special characters, it's hard to say since a lot of stuff is updated between two releases, even internal components can have an impact on this kind of stuff.
In your case it might be just this : an update somewhere that prevents using special characters, so maybe switching from "&" to "-" is the solution here !
Maybe you can try esacaping the character, like this : "\&" ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.