The RemoteImageFormatter uses the title instead of the alt field when rendering the remote image.
public function viewElements(FieldItemListInterface $items, $langcode) {
$elements = [];
// Add one image per item.
foreach ($items as $delta => $item) {
...
// Set the alt field.
if ($this->fieldDefinition->getSetting('alt_field') === 1) {
$elements[$delta]['#alt'] = $item->title;
}
}
return $elements;
}
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | remote_image-remoteimageformatter_should_use_alt-2987328-2.patch | 578 bytes | tucho |
Comments
Comment #2
tuchoI uploaded a trivial patch that fix this issue.
Comment #3
gaurav.kapoor commentedGood Catch!. Thanks for working on this.
Comment #5
gaurav.kapoor commented