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

    • Similar Issues:
      Show 4 results 

      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);
      	}
      

        Activity

        Hide
        Cristhian C Lopez added a comment -

        Tested on the just released Liferay 6.1CE GA1 and it's no longer reproducible, this issue can be closed.

        Show
        Cristhian C Lopez added a comment - Tested on the just released Liferay 6.1CE GA1 and it's no longer reproducible, this issue can be closed.
        Hide
        Mika Koivisto added a comment -

        Resolving as no longer reproducible based on Cristhians last comment.

        Show
        Mika Koivisto added a comment - Resolving as no longer reproducible based on Cristhians last comment.
        Hide
        Michael Saechang added a comment -

        Closed as per comments below.

        Show
        Michael Saechang added a comment - Closed as per comments below.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 20 weeks ago

              Development

                Structure Helper Panel