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

Category is not automatically selected from Asset Publisher even though the Asset Publisher filter is designed to scope any contents from that specific category

    Details

      Description

      Description
      In the Asset Publisher portlet, if we configure the Asset Publisher to filter any specific categories on a single category, the expectation is that any content created under this configured Asset Publisher will have the selected category. For example, if we have a Category called "Test1", then I add an Asset Publisher and configure it to filter any assets under "Test1" category (and no other categories), and finally create a Web Content article through this Asset Publisher, the "Test1" category is not automatically assigned to this new Web Content.

      However, when we tested the exact scenario in 6.1, the "Test1" category is selected. Secondly, in 6.2, if we set the filter to "Contains" "All" "Categories" then choose a Category, any content created through Asset Publisher receives the selected category assignment automatically.

      This issue happens because AssetPublisherUtil.getAssetCategoryIds does not take into account that you can have a "Contains Any Categories" filter that applies to only one category (in which case that category should be added to the list of required categories).

      Steps to reproduce

      1. Navigate to [Site Name] > Content > Categories.
      2. Click on a Vocabulary (e.g. "Topic).
      3. Add a Category to the selected Vocabulary.
      4. Navigate back to a page and add an Asset Publisher portlet to the page.
      5. On the Asset Publisher portlet, click on the three dots in the top-right corner and select "Configuration".
      6. Select Filter and add a filter with the properties "Contains", "Any" and "Categories". Select the Category you created in step 3 (do not add any more categories to the filter).
      7. Save your configuration and clise the window.
      8. Click the "+" button in the top-right corner of the Asset Publisher portlet and select "Basic Web Content"
      9. Select "Metadata" and observe which categories have already been assigned.

      Expected Behavior: The category is automatically selected and assigned for the new article, because it is known to be a required category due to the filter that was added.
      Actual Behavior: The category is not automatically selected and assigned for the new article.

      Reproduced in
      master (3bec09301a5e7610b1ddfade873c18e38e8c2637)
      ee-7.0.x (c4abd9aafb206ad0676927c27fb4acbe99f1ddb9)
      ee-6.2.x (78be23b847575c69b027af9f03b053a45c606eb2)
      Note: In ee-6.2.x, the UI is a little different. For instance, in step 9, you need to select "Categorization" rather than "Metadata".

        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:
                  2 years, 42 weeks, 1 day ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 DXP FP11
                  7.0.0 DXP SP2
                  7.0.3 CE GA4
                  7.1.X
                  Master