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

Asset Publisher 6.2 GA3 creates an empty RSS feed when selecting "any" type for inclusion

    Details

    • Story Points:
      12

      Description

      When selecting "any type" for inclusion in the Asset Publisher, the retrieved feed is empty.

      How to reproduce:

      • Add an Asset Publisher to a page
      • In Configuration / Asset Selection select Asset Type "any" (usually the default)
      • In Configuration / Subscriptions select the check box "Enable RSS Subscription"
      • Save the configuration
      • Close the Configuration dialog
      • Create a couple of web content (or other asset type) objects that become visible in the Asset Publisher.
      • Press the RSS icon.

      Expected Result:

      • A feed containg information of the assets should be shown in a new browser window / tab

      Result:

      • 0 bytes are got in a new window. Error message varies depending on the browser used.

      Root cause:
      I have actually fixed this for our own system. The problem seems to be on the lines 376 - 390 of the file com.liferay.portlet.assetpublisher.util.AssetPublisherImpl.java, inside the method

      public List<AssetEntry> getAssetEntries(
      PortletPreferences portletPreferences, Layout layout,
      long scopeGroupId, int max, boolean checkPermission)
      throws PortalException, SystemException {

      It currently has:

      if (!anyAssetType)

      { long[] availableClassNameIds = AssetRendererFactoryRegistryUtil.getClassNameIds( layout.getCompanyId()); long[] classNameIds = getClassNameIds( portletPreferences, availableClassNameIds); assetEntryQuery.setClassNameIds(classNameIds); }

      long[] classTypeIds = GetterUtil.getLongValues(
      portletPreferences.getValues("classTypeIds", null));

      assetEntryQuery.setClassTypeIds(classTypeIds);

      My fix was to populate with all accessible Content Types:


      if (!anyAssetType)

      { long[] availableClassNameIds = AssetRendererFactoryRegistryUtil.getClassNameIds( layout.getCompanyId()); long[] classNameIds = getClassNameIds( portletPreferences, availableClassNameIds); assetEntryQuery.setClassNameIds(classNameIds); }

      else

      { /* * 3.3.2015 * long[] classTypeIds = GetterUtil.getLongValues( * portletPreferences.getValues("classTypeIds", null)); */ long[] classNameIds = AssetRendererFactoryRegistryUtil.getClassNameIds( layout.getCompanyId()); assetEntryQuery.setClassNameIds(classNameIds); }

      I am not sure if there are any adverse implications with this fix, but at least it seems to work.

        Attachments

          Activity

            People

            Assignee:
            yvonne.han Yvonne Han
            Reporter:
            pasik Pasi Kössi
            Participants of an Issue:
            Recent user:
            Marta Elicegui
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              5 years, 2 weeks ago

                Packages

                Version Package
                6.2.3 CE GA4
                6.2.X EE
                7.0.0 Alpha 2