adobe / aem-core-wcm-components

Standardized components to build websites with AEM.
https://docs.adobe.com/content/help/en/experience-manager-core-components/using/introduction.html
Apache License 2.0
723 stars 737 forks source link

Page List items shown as Teaser have invalid dataLayer date for Teaser component #2762

Open HitmanInWis opened 1 month ago

HitmanInWis commented 1 month ago

Bug present as of version: 2.24.7-SNAPSHOT

When rendering List items as Teasers, the Teaser data layer object has a repo:modifyDate that is incorrect in one of two ways.

Current functionality:

Modifying internal AEM page links to pull from the List Item resource is not the answer, since for Child/Search/Tag options the List Item resource isn't actually a resource in the JCR.

One solution is to simply null out the value in both com.adobe.cq.wcm.core.components.internal.models.v2.PageListItemImpl#getTeaserResource and com.adobe.cq.wcm.core.components.internal.models.v4.ExternalLinkListItemImpl#getTeaserResource by adding the following lines:

overriddenProperties.put(JcrConstants.JCR_LASTMODIFIED, null);
overriddenProperties.put(JcrConstants.JCR_CREATED, null);