Affects Version/s: 6.2.X EE, 7.0.0 DXP SP2, Master
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
- Navigate to [Site Name] > Content > Categories.
- Click on a Vocabulary (e.g. "Topic).
- Add a Category to the selected Vocabulary.
- Navigate back to a page and add an Asset Publisher portlet to the page.
- On the Asset Publisher portlet, click on the three dots in the top-right corner and select "Configuration".
- 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).
- Save your configuration and clise the window.
- Click the "+" button in the top-right corner of the Asset Publisher portlet and select "Basic Web Content"
- 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.
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".