User macro not working after upgrade to 7.12.3
Asked by Kathryn Reddie:

Hi experts,

We are experiencing a problem with a user macro not displaying icons after upgrading to 7.12.3 over the weekend.

A user macro that has always worked that displays an icon (that the user selects from another page and copies in the URL to), with text and a hyperlink to a page is now not displaying the icon.

Does anyone know why this might have stopped working? Is there some config we need to do to enable this? I've tried to see what I could find but am drawing a blank.

Details of behaviour below.

Thanks in advance.  
Kathryn.

It is now displaying \<img src="[https://intranet.xxx.xxx.xx/download/attachments/3810922222/Document-red.png?version=1\&amp;modificationDate=1455518232000\&amp;modifcationDate=1455518232000\&amp;api=v2](https://intranet.xxx.xxx.xx/download/attachments/3810922222/Document-red.png?version=1&amp;modificationDate=1455518232000&amp;modifcationDate=1455518232000&amp;api=v2)' class='img-responsive'\> Forms \& Email templates

The link is still working though.

Here's my user macro:

## [@Param](/t5/user/viewprofilepage/user-id/1345631) Title:title=Title\|type=string\|required=true  
## [@Param](/t5/user/viewprofilepage/user-id/1345631) Subtitle:title=Subtitle\|type=string\|desc=Optional subtitle\|required=false  
## [@Param](/t5/user/viewprofilepage/user-id/1345631) page:title=Page, email or external URL\|type=confluence-content\|desc=External URL must start with https\|required=false  
## [@Param](/t5/user/viewprofilepage/user-id/1345631) IconLink:title=Icon\|type=string\|required=false\|desc=Display a custom icon by entering the URL of the image. \<a href="<https://intranet.xxx.xxx.xx/display/XXX/Icon+suite+-+intranet+only>" target="_blank"\>\<b\>View available icons\</b\>\</a\>  
## [@Param](/t5/user/viewprofilepage/user-id/1345631) TitleColor:title=Title colour\|type=enum\|enumValues=blue,gray,red\|required=true\|desc=Select colour for the title text\|default=blue  
## [@Param](/t5/user/viewprofilepage/user-id/1345631) Background:title=Background colour\|type=enum\|enumValues=blue,light-blue,gray\|required=true\|desc=Select a background colour\|default=gray  
## [@Param](/t5/user/viewprofilepage/user-id/1345631) IconAlign:title=Center align?\|type=boolean\|desc=Set center alignment. Unchecked will align left.\|default=true

<br />

#set ( $colonIndex = $parampage.indexOf(":") )  
#if ( $colonIndex == -1 )  
#set ( $spaceKey = $space.key )  
#set ( $pageName = $parampage )  
#else  
#set ( $spaceKey = $parampage.substring(0, $colonIndex) )  
#set ( $pageNameIndex = $colonIndex + 1 )  
#set ( $pageName = $parampage.substring($pageNameIndex) )  
#end

## Get the Page object instance  
#set ( $page = $pageManager.getPage($spaceKey, $pageName) )

## Get the URL path from the Page object instance  
#if ($parampage.startsWith("https"))  
#set ($pageLink = $parampage)  
#elseif ($parampage.contains("@"))  
#set ($pageLink = ("mailto:$parampage"))  
#else  
#set ($pageLink = $page.urlPath)  
#end

#if ($paramIconAlign == false)  
#set ($alignment = ("icon-left"))  
#end

#if ($paramTitleColor == "red")  
#set ($LinkColor = ("red-text"))  
#elseif ($paramTitleColor == "gray")  
#set ($LinkColor = ("gray-text"))  
#else  
#set ($LinkColor = ("blue-text"))  
#end

#if ($paramIconLink)  
#set ($Icon = ("\<img src='$paramIconLink' class='img-responsive'\>"))  
#end

#if ($paramSubtitle)  
#set ($subtitle = ("\<span class='subtitle'\>$paramSubtitle\</span\>"))  
#end

\<div class="icon-widget $paramBackground $LinkColor $!alignment"\>  
#if ($parampage)  
\<a href="$pageLink"\>$!Icon\<span\>$paramTitle\</span\>$!subtitle\</a\>  
#else  
\<a href="javascript\&colon;void(0);"\>$!Icon\<span\>$paramTitle\</span\>$!subtitle\</a\>  
#end  
\</div\>


Answers:
author: Francisco Villar Romasanta
body: Try this fix, variables must contain html in the name otherwise the html will be escaped

<https://community.atlassian.com/t5/Confluence-questions/HTML-is-not-parsed-from-a-User-Macro-in-Confluence-7-11-0/qaq-p/1618139>


author: Alexis Robert
body: Hi [@Kathryn Reddie](/t5/user/viewprofilepage/user-id/1117666) ,

there might be several reasons why the user macro stopped working. Ususally, to investigate this kind of issue I'd advise you to start Confluence in [Safe Mode](https://confluence.atlassian.com/upm/disabling-and-enabling-apps-273875716.html) 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

comments: author: Kathryn Reddie
body: Thanks Alexis,

I started in Safe Mode in our DEV environment, but the problem was still present.

Does that mean it's an issue with the new version of Confluence itself?

Or should I delete and recreate the user macro?

Thanks again,  
Kathryn.


author: Francisco Villar Romasanta
body: (double comment, please delete)


Tags: confluence-server

server