-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 7.1.X, 7.2.X
-
Fix Version/s: 7.2.10 DXP FP10, 7.2.X
-
Component/s: Categories
-
Branch Version/s:7.2.x
-
Backported to Branch:Committed
-
Fix Priority:3
Steps to Reproduce
- Start up Liferay connected to a MySQL database
- Sign in as admin
- Navigate to Control Panel > Configuration > Server Administration
- Go to the Script tab
- Run the following Groovy script:
import com.liferay.asset.kernel.service.AssetVocabularyLocalServiceUtil; import com.liferay.asset.kernel.service.AssetCategoryLocalServiceUtil; import com.liferay.portal.kernel.model.GroupConstants import com.liferay.portal.kernel.service.GroupLocalServiceUtil import com.liferay.portal.kernel.service.ServiceContext; import com.liferay.portal.kernel.util.PortalUtil import com.liferay.portal.kernel.util.StringUtil import java.util.concurrent.Executors; userId = PortalUtil.getUserId(actionRequest); companyId = PortalUtil.getCompanyId(actionRequest); groupId = GroupLocalServiceUtil.getGroup(companyId, GroupConstants.GUEST).getGroupId() serviceContext = new ServiceContext() vocabularyName = "Groovy_TestVocabulary" vocabulary = AssetVocabularyLocalServiceUtil.fetchGroupVocabulary(groupId, "Groovy_TestVocabulary") if (vocabulary == null) { vocabulary = AssetVocabularyLocalServiceUtil.addVocabulary(userId, groupId, vocabularyName, serviceContext); } threadPool = Executors.newFixedThreadPool(3) (1..10).each { threadPool.execute { AssetCategoryLocalServiceUtil.addCategory(userId, groupId, "cat-" + StringUtil.randomString(5) + "-" + StringUtil.randomId(5), vocabulary.getVocabularyId(), serviceContext); } } threadPool.shutdown()
- Inspect the AssetCategory table in the database
- Check the various rows in the AssetCategory table, and assert that some rows are showing duplicate leftCategoryId and rightCategoryId as the previous entry.
Actual Behavior
Rows are showing duplicate leftCategoryId and rightCategoryId in multiple rows.
Expected Behavior
Rows should have unique leftCategoryId and rightCategoryIds.
- relates
-
LPS-127422 Overlapping left/right categoryIds are added when creating asset categories
- Resolved
-
LPS-125633 Still encountering duplicate left/right categoryId entries when adding asset categories
- Closed