Hello everyone,
i recently developed a confluence plugin which adds some xhtml macros. I just wondered how the image macro preview (while editing a page) is errornous or even fails rendering with a null pointer exception if you write something like {} in your string macro parameters. The final rendered macro would be ok, as seen in MacroBrowser or if you just view the page.
I started playing around, trying to find my mistake and discovered that it seems like this behavior hasn't anything to do with my plugin. I can simply reproduce it in several Confluence versions on different servers:
To reproduce it you can use the Panel macro:
... or the Gallery macro, which is nearly the same procedure but with the difference, that it will cause an heavy error and won't render at all:
It won't break if you escape the curly braces with \{ and \}, but I dont think you have to?! E.g. the Gallery macro would render something like this if you escape the curly braces within the macro properties:
So what is the way to go? Escape curly braces and handle while executing the macro? If so, are there other characters likely to break the macros? Or is it something like a bug of the preview in edit mode (which could be the case because everything seems to render fine with curly braces - outside the edit mode)?
Community moderators have prevented the ability to post new answers.
There was no real discussion about this topic and Steve could confirm that he got this behaviour, too, so I submitted this as a bug which got accepted by now:
https://jira.atlassian.com/browse/CONF-33399
So it really seems to be a bug.
It worked for me in Confluence 5.4 and i had a panel with the text "hello world! {}".
But i think that can happen accidently when you are fast in typing. Maybe you have not recognised selecting the gallery macro?
But I did not use the macro browser, maybe this helps ;)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's not about the macro body, it's about it's properties in MacroBrowser. Please try to type something like this into a string property field like the title / heading of the panel.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Robert, I tried it in the panel title and it workd as well...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
some screenshot:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi again Steve, that looks like the final rendered version of the macro (like the one you get by viewing the page or using the preview in MacroBrowser). The problem I'm facing is only visible while you edit the page and get the WYSIWYG preview of the macro (not in macro browser, neither with the preview button -- directly in TinyMCE).
It would be great if you could show me how your TinyMCE displays this macro.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Take a look on:
We changed our color scheme, so there are some different colors now ;)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for responding again. I'll explain it on your example. Your screenshot is from either the pages preview or from viewing the page. The problem occurs only in the WYSIWYG Editor.
For me the Panel Macro looks like this, too:
But if I edit the page it looks like this in editor:
As you can see, the macros icon and description is missing because of the curly braces in "world{}". If I remove the curly braces from world, the macro looks normal:
How does your makro look like in edit mode?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, I did never come to that point, that this is your problem. Maybe I'm just used on not trusting the editor :D
Yes, it's the same on my instance. But my expectation is never, that I get everything rendered perfectly in the editor. If I need informations on my configuration, I open the macro or just use the preview.
P.S.: I want the wikimarkup back ;)
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.