Uploaded image for project: 'CMS'
  1. CMS
  2. CMS-11711

Wrong "viewUrl" for a file element type

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 4.7.4, 4.8.0
    • None
    • None
    • None
    • 4.8.0 M3

      The viewUrl is built as an image URI bounded to 100x100px, whatever the file type (image or not). See ResourceElementTypeHelper.

      String viewUrl = ResolveURIComponent.resolveBoundedImage(fileType, fileURI, 100, 100);
      String downloadUrl = ResolveURIComponent.resolve(fileType, fileURI, true);
      

      This viewUrl can not work for file that is not image

      For example, in forms, the viewUrl of a PDF is
      http://localhost:8080/cms/intranet/_object/ametys-internal%253Asites/intranet/ametys-internal%253Aplugins/formsdirectory/ametys%253Aforms/Demandes/Demande%20travaux%20reprographie/ametys-internal%253Aform-entries/entry-1/_attribute/fichier/Travail%20collaboratif%20avec%20Ametys_max100x100.pdf?contentVersion=&objectId=form-entry://77f3c49e-9e9b-45ee-9e2c-c461ba48120f
      which leads to a 404

      I think the uri is simply ResolveURIComponent.resolveBoundedImage(fileType, fileURI, but what but what are the impacts on the illustration thumbnail in the online editor? All use of "viewUrl" should be checked

            cbayle Caroline Bayle
            laurence Laurence Aumeunier
            Caroline Bayle Caroline Bayle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: