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

AssetEntry is not correctly created when importing a LAR with a expired webcontent that doesn't have 1.0 version

    Details

      Description

      AssetEntry is not correctly created when importing a LAR with a expired webcontent that doesn't have 1.0 version

      Steps to reproduce

      1. Create a new site called site1
      2. Create a webcontent called wc1
      3. Edit the webcontent three or four times in order to have several versions
      4. Go to version history and delete version 1.0
      5. Expire the webcontent
      6. Export the webcontent to a LAR file
      7. Create a new site called site2
      8. Import the webcontent inside site2
      9. Execute following SQL that returns the JournalArticles with missing AssetEntry:
        select * from JournalArticle where resourcePrimKey not in (select classPk from AssetEntry)
        • Expected behavior: SQL doesn't return any result
        • Wrong behavior: SQL returns the JournalArticle entries from wc1 because they don't have AssetEntry
      10. Additional error: If you are in Liferay 7.2, 7.3 or master, if you go to site => content => webcontent and you select the "list" or "table" view, it will fail because these views are using the AssetEntry object, following exception will be shown in the log
        2020-06-03 13:24:20.490 ERROR [http-nio-9080-exec-2][IncludeTag:128] Current URL /en/group/missingassetentry/~/control_panel/manage?p_p_id=com_liferay_journal_web_portlet_JournalPortlet&p_p_lifecycle=0&p_p_state=m
        aximized&p_p_mode=view&_com_liferay_journal_web_portlet_JournalPortlet_displayStyle=list&p_p_auth=ZAFlHnn5 generates exception: com.liferay.asset.kernel.exception.NoSuchEntryException: No AssetEntry exists with th
        e key {classNameId=28801, classPK=47990}
        com.liferay.asset.kernel.exception.NoSuchEntryException: No AssetEntry exists with the key {classNameId=28801, classPK=47990}
        	at com.liferay.portlet.asset.service.persistence.impl.AssetEntryPersistenceImpl.findByC_C(AssetEntryPersistenceImpl.java:3654)
        	at com.liferay.portlet.asset.service.impl.AssetEntryLocalServiceImpl.getEntry(AssetEntryLocalServiceImpl.java:297)
        	at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:66)
        	at com.liferay.asset.kernel.service.AssetEntryLocalServiceWrapper.getEntry(AssetEntryLocalServiceWrapper.java:604)
        	at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:66)
        	at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50)
        	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:69)
        	at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57)
        	at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49)
        	at com.liferay.asset.kernel.service.AssetEntryLocalServiceUtil.getEntry(AssetEntryLocalServiceUtil.java:583)
        	at com.liferay.asset.kernel.model.BaseAssetRendererFactory.getAssetEntry(BaseAssetRendererFactory.java:60)
        	at com.liferay.depot.web.internal.asset.model.DepotAssetRendererFactoryWrapper.getAssetEntry(DepotAssetRendererFactoryWrapper.java:68)
        	at com.liferay.journal.web.internal.servlet.taglib.util.JournalArticleActionDropdownItemsProvider._getPreviewURL(JournalArticleActionDropdownItemsProvider.java:518)
        	at com.liferay.journal.web.internal.servlet.taglib.util.JournalArticleActionDropdownItemsProvider._getPreviewArticleActionUnsafeConsumer(JournalArticleActionDropdownItemsProvider.java:489)
        	at com.liferay.journal.web.internal.servlet.taglib.util.JournalArticleActionDropdownItemsProvider.getActionDropdownItems(JournalArticleActionDropdownItemsProvider.java:115)
        	at com.liferay.journal.web.internal.display.context.JournalDisplayContext.getArticleActionDropdownItems(JournalDisplayContext.java:204)
        	at org.apache.jsp.view_005fentries_jsp._jspService(view_005fentries_jsp:1048)
        	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
        	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
        	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
        

         

        Attachments

          Issue Links

            Activity

              People

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

                Dates

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

                  Packages

                  Version Package
                  7.0.0 DXP FP93
                  7.0.10.14 DXP SP14
                  7.0.X
                  7.1.10 DXP FP18
                  7.1.X
                  7.2.10 DXP FP6
                  7.2.X
                  7.3.3 CE GA4
                  Master