If there is an existing KB article that happens to have the same ID as a KB folder did in a different environment, then attempting to import that folder will cause it to lose its contained articles. This happens because Liferay cannot properly distinguish whether the article's parent should be an article or a folder, so it will find that otherwise unrelated article and assume that is the parent instead.

      Note that while it is possible to reproduce without direct database modification, it depends on specific ID values being generated by Liferay (somewhat of a hard-to-predict edge case), so it is much more difficult to reproduce consistently without directly modifying the database.

      Steps to reproduce:

      1. Set up two environments of Liferay with Knowledge Base (in the case of 6.2, deploy the latest version)
      2. On the first environment, go to Knowledge Base in Content administration and create a couple of folders
      3. Within each folder, add a few KB articles
      4. Query the database to check the folderId's for the added KBFolders (make a note of them)
      5. Export the KB portlet data to a LAR
      6. On the second environment, create a new Site, then add a KB article to it from Content administration
      7. Query the database to change the new article's resourcePrimKey and rootResourcePrimKey values to have the same ID as one of the KBFolders from the first environment
        Note: this should not break import functionality because the KBFolders will have new ID values generated on import anyway
      8. Go to Control Panel -> Server Administration and execute all clear cache actions
      9. Create another new Site
      10. Import the KB portlet into Content Admin, then check the contents of the folders
        Expected result: the folders both have all of their respective content
        Actual result: one of the folders has all of its articles missing


        Issue Links



              beck.liu Beck Liu
              alec.shay Alec Shay
              Kiyoshi Lee Kiyoshi Lee
              0 Vote for this issue
              1 Start watching this issue


                4 years, 21 weeks ago


                  Version Package