From dbbd7f7eca86e2f7102e6e1a5fff7f60531794a6 Mon Sep 17 00:00:00 2001 From: Veronica Gonzalez Date: Thu, 26 Sep 2024 15:10:33 +0200 Subject: [PATCH] LPD-37449 Pass layoutDataItems as param instead of layoutData --- .../resources/page_editor/app/utils/canBeCopied.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/apps/layout/layout-content-page-editor-web/src/main/resources/META-INF/resources/page_editor/app/utils/canBeCopied.js b/modules/apps/layout/layout-content-page-editor-web/src/main/resources/META-INF/resources/page_editor/app/utils/canBeCopied.js index c469dbb631228b..03a9c2ab529478 100644 --- a/modules/apps/layout/layout-content-page-editor-web/src/main/resources/META-INF/resources/page_editor/app/utils/canBeCopied.js +++ b/modules/apps/layout/layout-content-page-editor-web/src/main/resources/META-INF/resources/page_editor/app/utils/canBeCopied.js @@ -19,14 +19,14 @@ const PARENT_TYPES = [ LAYOUT_DATA_ITEM_TYPES.root, ]; -function getItemTargetToPaste(item, layoutData) { +function getItemTargetToPaste(item, layoutDataItems) { if (PARENT_TYPES.some((type) => type === item.type)) { return item; } - const parent = layoutData?.items?.[item.parentId]; + const parent = layoutDataItems[item.parentId]; - return getItemTargetToPaste(parent, layoutData); + return getItemTargetToPaste(parent, layoutDataItems); } export default function canBeCopied( @@ -47,7 +47,7 @@ export default function canBeCopied( fragmentEntryLinks ); - const parent = getItemTargetToPaste(target, layoutData); + const parent = getItemTargetToPaste(target, layoutData.items); const isChildAllowed = checkAllowedChild( source,