Uploaded image for project: 'Magnolia DAM Module'
  1. Magnolia DAM Module
  2. MGNLDAM-419

getFileName/getFileExtension not properly (re-) implemented for 1.x assets in AssetWrapper

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Neutral Neutral
    • 2.0.2
    • 2.0
    • DAM App, DAM JCR Provider
    • None

      info.magnolia.dam.asset.AssetWrapper#getFileExtension currently returns "" (or something if there happens to be a dot in the filename), because pre-2.0 assets had two properties: "fileName" and "extension".

      The specs of are clear:

          /**
           * Returns the "preferred" file name for this asset's binary. The returned name should include the file's extension
           * (if any), but not its path.
           */
          String getFileName();
      

      However, this doesn't make any assumptions/implications on the storage. One simple assumption to make in JcrAsset would be that "if property 'extension' exists, we're dealing with a 1.x Asset" and have getFileName() take that into account.
      Ideally, UI components will lazily update such nodes (when edited), so that we don't actually have to migrate existing content.

        Acceptance criteria

              ehechinger Eric Hechinger
              gjoseph Magnolia International
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD