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

Assets API is confusing because groupId is required but it is not in the signature of the method

    Details

      Description

      If I try to create an AssetCategory programatically using AssetCategoryLocalServiceUtil.addCategory( ... ); and forget to pass scopeGroupId via serviceContext, there is corrupted category created and no error is thrown.

      The category is displayed properly in category tree under Categories section in Site's Control Panel but is not searchable using AssetCategoryLocalServiceUtil.search( ... ), not displayed with asset-categories-navigation taglib and generally unuseable in any other portal components.

      It is not a big issue but I think the API should not allow to leave the data in inconsistent state. I spent some time figuring out what's wrong with my code and I'm sure there are lots of other people who will find this bug in the future

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              beck.liu Beck Liu
              Reporter:
              kgolebiowski Krzysztof Gołębiowski
              Participants of an Issue:
              Recent user:
              Brian Wulbern
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

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

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 M5