Details
-
Bug
-
Resolution: Won't Do
-
Neutral
-
2.0.3
-
None
-
-
Empty show more show less
Description
An internal teaser must returns the first image found in the target content pointed by the teaser if no teaser image was defined in target intro/header.
This is what the javadoc of info.magnolia.module.templatingkit.templates.components.InternalTeaserModel.findImage(Node) says.
The problem with the implementation of InternalTeaserModel.findImage is that when no teaser image is defined in the intro/header of the target, the first image found could come from a child page. And according the usage of an internal teaser, we expect that the image comes from an area of the target.
InternalTeaserModel.findImage must first search in the areas of the target before searching in the subpages.
How to reproduce
- Create a page, add a text/Image with an image.
- Create a sub page with an intro image.
- On a third page, create a teaser where the target is the first page you created.
- The teaser displays the image from the subpage and not from the text/image of the 1st page.
Possible fix
In my project, I override InternalTeaserModel.findImage and I sort the list of nodes in order to the areas are the first in the list.