Issue
-
In 7.3 SP3, Changing a configuration setting that changes the applied CSS class on the fragment <div> causes the Form in the drop zone to be added twice, which results in the form not displaying at all.
The following warning is displayed in the browser console with its corresponding JS reference:
Component with id "ddmFormi69CgH2t" is being registered twice. This can lead to unexpected behaviour in the "Liferay.component" and "Liferay.componentReady" APIs, as well as in the "*:registered" events.
combo?browserId=chrome&minifierType=js&languageId=en_US&b=7310&t=1650979779676&/o/frontend-js-aui-web/aui/aui/aui.js&/o/frontend-js-aui-web/liferay/modules.js&/o/frontend-js-aui-web/liferay/aui_sandbox.js&/o/frontend-js-aui-web/aui/attribute-base/attribute-base.js&/o/frontend-js-aui-web/aui/attribute-complex/attribute-complex.js&/o/frontend-js-aui-web/aui/attribute-core/attribute-core.js&/o/frontend-js-aui-web/aui/attribute-observable/attribute-observable.js&/o/frontend-js-aui-web/aui/attribute-extras/attribute-extras.js&/o/frontend-js-aui-web/aui/event-custom-base/event-custom-base.js&/o/frontend-js-aui-web/aui/event-custom-complex/event-custom-complex.js&/o/frontend-js-aui-web/aui/oop/oop.js&/o/frontend-js-aui-web/aui/aui-base-lang/aui-base-lang.js&/o/frontend-js-aui-web/liferay/dependency.js&/o/frontend-js-aui-web/liferay/util.js&/o/frontend-js-web/loader/config.js&/o/frontend-js-web/loader/loader.js&/o/frontend-js-web/liferay/dom_task_runner.js&/o/frontend-js-web/liferay/events.js&/o/frontend-js-web/liferay/lazy_load.js&/o/frontend-js-web/liferay/liferay.js&/o/frontend-js-web/liferay/global.bundle.js&/o/frontend-js-web/liferay/portlet.js&/o/frontend-js-web/liferay/workflow.js:652
Steps to Reproduce- Content & Data > Forms
- Give the form a title and a text field to the form. Save.
- Create a fragment with the following configurations:
Configuration -
{HTML
"fieldSets": [
{
"label": "Style",
"fields": [
{
"dataType": "string",
"defaultValue": "barebones",
"label": "Decorator",
"name": "TUContainerDecorator",
"type": "select",
"typeOptions": {
"validValues": [
{
"label": "Barebones",
"value": "barebones"
},
{
"label": "Decorate",
"value": "decorate"
}
]
}
}
]
}
]
}
[#assign configClass = "tu-component-" + configuration.TUContainerDecorator]
<div class="fragment_24001 ${configClass}">
<lfr-drop-zone></lfr-drop-zone>
</div> - Publish the fragment
- Navigate to a content page and add the fragment.
- Drop a Form widget onto the fragment's drop zone.
- Configure the Form widget to display the created form.
- Publish.
- Note that everything works fine.
- Open the browser console.
- Edit the page again and change the fragment's style in the General tab.
- Note that the warning appears. Publishing the page will refresh the page, but the form won't fully display (the text field is missing).
Environment
- Liferay DXP 7.3
Resolution
- Removing the ${configClass} from the fragment's HTML or removing configuration.TUContainerDecorator to read the fragment configuration setting prevents the issue.
- This issue has also been resolved by LPS-119924 and LPS-129443.
- Open a Help Center Ticket with Liferay Support and request a hotfix that includes these two fixes.