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
747 stars 753 forks source link

Page List teaser item for external link shows Description of the current page #2764

Open HitmanInWis opened 6 months ago

HitmanInWis commented 6 months ago

Bug present as of version: 2.24.7-SNAPSHOT

When a static list contains an external link and the "Display as teaser" option is toggled on, the Teaser tile for the external link displays the description of the current page, which is unexpected (it should instead be empty).

The reason this is happening is there is a fallback in com.adobe.cq.wcm.core.components.internal.models.v2.TeaserImpl#getDescription to use the current page if no target page can be discerned. However, getTargetPage() already has a fallback to current page for cases where the Teaser has not declared a linkURL. Since getTargetPage() only returns null when linkURL is specified AND it doesnt point to a valid page, it would be better for getDescription() to return null as well in this case since the linkURL is referencing something that is not the current page.

juw177 commented 5 months ago

Obviously, the external link list currently doesn't support displaying teaser because there is no way to insert an image for the fixed list items! Wish that testing was done before they released it.