Changes in the fragments are not reflected when they are imported from another site
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
Issue
- Any changes to the fragment are not reflected on the page when users export the fragment from site-1 and import the exported fragment to site-2.
Steps to reproduce:
Note, Automatic propagation for Fragment is enabled
1) On Liferay DXP site, create a fragment 'Test Fragment'
2) On Liferay DXP site, create a content page 'Test'
3) Open the 'Test' page in Edit mode and add 'Test Fragment' on it and publish it
4) Navigate to Publishing > Export.
5) Click on 'plus icon' on top management toolbar for Custom Export.
6) While Exporting, add a name for export then under the pages section select only the 'Test' page and under content section unselect everything and export it ( no need to select created test fragment)
7) After exporting, download the lar.
8) Create a new Site 'Lending stream' and import the above-exported lar file, you can see the existing fragment in it (with the same text)
9) Now, navigate to Liferay DXP Site > Design > Fragments.
10) Export the created Fragment ( Test Fragment) by clicking on 3 dots > Export.
11) After exporting, the zip file will be obtained.
12) Navigate to Lending stream site > Design > Fragments.
13) Create a collection, now import the zip file.
14) Try to make any change to the imported fragment (add some HTML content and publish it)
15) Navigate to Home > 'Test' Page ( fragment changes are not getting reflected)
Observed Behavior: Changes made to the Test fragment do not appear on the Lending Stream site.
Expected Behavior: Changes to the Lending Stream's Test fragment should be reflected on the Test page.
Resolution
- The observed behavior is expected DXP behavior with the export/import of fragments.
- Reason: When the user imports an exported fragment, it creates a new fragment based on the information (HTML) from the exported fragment. Also, in the database, after importing, there are two separate fragment entries that can be seen, which also explain the observed behavior.
Did this article resolve your issue ?