Affects Version/s: 13.7
Fix Version/s: None
Component/s: Rendering - WikiMacro
Prerequisites: Have PDF Viewer Macro (Pro) version 2.2.1 installed on the main wiki and get a trial license.
Steps to reproduce:
- Login with superadmin and edit XWiki.PDFViewerMacro to display, besides the pdf, the type of the file parameter by adding inside Macro code
($wikimacro.parameters.file should invoke a Converter for the file parameter in case it can be found, since this parameter has a Java type defined)
- View XWiki.PDFViewerMacro and see that the above code is not returning something
- Locally update macro-pdfviewer's code to contain a converter from String to PDFResourceReference https://github.com/oanalavinia/macro-pdfviewer/blob/master/api/src/main/java/com/xwiki/pdfviewer/PDFResourceReference.java, which is the file parameter type (I added the Converter here https://github.com/oanalavinia/macro-pdfviewer/commit/cf0182f15533c789f6751b90df0f283632b60b53 )
- Build the new version and upgrade the macro to it
- Go to XWiki.PDFViewerMacro
The newly added converter is found and the added code will return com.xwiki.pdfviewer.PDFResourceReference.
The result for the added code is still $wikimacro.parameters.file.class.name as if there isn't any converter
At this point I tested the following groovy script and the converter was found (returns com.xwiki.pdfviewer.internal.PDFResourceReferenceConverter@58bb77d8)
After this I restarted the instance and checked XWiki.PDFViewerMacro, where now the converter is found and I get the following result:
I got the same result with just resaving XWiki.PDFViewerMacro page (with superadmin, since the application is under a license)