#108506f:image ViewHelper ignores explicitly set title attribute when FAL metadata has title
Description
The f:image ViewHelper does not allow overwriting or removing the title attribute when the FAL file has a title set in metadata.
The title attribute is usually counterproductive for accessibility.
Current behavior
The condition empty($this->additionalArguments['title']) only checks if the argument is empty/not set. If a developer explicitly passes additionalAttributes="{title: ''}" to remove the title, the FAL metadata title is still rendered.
Expected behavior
additionalAttributes="{title: 'Custom'}"should outputtitle="Custom"additionalAttributes="{title: ''}"should output no title attribute- No title passed: should fall back to FAL metadata
Steps to reproduce
- Upload an image with title metadata set (e.g., “Original Title”)
- Use
<f:image image="{image}" additionalAttributes="{title: ''}" /> - Rendered img tag still contains
title="Original Title"
Suggested fix
Align with the existing alt attribute handling pattern:
if (isset($this->additionalArguments['title']) && $this->additionalArguments['title'] === '') {
// In case the "title" attribute is explicitly set to an empty string, respect
// this to allow excluding it from output intentionally.
} elseif (!isset($this->additionalArguments['title'])) {
$title = trim((string)($image->hasProperty('title') ? $image->getProperty('title') : ''));
if ($title !== '') {
$this->tag->addAttribute('title', $title);
}
}Reviews 2
History 37
-
Richard Krikler commented <span data-processor="relativetime" data-value="2025-12-17T18:17:11+00:00" > 12/17/25, 18:17 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 92435 status
NewUnder Review <span data-processor="relativetime" data-value="2026-01-21T07:07:06+00:00" > 01/21/26, 07:07 </span> -
Gerrit Code Review pushed patch set 2 for main to change 92435 <span data-processor="relativetime" data-value="2026-01-21T10:33:37+00:00" > 01/21/26, 10:33 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 92435 <span data-processor="relativetime" data-value="2026-02-06T09:23:54+00:00" > 02/06/26, 09:23 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 92728 <span data-processor="relativetime" data-value="2026-02-06T16:42:43+00:00" > 02/06/26, 16:42 </span>
-
Richard Krikler commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-02-06T16:45:09+00:00" > 02/06/26, 16:45 </span>Applied in changeset commit:f50a001581aaf4935a6966895f15445feffcb29b.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2026-03-31T08:59:31+00:00" > 03/31/26, 08:59 </span>
I’ll have a look 👀