Dear community,
In the past, we had a user macro which showed us the incoming links to a page.
A simple code snippet can look like this (waayyy reduced):
01: #set($incLinks = $action.getIncomingLinks())
02: #foreach ($incLink in $incLinks)
03: $inkLink.getSourceContent()
04: #end
After updating to Confluence 9.2.0 Data Center recently, this doesn't work anymore. This doesn't seem to be related to the Velocity macro security settings introduced way back. I don't see how since we are just calling a method on an POJO from Velocity.
Line 01: works
Line 02: works
Line 03: well... if we do a .getClass() on it, it returns "com.atlassian.confluence.links.OutgoingLink", as expected. However, all the methods - expect getId() and toString() - return ... nothing / null.
Since when can't we call methods from velocity on a POJO in Confluence anymore? Is there any workaround besides creating our own plugin in for this simple functionality?
toString even gives a text representation of the link like "<space key>:<page title>". It isn't that the object is empty.
To make matters weird: the "<space key>:<page title>" isn't even the one from the link. Rather it is the page itself. Why? ¯\_(ツ)_/¯
Any advice is appreciated
Janek
PS: I know there are plenty of payed plugins on the marketplace for this. But come on: no sales pitch here. This is such a simple functionality that paying for it seems like a rip off. Especially since user macro solved this for free for the last 20 years. ;-)
The first idea that comes to my mind if those methods are disabled by the Velocity allowist? Atlassian restricts the allowed methods release by release.
Which version did you upgrade from where this was last working?
Aside from the above - I don't really have an answer or other suggestion for you - its likely Atlassian removed some old/deprecated code that allowed this to work in the past since with Confluence 9 they removed a lot of legacy stuff from the codebase (at least external gadgets is being put back soon).
Perhaps writing your own plugin for this is the way to go moving forward but I can understand the extra work / upkeep required for this might not make it worthwhile.
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.