$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'));
<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">
<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 !
Joomla 5.0.3
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
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
Labels |
Added:
bug
|
The code currently does not allow this. It is still an issue.
So how did it work for me?
I removed my last comment 😄
Well, I do not see the issue, as long as diferent URL is in use.
I will try to reproduce again with the latest J 5.2.2 today
Closing as non-reproducible and no response/follow-up by the poster.
Closing as non-reproducible and no response/follow-up by the poster.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-02-06 03:44:26 |
Closed_By | ⇒ | QuyTon |
Closing as non-reproducible and no response/follow-up by the poster.
I just tried this and it worked without error.