Add article to a Category Blog
View HTML
Relevant line starts with script type="application/ld+json">{"@context":"https://schema.org","@graph":
Relative path for schema "image" and "thumbnailUrl" includes forward slash so the relative path points to root and therefore domain/images
Forward slash missing from schema "image" and "thumbnailUrl" resulting in relative path pointing to category and therefore non-existent domain/blog/images
Present in Joomla 5.1.2 and 5.1.3
Labels |
Added:
No Code Attached Yet
|
Labels |
Added:
bug
|
quick research: all urls should be absolute in schema ld see this stackoverflow solution and linked ressources: stackoverflow
I am not submitting a PR because
However the basic fix is to change the code so that the uri root is prepended to the image.
$schema['thumbnailUrl'] = HTMLHelper::_('cleanImageUrl', $article->images->get('image_intro'))->url;
Should be changed to
$schema['thumbnailUrl'] = Uri::root() . HTMLHelper::_('cleanImageUrl', $article->images->get('image_intro'))->url;
I think the code for this would be
Factory::getCache()->clean('schemaorg');
I think that every single occurence of
HTMLHelper::_('cleanImageUrl'
has to be changed as we don't allow to add images from external sources. (not 100% sure)
cleanimageurl says it supports absolute image paths as well as relative ones but I dont see how
Issue confirmed (5.2).