Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-129106

Unable to import page template containing basic fragments when another contributedFragmentCollection is undeployed.

    Details

    • Fix Priority:
      3

      Description

      Steps to Reproduce:

      1. Create a page template that includes 3 heading fragments.
      2. Export the page template.
      3. Delete the newly created page template.
      4. In the gogo shell run the command: `lb collection`
      5. Find the ID for the module: `Liferay Fragment Collection Contributor Featured Content`.
      6. Stop the module by running the command: `stop {moduleId}`
      7. Start the module by running the command: `start {moduleId}`
      8. In the page template administration, import the previously exported page template.

      Expected Result: 

      • The page template is imported without any issues. 

      Actual Result:

      • The page template is imported with warnings.
      • The page is imported but does not include the 3 heading fragments added in step 1.

       

      NOTE: I think this is caused by the following:

      1. https://github.com/liferay/liferay-portal/blob/master/modules/apps/fragment/fragment-impl/src/main/java/com/liferay/fragment/internal/contributor/FragmentCollectionContributorTrackerImpl.java#L372
        • Even though multiple collections have been contributed all collections are removed.
      2. https://github.com/liferay/liferay-portal/blob/master/modules/apps/fragment/fragment-impl/src/main/java/com/liferay/fragment/internal/contributor/FragmentCollectionContributorTrackerImpl.java#L339
        • When we restart the module, _fragmentEntries is null so we only add that collection.
      3. https://github.com/liferay/liferay-portal/blob/master/modules/apps/fragment/fragment-impl/src/main/java/com/liferay/fragment/internal/contributor/FragmentCollectionContributorTrackerImpl.java#L201
        • When we call _getFragmentEntries if it's null we will check for all registered collections, but because in step 2 we added 1 collection to _fragmentEntries it thinks it has all the needed entries.

       

        Attachments

          Activity

            People

            Assignee:
            support-lep@liferay.com SE Support
            Reporter:
            evan.thibodeau Evan Thibodeau
            Participants of an Issue:
            Recent user:
            David Gutiérrez Mesa
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Days since last comment:
              1 week, 3 days ago

                Packages

                Version Package