J4 Issue ?
avatar infograf768
infograf768
13 Aug 2019

Steps to reproduce the issue

Install Persian Language.
The Persian admin language folder contains a specific fa-IR.css which is there to override the font used in the backend template to be more readable in Persian.
In this case it is font-family:Tahoma, Geneva, sans-serif;
Switch admin to Persian.

Expected result

The default body font is now Tahoma.
The code is there in index.php
// Load specific language related CSS HTMLHelper::_('stylesheet', 'administrator/language/' . $lang->getTag() . '/' . $lang->getTag() . '.css', ['version' => 'auto']);

(same issue btw for a custom.css file.)

Actual result

The fa-IR.css (or custom.css) is loaded BEFORE loading the template-rtl.css in rtl (or the template.css in ltr). In some cases also before loading boostrap.css.
Therefore they are overriden and now useless.

Additional comments

This was working perfectly in 3.x and before.
Looks related to joomla.asset.json use instead of simply loading the template css as before.

avatar infograf768 infograf768 - open - 13 Aug 2019
avatar joomla-cms-bot joomla-cms-bot - change - 13 Aug 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 13 Aug 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 13 Aug 2019
Labels Added: J4 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 13 Aug 2019
avatar infograf768 infograf768 - change - 13 Aug 2019
The description was changed
avatar infograf768 infograf768 - edited - 13 Aug 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 14 Aug 2019
Status New Discussion
avatar C-Lodder
C-Lodder - comment - 14 Aug 2019

I suppose the Asset Manager (used for template CSS) deals with things differently to HTMLHelper (used for language CSS)

avatar infograf768
infograf768 - comment - 14 Aug 2019

Obviously. The point is why are we using this Asset Manager and how to solve the issue.

avatar C-Lodder
C-Lodder - comment - 14 Aug 2019
avatar SharkyKZ
SharkyKZ - comment - 14 Aug 2019

Can you check if #25775 fixes the issue?

avatar infograf768
infograf768 - comment - 14 Aug 2019

@SharkyKZ
will do.

In the mean while I found a simple fix by not using the HTMLHelper

$langCssPath = JPATH_ADMINISTRATOR . '/language/' . $lang->getTag() . '/' . $lang->getTag() . '.css';

// Load specific language related CSS
if (file_exists($langCssPath))
{
	$langCss = file_get_contents($langCssPath);
	$this->addStyleDeclaration($langCss);
}

This loads the css after all others.

avatar infograf768
infograf768 - comment - 14 Aug 2019

#25775 solves the issue. Let's wait it is merged to close this one.

avatar Quy
Quy - comment - 7 Jan 2020

#25775 Merged

avatar Quy Quy - change - 7 Jan 2020
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2020-01-07 03:50:27
Closed_By Quy
avatar Quy Quy - close - 7 Jan 2020

Add a Comment

Login with GitHub to post a comment