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

Wrong implementation for AssetEntryAssetCategoryRelLocalService.getAssetEntryPrimaryKeys method

    Details

      Description

      The method getAssetEntryPrimaryKeys(long assetCategoryId) from AssetEntryAssetCategoryRelLocalService class is supposed to returns an array with the primary keys of the asset entries related to the category; unfortunately it returns and array with the value assetCategoryId repeated for each related asset entry.

      This is the wrong code:

      return ListUtil.toLongArray(
      {{ assetEntryAssetCategoryRels,}}
      {{ AssetEntryAssetCategoryRel::getAssetCategoryId);}}

      This is the right code:

      return ListUtil.toLongArray(
      {{ assetEntryAssetCategoryRels,}}
      {{ AssetEntryAssetCategoryRel::getAssetEntryId);}}


      Steps to Reproduce

      1. Add a new category
      2. Upload 10 documents adding the category to each of them
      3. Get the categoryId from the AssetCategory table in the database
      4. Execute the attached script replacing the value for categoryId with the one in your database

      Expected Results
      The asset entry IDs of the ten uploaded documents would be printed.

      Actual Results
      The category ID supplied is printed out ten times.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              yang.cao Yang Cao
              Reporter:
              napo Marco Napolitano
              Participants of an Issue:
              Recent user:
              Jason Pince
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 11 weeks, 1 day ago

                  Packages

                  Version Package
                  7.1.X
                  7.3.0 CE GA1
                  7.3.10 DXP GA1
                  Master