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

getRenderedContent uses the context document instead of the target document

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • 2.0 M1
    • {Unused} Core
    • None
    • any
    • rendered content
    • Unknown

    Description

      Follow this steps to reproduce:

      • create a new document called X.A
      • attach an image to X.A
      • set the content of X.A to:
        image:attachedImage.png
        

        (replace attachedImage.png with the name of your image)

      • create a new document called X.B
      • set the content of X.B to:
        {{velocity}}{{html}}$xwiki.getDocument("X.A").getRenderedContent(){{/html}}{{/velocity}}
        

      As a result the image is visible on X.A but not on X.B. If you look at the HTML of X.B you can see that the image is considered to be an attachment of X.B instead of X.A:

      /xwiki/bin/download/X/B/attachedImage.png
      

      while the HTML of X.A has (correctly):

      /xwiki/bin/download/X/A/attachedImage.png
      

      Attachments

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              mflorea Marius Dumitru Florea
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: