Issue
- After setting the Asset Publisher to filter assets that only have certain categories, portal administrators may notice that even other assets with different categories (not present in the filtering options), are also listed. The issue may persist after a full reindex.
Environment
- Liferay DXP 7.0+
Resolution
- The issue is a bug that will be fixed in upcoming fix packs through LPS-125083 and LPS-125633.
- You may also attempt the below solution to permanently resolve the issue without a patch:
1) Go to the site where the categories are present > Content > Categories
2) Create atestVocabulary
3) Add atestCategoryto thistestVocabulary
4) Add atestSubCategoryundertestCategory
5) Delete thetestVocabulary
6) Reindex all search indexes under the Control Panel > Server Administration
The above steps help to rebuild the Categories tree and should fix the problem.
Additional Information
-
The problem comes from: https://github.com/liferay/liferay-portal/blob/master/portal-impl/src/com/liferay/portlet/asset/service/persistence/impl/AssetCategoryPersistenceImpl.java#L12169
The code checks if there are any descendants with the same
groupidand sameLeftCategoryIdas well asRightCategoryIdand it finds wrong hits. Please refer to LPS-125083 and LPS-125633 for any more details.