Description
The attachment selector always use the current document for listing the attachments and for resolving the references, which is wrong since we provide a sourceDocument to use for such cases, which is used for uploading attachments.
Reproduction steps:
- Create a page Test.XClass.WebHome containing a textarea property named "test" that uses WYSIWYG editor and Wiki Syntax
- Create a page Test.XObj.WebHome containing an xobject of type XClass previously created
- Create a page Test.Test containing the following piece of code:
{{velocity}} #set ($myDoc = $xwiki.getDocument('Test.XObj.WebHome')) #set ($myObj = $myDoc.getObject('Test.XClass.WebHome')) $myObj.display('test', 'edit') {{/velocity}}
- Upload an attachment in the attachment tab of Test.XObj.WebHome
- On the displayed editor click on "link" and select "attachment"
Expected result:
- the attachment selector is opened on page Test.XObj since it's where the xobject is stored
- if an attachment is selected from current page (Test.Test), it's resolved in taking into account that the xobject is stored in Test.XObj
Obtained result:
- the attachment selector is opened on current page
- when inserting a link for an attachment, it's resolved relatively to current page Test.Test
Attachments
Issue Links
- causes
-
XWIKI-20535 local page suggestions in the link editor not appearing
- Closed
- relates to
-
CRAPP-215 Attachments added to comments are lost
- Closed