[MGNLSTK-785] footerAbout template script can't render images without title Created: 05/Jul/11  Updated: 22/Oct/12  Resolved: 16/Aug/11

Status: Closed
Project: Magnolia Standard Templating Kit (closed)
Component/s: paragraphs
Affects Version/s: 1.3.5, 1.4.4
Fix Version/s: 1.3.6

Type: Bug Priority: Neutral
Reporter: Magnolia International Assignee: Christian Ringele
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Patch included:
Yes
Acceptance criteria:
Empty
Date of First Response:

 Description   

In /templating-kit/paragraphs/footer/footerAbout.ftl, the following can't work for assets that don't have a title:

    [#assign imageAlt = image.title!image.@name]

image in this case is an instance of info.magnolia.module.templatingkit.dam.Asset; a dms asset "always" has a title (since the title property is automatically filled in on creation in the tree), while an uploaded asset never does. The expression above thus falls back to @name, which can't be interpreted either, as there is no such property (image is an Asset, not a node).

Trivial fix:

    [#assign imageAlt = image.title!image.name]


 Comments   
Comment by Jan Haderka [ 19/Jul/11 ]

Thank you for volunteering.

Comment by Christian Ringele [ 09/Aug/11 ]

Added test case to 1.4.5
Template fixed also for 1.3.x

Comment by Jan Haderka [ 16/Aug/11 ]

MockSTKSiteManagerForTestOfFooterAboutParagraph.java - what about that class is footer specific? it seems fairly general mock of STKSiteManager and as such has wrong name and is in wrong package.
Please go through other mocks as well before resolving the issue again.

Comment by Jan Haderka [ 16/Aug/11 ]

If they are so specific, it should be described in the class javadoc of those classes. Also it might be more appropriate to use anonymous inner class in that case.

Comment by Christian Ringele [ 16/Aug/11 ]

Using inner class and inner nested class. Better class names chosen (I hope )

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