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

Using collectionObjectList in a Fragment does not take Collection variations into account

    Details

      Description

      Problem: when using a collection programatically in a fragment (adding a collectionSelector through the fragment configuration) you can't retrieve the collection's variations.

      The following fix LPS-128810 that enables Variations at Collection level when mapping a collection to a Collection Display Fragment, seems correct when using that OOTB Fragment. The problem comes when using it programatically (method collectionObjectList)

      STEPS TO REPRODUCE

      1. Create a Segment called Change with an easy rule to be able to classify two type of users. Ej. URL contains "change" (we will be adding a parameter in the URL with ?change when we want the segment to work)
      2. Create a Basic Web Content with Content1 in the title and also in the content
      3. Create a Basic Web Content with Content2 in the title and also in the content
      4. Create a Manual Collection and configure it to show Basic Web Contents. The Anyone variation should list the Content1 and the Variation for the Segment "Change" should list the Content2
      5. Create a Fragment with the following code attached to the ticket (see documentation here)
      6. Create a new Page. Drag and Drop the Fragment and configure it to use the Collection defined in step 4. Publish the page
      7. Visit the page: acknowledge that Content1 is listed in the fragment.
      8. Add ?change into the URL and reload the page (ej. http://localhost:8080/web/guest/home?change): acknowledge that Content1 is still listed in the fragment. (we should see Content2)

      CURRENT RESULT
      We still see Content1 in the fragment, the variation is not being retreived

      EXPECTED RESULT
      The collection lists Content2 so retrieving the variation attached to the segment now that we belong to the segment

      ADDITIONAL INFORMATION
      You can try the same by using the Collection Display Fragment to check that with the OOTB fragment it works.

      1. In the same Page created Drag and Drop a Collection Display Fragment
      2. Configure it to use the same collection created on step 4
      3. Drag and drop a Heading Fragment and map it to use the Title of the Basic Web Content. Publish the page
      4. Visit the page: acknowledge that Content1 is listed in the fragment.
      5. Add ?change into the URL and reload the page (ej. http://localhost:8080/web/guest/home2?change): acknowledge that now the Collection Display Fragment does work and shows only Content2

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              team-echo Product Team Echo
              Reporter:
              rafael.lluis Rafael Lluis
              Participants of an Issue:
              Recent user:
              Julia Molano
              Engineering Assignee:
              Ruben Pulido
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Days since last comment:
                5 weeks, 1 day ago

                  Packages

                  Version Package