Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-54125

Older JPG attachment version preview the latest version in Confluence

    XMLWordPrintable

Details

    Description

      STEPS TO REPLICATE

      1. Navigate to Confluence Page > Attachments.
      2. Attach first version of JPG image in the attachment.
      3. Attach second version of the JPG image in the attachment with the same attachment name.
      4. Click to preview the first version of the JPG image.

      EXPECTED BEHAVIOUR
      Confluence preview the first version of the JPG image.

      ACTUAL BEHAVIOUR
      Confluence preview the second version (latest) of the JPG image but the URL is pointing to version=1:

      <BASE_URL>/download/attachments/1966087/example.jpg?version=1&amp;modificationDate=1509703152000&amp;api=v2

      WORKAROUND
      1 Convert the attachment into .png and reattach them.
      2. There is another workaround by manipulating the contentproperties

      • Note the CONTENTID of the JPG image
        select contentid from content where title = '<JPG attachment title>' and contenttype='ATTACHMENT' 
      • Update the CONTENT table by replacing .jpg in the title by .png
        update content set title='<title of attachment>.png',lowertitle='<title of attachment>.png' where
        contentid in (select contentid from content where title = '<JPG attachment title>' and contenttype='ATTACHMENT')
      • Update the CONTENTPROPERTIES table to change the MEDIATYPE property
        update contentproperties set stringval='image/png'  where  propertyname='MEDIA_TYPE' and contentid in (select contentid from content where title = '<JPG attachment title>' and contenttype='ATTACHMENT')
      • Flush the Cache or Restart Confluence to see the changes in UI

      Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first

      NOTE
      This bug currently affect only .jpg attachment

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dazmi Dayana
              Votes:
              39 Vote for this issue
              Watchers:
              34 Start watching this issue

              Dates

                Created:
                Updated: