Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-24692

Upgrade to 6.1 failed on Document Library migration when using AdvancedFileSystemHook and generating thumbnails

    Details

      Description

      I'm testing upgrade from 6.0.6 to 6.1 RC1, I'm getting a java.io.FileNotFoundException when the migration process is trying to generate the thumbnails for images stored on the document library.
      After some debug I found that it's caused for a piece of code that doesn't set the extension for the DLFileVersion object, and on the ImageProcessor class it's building the path based on the extension, but the extension is null, so the generated path for the AdvancedFileSystemHook is invalid for the OS, so the parent folder for the file isn't generated. These are the code pieces. You can see the wrong path generated on the image attached.

      //This is UpgradeDocumentLibrary.java line 448
      // NOT SETTING THE extension PROPERTY
      dlFileVersion.setFileVersionId(fileVersionId);
      dlFileVersion.setUserId(userId);
      dlFileVersion.setFileEntryId(fileEntryId);
      dlFileVersion.setMimeType(mimeType);
      dlFileVersion.setVersion(version);
      
      //This is ImageProcessor.java line 280
      // Using the getExtension() method from the FileVersion created before, but it returns null.
      private String _getType(FileVersion fileVersion) {
      		String type = fileVersion.getExtension();
      
      		if (type.equals("jpeg")) {
      			type = "jpg";
      		}
      
      		return type;
      	}
      
      //This is DLPreviewableProcessor.java line 331
      // Generating the path for the thumbnail using the concat(StringPool.PERIOD).concat(type) but type is null because the previous method returns null
      protected String getThumbnailFilePath(
      		FileVersion fileVersion, String type) {
      
      		return getPathSegment(fileVersion, false).concat(
      			StringPool.PERIOD).concat(type);
      	}
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                5 years, 32 weeks, 3 days ago