Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-20367

Attachment selector doesn't use the sourceDocument reference

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 15.0-rc-1, 14.10.2
    • 14.6-rc-1
    • CKEditor
    • None
    • Unknown
    • N/A
    • N/A

    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

          Activity

            People

              mleduc Manuel Leduc
              surli Simon Urli
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: