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
avatar brianteeman
brianteeman - comment - 26 Nov 2024

I just tried this and it worked without error.

Image

Image

Image

avatar Hackwar
Hackwar - comment - 26 Nov 2024

The code currently does not allow this. It is still an issue.

avatar brianteeman
brianteeman - comment - 26 Nov 2024

So how did it work for me?

avatar Fedik
Fedik - comment - 27 Nov 2024

I removed my last comment 😄
Well, I do not see the issue, as long as diferent URL is in use.

avatar brianteeman
brianteeman - comment - 17 Dec 2024

@Hackwar are you sure you tested correctly as neither @Fedik nor myself can replicate the reported issue

avatar marcin17
marcin17 - comment - 18 Dec 2024

I will try to reproduce again with the latest J 5.2.2 today

avatar QuyTon
QuyTon - comment - 6 Feb 2025

Closing as non-reproducible and no response/follow-up by the poster.

avatar QuyTon
QuyTon - comment - 6 Feb 2025

Closing as non-reproducible and no response/follow-up by the poster.

avatar QuyTon QuyTon - change - 6 Feb 2025
Status New Closed
Closed_Date 0000-00-00 00:00:00 2025-02-06 03:44:26
Closed_By QuyTon
avatar QuyTon QuyTon - close - 6 Feb 2025
avatar QuyTon
QuyTon - comment - 6 Feb 2025

Closing as non-reproducible and no response/follow-up by the poster.

Add a Comment

Login with GitHub to post a comment