PUBLIC - Liferay Portal Community Edition
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-30779

Categories are assigned duplicative leftcategoryid and rightcategoryid values from preceding categories following removal of vocabularies

    Details

    • Branch Version/s:
      6.1.x, 6.0.x
    • Backported to Branch:
      Committed
    • Similar Issues:
      Show 5 results 

      Description

      ISSUE
      In an environment where multiple vocabularies contain categories, deleting a vocabulary will cause the next vocabulary's categories to have duplicate leftcategoryid and rightcategoryids from preceding entries. Essentially, the categoryids are not rebuilt correctly upon deletion of a vocabulary.

      STEPS TO REPRODUCE
      1. Create vocabulary Vocab1
      2. Add categories Cat1, Cat2, Cat3, Cat4, and Cat5 to Vocab1
      3. Create vocabulary Vocab2
      4. Add categories CatA, CatB, CatC, CatD, and CatE to Vocab2
      5. Perform query SELECT * FROM assetcategory; (SEE IMAGE 1)
      6. Left and right category ids are in order (for all cases)
      7. Delete vocabulary Vocab1
      8. Query SELECT * FROM assetcategory; again (SEE IMAGE 2)

      EXPECTED RESULTS
      The categories' leftcategoryid and rightcategoryid will be rebuilt, and the categories will inherit values that take up the missing numbers left by the deletion in chronological order.

      ACTUAL RESULTS
      The categories' leftcategoryid and rightcategoryid duplicate as seen in IMAGE 2.

      Replicated the issue in TRUNK REV 127687 and BRANCH REV 127687.

        Issue Links

          Activity

          Hide
          Hugo Huijser added a comment -

          Fix consists of two parts:

          1. In deleteVocabularyCategories, only delete the the category when it's a root category, when deleting a category the child categories will get deleted also. Therefore, it will try to delete children twice currently.

          2. When looping through the categories to delete, call deleteCategory(category.getCategoryId()) instead of deleteCategory(category), when deleting a category, the left and right categoryIds of other categories will change, so for the next in the list, we need to grab the updated category from the database when deleting.

          Show
          Hugo Huijser added a comment - Fix consists of two parts: 1. In deleteVocabularyCategories, only delete the the category when it's a root category, when deleting a category the child categories will get deleted also. Therefore, it will try to delete children twice currently. 2. When looping through the categories to delete, call deleteCategory(category.getCategoryId()) instead of deleteCategory(category), when deleting a category, the left and right categoryIds of other categories will change, so for the next in the list, we need to grab the updated category from the database when deleting.
          Hide
          Tammy Fong added a comment -

          Committed on:
          Portal 6.2.x GIT ID: 121dbeffed4c27ebcd922888c15713d9d49452e3.

          Show
          Tammy Fong added a comment - Committed on: Portal 6.2.x GIT ID: 121dbeffed4c27ebcd922888c15713d9d49452e3.
          Hide
          Luyang Tan (Inactive) added a comment -

          PASSED Manual Testing following the steps in the description.

          Reproduced on:
          Tomcat 7.0 + MySQL 5. Portal 6.1.20 EE GA2.

          The categories' leftcategoryid and rightcategoryid duplicate as seen in IMAGE 2.

          Fixed on:
          Tomcat 7.0 + MySQL 5. Portal 6.1.x EE GIT ID: dff75a26e7bc006090724d7906dc023e8ad5267d.
          Tomcat 7.0 + MySQL 5. Portal 6.2.x GIT ID: 02fcacb2dd1bf930e32bd320cdc8c6ccb236b5d0.

          The categories' leftcategoryid and rightcategoryid is rebuilt, and the categories will inherit values that take up the missing numbers left by the deletion in chronological order.

          Show
          Luyang Tan (Inactive) added a comment - PASSED Manual Testing following the steps in the description. Reproduced on: Tomcat 7.0 + MySQL 5. Portal 6.1.20 EE GA2. The categories' leftcategoryid and rightcategoryid duplicate as seen in IMAGE 2. Fixed on: Tomcat 7.0 + MySQL 5. Portal 6.1.x EE GIT ID: dff75a26e7bc006090724d7906dc023e8ad5267d. Tomcat 7.0 + MySQL 5. Portal 6.2.x GIT ID: 02fcacb2dd1bf930e32bd320cdc8c6ccb236b5d0. The categories' leftcategoryid and rightcategoryid is rebuilt, and the categories will inherit values that take up the missing numbers left by the deletion in chronological order.
          Hide
          Michael Saechang added a comment -

          Thank you Luyang for testing. Closing as 'Fixed'.

          Show
          Michael Saechang added a comment - Thank you Luyang for testing. Closing as 'Fixed'.
          Hide
          Luyang Tan (Inactive) added a comment -

          PASSED Manual Testing following the steps in the description.

          Fixed on:
          Tomcat 6.0 + MySQL 5. Portal 6.0.x GIT ID: c549b70ebd5b506de593b413bf8a8cdeb4aa2a6a.

          The categories' leftcategoryid and rightcategoryid is rebuilt, and the categories will inherit values that take up the missing numbers left by the deletion in chronological order.

          Show
          Luyang Tan (Inactive) added a comment - PASSED Manual Testing following the steps in the description. Fixed on: Tomcat 6.0 + MySQL 5. Portal 6.0.x GIT ID: c549b70ebd5b506de593b413bf8a8cdeb4aa2a6a. The categories' leftcategoryid and rightcategoryid is rebuilt, and the categories will inherit values that take up the missing numbers left by the deletion in chronological order.
          Hide
          Michael Saechang added a comment -

          Thank you Luyang for testing. Closing as 'Fixed'.

          Show
          Michael Saechang added a comment - Thank you Luyang for testing. Closing as 'Fixed'.
          Hide
          George Chi added a comment -

          i can reproduce this error in trunk and in 6.1.x. the fix exists in both, so this issue has regressed.

          Show
          George Chi added a comment - i can reproduce this error in trunk and in 6.1.x. the fix exists in both, so this issue has regressed.
          Hide
          Felix Zhang added a comment -

          I can reproduce this issue. Since we don't reopen regression tickets that have codes committed, I create LPS-44898 to report it.

          Show
          Felix Zhang added a comment - I can reproduce this issue. Since we don't reopen regression tickets that have codes committed, I create LPS-44898 to report it.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 3 weeks, 2 days ago

                Development

                  Structure Helper Panel