Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 3.0
-
Fix Version/s: 4.1, 4.2-milestone-1
-
Component/s: Other
-
Labels:None
-
Documentation:n/a
-
Documentation in Release Notes:n/a
-
Similar issues:
XE-864New macro for selecting an attachment name to use in an object property XE-1156XWiki.AttachmentSelector does not work when Class has multiple Sheets bound XE-398The same tag can be entered multiple times on one page XE-1169Add target attachment document support to XWiki.AttachmentSelector macro XE-878Small portion of Browse button not visible in Inline mode XE-707By default Global users cannot view a wiki XE-1274Attachment Selector macro does not have translation keys XE-1032Error at first-time starting after upgrade to XE 3.2: $Proxy148 cannot be cast to oracle.sql.CLOB XE-719Add a spaces macro to list all the spaces in the wiki XE-439Rewrite the Main.SpaceIndex page using the #livetable macro
Description
This is about this macro http://extensions.xwiki.org/xwiki/bin/view/Extension/Attachment+Selector+Macro .
When used twice on the same page with displayImage=true, second time it will not display the image properly, because the link to the image is wrongly generated (it has a "||" at the end).
The two pipes are caused by the fact that when the image is generated, there are some parameters generated for it, which are separated by the image link with "||", like this:
#if ("$!{imageParams}" != '') #set ($imageParams = "||${imageParams.trim()}") #endSince the imageParams variable is not reset before being used, and multiple velocity scripts on the same page share variables, the second usage of the attachments selector macro is inheriting the value of the $imageParams variable set by the first usage of the attachments selector macro, thus duplicating the "||", which makes one be used as separator and the other as part of the link itself.