No Code Attached Yet bug
avatar marcin17
marcin17
27 Feb 2024

Steps to reproduce the issue

$doc->addHeadLink('/images/banners/ad-background-1.svg','preload','rel',
array('fetchpriority'=>'high', 'as'=>'image', 'type'=>'image/svg+xml'));

$doc->addHeadLink('/images/banners/ad-background-2.svg','preload','rel',
array('fetchpriority'=>'high', 'as'=>'image', 'type'=>'image/svg+xml'));

Expected result

<link href="/images/banners/ad-background-1.svg" rel="preload" fetchpriority="high" as="image" type="image/svg+xml">
<link href="/images/banners/ad-background-2.svg" rel="preload" fetchpriority="high" as="image" type="image/svg+xml">

Actual result

<link href="/images/banners/ad-background-1.svg" rel="preload" fetchpriority="high" as="image" type="image/svg+xml">

the second and subsequent entries are ignored !

System information (as much as possible)

Joomla 5.0.3

Additional comments

following test give some hints about where is the problem. It looks like the method does not allow more than 1 entry with the same combination of attributes.

Following code:
$doc->addHeadLink('/images/banners/ad-background-1.svg','preload','rel',
array('fetchpriority'=>'high', 'as'=>'image', 'type'=>'image/svg+xml1'));
$doc->addHeadLink('/images/banners/ad-background-2.svg','preload','rel',
array('fetchpriority'=>'high', 'as'=>'image', 'type'=>'image/svg+xml2'));

produces result without that problem:

<link href="/images/banners/ad-background-1.svg" rel="preload" fetchpriority="high" as="image" type="image/svg+xml1">
<link href="/images/banners/ad-background-2.svg" rel="preload" fetchpriority="high" as="image" type="image/svg+xml2">

it looks like the bug prevent to add more than 1 entry with the same combination of attribites

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar marcin17 marcin17 - open - 27 Feb 2024
avatar marcin17 marcin17 - change - 27 Feb 2024
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 27 Feb 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 27 Feb 2024
avatar Hackwar Hackwar - change - 26 Mar 2024
Labels Added: bug
avatar Hackwar Hackwar - labeled - 26 Mar 2024

Add a Comment

Login with GitHub to post a comment