From bfc2bd6ce1d7363158d4bec01eb78f90aa3bc372 Mon Sep 17 00:00:00 2001 From: Yahor Chaptsou <163125600+YahorC@users.noreply.github.com> Date: Tue, 28 May 2024 10:10:14 +0200 Subject: [PATCH] [SITES-21939] Alt Text not persisting in Page Properties for Featured Image (#2759) Co-authored-by: Egor_Cheptsov Adding additional check, in case we are opening dialog for Page component image section and in that case updating value of remoteFileReference in order to execute retrieveInstanceInfo correctly for page component and update alt text field in dialog --- .../image/v3/image/clientlibs/editor/js/image.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/content/src/content/jcr_root/apps/core/wcm/components/image/v3/image/clientlibs/editor/js/image.js b/content/src/content/jcr_root/apps/core/wcm/components/image/v3/image/clientlibs/editor/js/image.js index 1322beb5ad..40ac63156c 100644 --- a/content/src/content/jcr_root/apps/core/wcm/components/image/v3/image/clientlibs/editor/js/image.js +++ b/content/src/content/jcr_root/apps/core/wcm/components/image/v3/image/clientlibs/editor/js/image.js @@ -396,9 +396,13 @@ // we need to get saved value of 'smartCropRendition' of Core Image component smartCropRenditionFromJcr = data["smartCropRendition"]; } + if (filePath.endsWith("/cq:featuredimage")) { + remoteFileReference = data["fileReference"]; + } // we want to call retrieveDAMInfo after loading the dialog so that saved smartcrop rendition of remote asset - // can be shown on initial load. - if (remoteFileReference && remoteFileReference !== "" && remoteFileReference.includes("urn:aaid:aem")) { + // can be shown on initial load. Also adding condition filePath.endsWith("/cq:featuredimage") to trigger alt + // update for page properties. + if (remoteFileReference && remoteFileReference !== "" && (remoteFileReference.includes("urn:aaid:aem") || filePath.endsWith("/cq:featuredimage"))) { retrieveDAMInfo(remoteFileReference); } });