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

ClassCastException during staging publishing when a category is assigned to a DLFolder



      1. Create a Document Library Folder and a Category in the default site
      2. Query the dlfolder, assetcategory and user_ database tables, and note the folderId, categoryId and userId values of your folder, category and admin user
      3. Replace <YOUR_CATEGORY_ID>, <YOUR_FOLDER_ID> and <YOUR_USER_ID> with the actual folderId, categoryId and userId values respectively in the attached Groovy script
      4. Run the Groovy script on Control Panel > Server Administration > Script (All this is needed because it's not possible to assign a category to a folder through the UI)
      5. Turn on local staging on the site
      6. Publish to live by making sure Categories are selected to be published

      Result: The publish will fail with ClassCastException

      com.liferay.portal.kernel.exception.SystemException: java.lang.ClassCastException: com.liferay.portlet.documentlibrary.model.impl.DLFolderImpl cannot be cast to com.liferay.portal.kernel.repository.model.Folder

      It looks to be the same issue as LPS-62149 but for folders. The solution can also use the same pattern.

      Master is not affected, because AssetCategories got their own StagedModelDataHandler and the affected code was deleted by LPS-41340


          Issue Links



              • Assignee:
                melody.wu Melody Wu
                gergely.mathe Gergely Mathe (Inactive)
                Participants of an Issue:
                Recent user:
                Marta Elicegui
              • Votes:
                0 Vote for this issue
                0 Start watching this issue


                • Created:
                  Days since last comment:
                  3 years, 11 weeks, 4 days ago


                  Version Package
                  6.2.X EE