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

    Details

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  2 years, 15 weeks, 4 days ago

                  Packages

                  Version Package
                  6.2.X EE