In the Articles - Newsflash module (mod_articles_news), when the module is set to show the Full article image, the image caption is not displayed if the article has a full-text image caption but no intro image caption.
The cause is a copy-paste error in the helper. In modules/mod_articles_news/src/Helper/ArticlesNewsHelper.php the full-text branch guards the caption assignment with the intro caption field instead of the full-text caption field:
} elseif ($params->get('img_intro_full') === 'full' && !empty($images->image_fulltext)) {
$item->imageSrc = htmlspecialchars($images->image_fulltext, ENT_COMPAT, 'UTF-8');
$item->imageAlt = htmlspecialchars($images->image_fulltext_alt, ENT_COMPAT, 'UTF-8');
if ($images->image_intro_caption) { // should be image_fulltext_caption
$item->imageCaption = htmlspecialchars($images->image_fulltext_caption, ENT_COMPAT, 'UTF-8');
}
}The intro-image branch immediately above is correct (it guards on image_intro_caption and sets image_intro_caption). Only the full-text branch references the wrong field in the if guard.
The correct field is used in the core layouts — layouts/joomla/content/full_image.php checks image_fulltext_caption for the full image — confirming the helper guard is wrong.
The full-text image caption is displayed under the image.
No caption is displayed.
5.4
The intro-image branch in the same method is correct; only the full-text branch references the wrong field. One-line fix: change the guard from image_intro_caption to image_fulltext_caption.
| Labels |
Added:
No Code Attached Yet
|
||
@chmst — Flagging a copy-paste error in mod_articles_news. When showing the full-text image, the caption guard checks image_intro_caption instead of image_fulltext_caption. Result: caption silently dropped if article has fulltext caption but no intro caption. Repro steps in the issue description.
gh issue comment 47967 --repo joomla/joomla-cms --body "@chmst — Flagging a copy-paste error in mod_articles_news. Full-text image caption guard checks wrong field (image_intro_caption instead of image_fulltext_caption). Repro steps included."