User macro place-holder fails to load due to image not being publicly accessible
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
e
Problem
When inserting a user macro in the editor, the user macro place-holder would not load, and the page editor becomes unresponsive. The following stack trace can be seen in the logs:
The following appears in the atlassian-confluence.log
:
1
2
3
4
5
java.lang.NullPointerException
at com.atlassian.confluence.tinymceplugin.placeholder.DefaultPlaceholderImageFactory.getIcon(DefaultPlaceholderImageFactory.java:188)
at com.atlassian.confluence.tinymceplugin.placeholder.DefaultPlaceholderImageFactory.getPlaceholderImage(DefaultPlaceholderImageFactory.java:72)
at com.atlassian.confluence.tinymceplugin.placeholder.MacroPlaceholderServlet.getPlaceholderImage(MacroPlaceholderServlet.java:130)
at com.atlassian.confluence.tinymceplugin.placeholder.MacroPlaceholderServlet.doGet(MacroPlaceholderServlet.java:101)
Cause
The most plausible reason for this is that the image defined as the user macro's icon URL is not publicly accessible by the TinyMCE Plugin. This has been tracked as an improvement request here: CONFSERVER-24857 - Allow Confluence to Use Attached Images as User Macro Icon.
Resolution
There are two workarounds that can be used to overcome this:
Image Within Confluence
Create a new directory inside
CONFLUENCE_INSTALL/confluence/images
.Place the image for the icon inside the created directory.
Access Confluence's User Macro settings via
Browse > Confluence Admin > User Macros
.Under Icon URL for the user macro, enter a relative path to the image as per directory created in step two (2) above. For example:
/images/user_macro_icons/test.jpg
Save the user macro.
Now you can insert the user macro into any page/space/blog and the user macro place-holder would load.
Image in a Public Domain/Storage
Place the image for the icon inside a public domain/storage (e.g. Dropbox).
Access Confluence's User Macro settings via
Browse > Confluence Admin > User Macros
.Under Icon URL for the user macro, enter the absolute URL to the image as copied in step one (1) above. For example:
http://dl.dropbox.com/u/3233473/test.jpg
Save the user macro.
Now you can insert the user macro to any page/space/blog and the user macro place-holder would load.
ℹ️If the issue does not resolve itself, try to clear the following:
Clear the Confluence cache:
Browse > Confluence Admin > Cache Statistics > Flush all
Clear your browser cache and cookies.
Was this helpful?