問題
-
7.3 SP3 では、フラグメント <div> に適用される CSS クラスを変更する構成設定を変更すると、ドロップ ゾーンのフォームが 2 回追加され、フォームがまったく表示されなくなります。
次の警告が、対応する JS 参照とともにブラウザー コンソールに表示されます。
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
ステップから 再現- コンテンツ & データ > フォーム
- フォームにタイトルとテキスト フィールドを付けます。 保存.
- 次の構成でフラグメントを作成します:
構成 -
{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> - フラグメントを公開する
- コンテンツ ページに移動し、フラグメントを追加します。
- フォーム ウィジェットをフラグメントのドロップ ゾーンにドロップします。
- 作成したフォームを表示するようにフォーム ウィジェットを構成します。
- 公開.
- すべて正常に動作することに注意してください。
- ブラウザ コンソールを開きます。
- ページを再度編集し、[全般] タブでフラグメントのスタイルを変更します。
- 警告が表示されることに注意してください。 ページを公開するとページが更新されますが、フォームは完全には表示されません (テキスト フィールドがありません)。
Environment
- Liferay DXP 7.3
解決策
- フラグメントの HTML から ${configClass} 削除するか、configuration.TUContainerDecorator を削除してフラグメントの構成設定を読み取ると、問題が回避されます。
- この問題は、 LPS-119924 および LPS-129443 によっても解決されています。
- Liferay サポートでヘルプ センター チケットを開き、これら 2 つの修正を含むホットフィックスをリクエストしてください。