[MGNLSTK-983] Internal Teaser returns an image from a children of the target page, when the target has no image in its intro / header but has images in the main content. Created: 23/Jul/12  Updated: 02/Aug/16  Resolved: 02/Aug/16

Status: Closed
Project: Magnolia Standard Templating Kit (closed)
Component/s: templates
Affects Version/s: 2.0.3
Fix Version/s: 2.0.x

Type: Bug Priority: Neutral
Reporter: Samuel Schmitt Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
Template:
Acceptance criteria:
Empty
Date of First Response:

 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.



 Comments   
Comment by Michael Mühlebach [ 02/Aug/16 ]

Given the thousands of other issues we have open that are more highly requested, we won't be able to address this issue in the foreseeable future. Instead we will focus on issues with a higher impact, and more votes.
Thanks for taking the time to raise this issue. As you are no doubt aware this issue has been on our backlog for some time now with very little movement.
I'm going to close this to set expectations so the issue doesn't stay open for years with few updates. If the issue is still relevant please feel free to reopen it or create a new issue.

Generated at Mon Feb 12 07:32:15 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.