The problem seems to be in {{AttachmentSelector.xml}} in the rendering macro definition, in {{#attachmentPicker_displayAttachment}}:
{noformat} (% class="$!{cssClass}#if (!$attachment) hidden#end" %)(((#if ("$!{attachmentResource}" != '' || $forceElement)#if($withLink)[[#end[[image:$services.rendering.escape(${attachmentResource}, 'xwiki/2.1')$!{imageParams}]]#if($withLink)>>attach:$services.rendering.escape(${attachmentResource},'xwiki/2.1')||rel=lightbox]]#{end}#end)))## {noformat}
When there's no {{defaultValue}} macro parameter specified and the image specified in the call to the attachment selector macro doesn't exist, then {{$attachmentResource}} is empty and since {{#attachmentPicker_displayAttachment}} is called with {{$forceElement}} set to true at the following place, the image reference is set to be "filename" which doesn't exist and cause the warnings:
{noformat} (% class="attachment-picker" %)(((## #attachmentPicker_displayAttachment($propValue $displayImage false true) #attachmentPicker_displayButton()## {{html}}<input type="hidden" name="$escapetool.xml("${classname}_${object}_${property}")" value="$escapetool.xml("${propValue}")" class="property-reference"/>{{/html}}## ))) {noformat}
What I don't understand is the intent for {{$forceElement}} and why it's always passed as true. Setting it to false fixes the issue (but the selector doesn't work anymore) .
[~mflorea] it seems you developed this part, do you remember why there's {{$forceElement}} and why it's always passed as true?
Thanks |
|