No Code Attached Yet Information Required
avatar neoacevedo
neoacevedo
23 May 2022

Steps to reproduce the issue

I have installed a template where I enable/disable Font Awesome:

imagen

Expected result

When I enable Font Awesome, the URL for Font Awesome coming from media/system/css/joomla-fontawesome.css should be generated correctly and the font being loaded correctly.

Actual result

A lot of error messages in web console:

Solicitud de origen cruzado bloqueada: La misma política de origen no permite la lectura de recursos remotos en http://media/vendor/fontawesome-free/webfonts/fa-solid-900.woff2. (Razón: Solicitud CORS sin éxito). Código de estado: (null).

downloadable font: download failed (font-family: "Font Awesome 5 Free" style:normal weight:900 stretch:100 src index:1): bad URI or cross-site access not allowed source: http://media/vendor/fontawesome-free/webfonts/fa-solid-900.woff2
Solicitud de origen cruzado bloqueada: La misma política de origen no permite la lectura de recursos remotos en http://media/vendor/fontawesome-free/webfonts/fa-brands-400.woff2. (Razón: Solicitud CORS sin éxito). Código de estado: (null).

downloadable font: download failed (font-family: "Font Awesome 5 Brands" style:normal weight:400 stretch:100 src index:1): bad URI or cross-site access not allowed source: http://media/vendor/fontawesome-free/webfonts/fa-brands-400.woff2
Solicitud de origen cruzado bloqueada: La misma política de origen no permite la lectura de recursos remotos en http://media/vendor/fontawesome-free/webfonts/fa-regular-400.woff2. (Razón: Solicitud CORS sin éxito). Código de estado: (null).

downloadable font: download failed (font-family: "Font Awesome 5 Free" style:normal weight:400 stretch:100 src index:1): bad URI or cross-site access not allowed source: http://media/vendor/fontawesome-free/webfonts/fa-regular-400.woff2
Solicitud de origen cruzado bloqueada: La misma política de origen no permite la lectura de recursos remotos en http://media/vendor/fontawesome-free/webfonts/fa-solid-900.woff. (Razón: Solicitud CORS sin éxito). Código de estado: (null).

downloadable font: download failed (font-family: "Font Awesome 5 Free" style:normal weight:900 stretch:100 src index:2): bad URI or cross-site access not allowed source: http://media/vendor/fontawesome-free/webfonts/fa-solid-900.woff
Solicitud de origen cruzado bloqueada: La misma política de origen no permite la lectura de recursos remotos en http://media/vendor/fontawesome-free/webfonts/fa-brands-400.woff. (Razón: Solicitud CORS sin éxito). Código de estado: (null).

downloadable font: download failed (font-family: "Font Awesome 5 Brands" style:normal weight:400 stretch:100 src index:2): bad URI or cross-site access not allowed source: http://media/vendor/fontawesome-free/webfonts/fa-brands-400.woff
Solicitud de origen cruzado bloqueada: La misma política de origen no permite la lectura de recursos remotos en http://media/vendor/fontawesome-free/webfonts/fa-regular-400.woff. (Razón: Solicitud CORS sin éxito). Código de estado: (null).

downloadable font: download failed (font-family: "Font Awesome 5 Free" style:normal weight:400 stretch:100 src index:2): bad URI or cross-site access not allowed source: http://media/vendor/fontawesome-free/webfonts/fa-regular-400.woff
Solicitud de origen cruzado bloqueada: La misma política de origen no permite la lectura de recursos remotos en http://media/vendor/fontawesome-free/webfonts/fa-solid-900.ttf. (Razón: Solicitud CORS sin éxito). Código de estado: (null).

The error starts from the line 6129:

@font-face {
  font-family: "Font Awesome 5 Free";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("../../../media/vendor/fontawesome-free/webfonts/fa-regular-400.eot");
  src: url("../../../media/vendor/fontawesome-free/webfonts/fa-regular-400.eot?#iefix") format("embedded-opentype"), url("../../../media/vendor/fontawesome-free/webfonts/fa-regular-400.woff2") format("woff2"), url("../../../media/vendor/fontawesome-free/webfonts/fa-regular-400.woff") format("woff"), url("../../../media/vendor/fontawesome-free/webfonts/fa-regular-400.ttf") format("truetype"), url("../../../media/vendor/fontawesome-free/webfonts/fa-regular-400.svg#fontawesome") format("svg");
}

And similar code lines being found in the same CSS file.

In addition to it, the website starts to load so slow because the browser tries to load the fonts with the incorrect URL.

System information (as much as possible)

PHP: 7.4.21
Joomla version: 4.1.3

Additional comments

Based on #30793 and tested in my local website (disabled font awesome from the template at production).

avatar neoacevedo neoacevedo - open - 23 May 2022
avatar joomla-cms-bot joomla-cms-bot - change - 23 May 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 23 May 2022
avatar drmenzelit
drmenzelit - comment - 23 May 2022

You have a http / https problem that is why the browser is blocking FontAwesome. Tha is more a support question for the forum.

avatar neoacevedo
neoacevedo - comment - 23 May 2022

No, it's from my local machine, but the same error but with https will be printed from my production website. Please, check also the URL generated: http://media/vendor/fontawesome-free/webfonts/fa-solid-900.ttf, the same URL is generated in my production website but with HTTPS, with or without HTTPS the URL should be http(s)://my-domain.com/media/vendor/fontawesome-free/webfonts/fa-solid-900.ttf and so on.

avatar brianteeman
brianteeman - comment - 24 May 2022

Without knowing how you are doing this

I have installed a template where I enable/disable Font Awesome:

it is impossible to comment.

avatar chmst chmst - change - 24 May 2022
Labels Added: Information Required
avatar chmst chmst - labeled - 24 May 2022
avatar neoacevedo neoacevedo - close - 25 May 2022
avatar neoacevedo
neoacevedo - comment - 25 May 2022

I have made a more deeper research and I have found the issue not in Joomla at all but else in the HellixUltimate core plugin system:

$this->doc->addStyleSheet(Uri::root(true) . '/media/system/css/joomla-fontawesome.min.css', ['relative' => false, 'version' => 'auto']);

This line is causing the issue I have reported, it's generating the URL like //media/system/css/joomla-font-awesome.min.css, so I will close it because is not a Joomla bug.

avatar neoacevedo neoacevedo - change - 25 May 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-05-25 14:44:17
Closed_By neoacevedo

Add a Comment

Login with GitHub to post a comment