When I put a {userMacro} inside a [link to {userMacro}] it doesn t get resolved at the right time. Confluence wants to create a page, though the link exists.
Solution?
Thx
G.
I would suggest you modify the userMacro in question to just generate the link rather then the page name.
Thanks, I did just this, but isn t the resolution order violation a major bug?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guenter,
I'm not so sure this is a bug, major or minor. The output from a user macro could be anything, not just text. I guess Confluence is playing it safe and saying that a text string is expected between [ and ], hence it doesn't parse the contents for any user macro processing.
Regards,
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, thanks, my opinion is that expressions should be parsed in the right order, no matter what - and they could throw an error still if it evaluates to something the browser can t handle.
The currents behavior fits well with Confluence s other inconsistencies.
G.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Guenter - if you feel strongly, I suggest you raise a well-worded ticket here, https://jira.atlassian.com and make your case for the Atlassian team to address. If feasible and highly desired they usually will deliver.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Guenter - I would also be interested to know what version of Confluence you are using.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good idea, Daniel!
5.1.3, so I need to re-test how much this applies to a version > 4. We were at 3.5.9 until recently.
Just tested this quickly and saw that a Link > Advanced [link to {userMacro}] renders an internal server error.
Needa rethink the whole dynamic link thing.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As I couldn t find a way to put a macro inside a link I had to code the whole thing as XHTML:
## @noparams #set($len1 = $space.key.length() - 2) #set($len2 = $space.key.length() - 1) #set($sub0 = $space.Key.substring($len2)) #set($sub1 = $space.Key.substring($len1, $len2)) #set($sub2 = $space.Key.substring($len1, $len2)) #set($sub3 = $space.Key.substring($len2)) <ac:link> <ri:page ri:content-title="page title part 1 #if ($sub0 == "0")$sub1#else$sub2.$sub3#end page title part 2" ri:space-key="SPACEKEY"/> </ac:link>
As I got no answer to the https://answers.atlassian.com/questions/205782/velocity-expression-as-argument/205824 I had to put the argument expressions into variables.
G.
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.