?
avatar PhilETaylor
PhilETaylor
6 May 2021

Steps to reproduce the issue

Logout of Joomla 4 admin
Go to a URL that generates a 403 Forbidden message - here is a quick example:

http://example.com/administrator/index.php?option=com_banners&task=tracks.display&format=raw

Expected result

white text not black text in left sidebar

Actual result

Screenshot 2021-05-06 at 21 42 19

System information (as much as possible)

safari on mac

Additional comments

avatar PhilETaylor PhilETaylor - open - 6 May 2021
avatar joomla-cms-bot joomla-cms-bot - change - 6 May 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 6 May 2021
avatar brianteeman
brianteeman - comment - 7 May 2021

The problem is that none of the error pages are getting the params from the template.

avatar richard67
richard67 - comment - 8 May 2021

In Cassiopeia's error page we also use params from its template style, so it should also be ok for Atum's error page. So it just needs someone having time and mood to fix it.

avatar hans2103
hans2103 - comment - 8 May 2021

I can reproduce the issue. I see the same as the screenshot.
I understand the issue... but... those params are behind locked doors.
On the other hand... I do see some styling.... so I do have some kind of permissions to see the admin template.

When we try to login we don't have permissions either... so displaying this error page should be able to render with the same parameters as the login screen does.

trying to debug the issue now and creating a PR

avatar richard67
richard67 - comment - 8 May 2021

@hans2103 Login to the backend and then try again the error page.

avatar hans2103
hans2103 - comment - 8 May 2021

login.php

in the <head>

<style nonce="ZjNkY2VhNGZkOTZmYmQ4NDc0OTAwZmNkMDI5OWIzYWQ5YmI3Mzk0MDdjMGI0MTcxOGFlYjg2ZGQ2MmE1ZjBlYmVhNzM0ZDlkNDUzZTdhNTIxNDNmMDUyMmRlNWU1ZGJjMTY3ZDc0M2JmNDdiMTUwMDFkNTVkZTRlNmJiYmU2MTQ=">:root {
		--hue: 214;
		--atum-bg-light: #f0f4fb;
		--atum-text-dark: #495057;
		--atum-text-light: #ffffff;
		--atum-link-color: #2a69b8;
		--atum-special-color: #001b4c;
	}</style>

error_login.php

in the <head>

<style nonce="MDMxYjQxYjA0MWQ3ZWNlMmZkZmJmNjkzNDU3Y2VjMDE4NDhlNTAwMjUwNWI4MzUxN2YxMWU2Nzg2ZDI2NTRiNzcxYmVlZTFhYWI1NGM3MDI4MzBlMzdjNTA3Yzk3YjAyZTUxMDc2ZDJiOGMwN2RlNzBjMzFiNTkyM2ZlODlhYjM=">:root {
		--hue: 214;
		--atum-bg-light: --atum-bg-light;
		--atum-text-dark: --atum-text-dark;
		--atum-text-light: --atum-text-light;
		--atum-link-color: --atum-link-color;
		--atum-special-color: --atum-special-color;
	}</style>

This backs the findings of @brianteeman saying that the error page does not get the template params.

avatar hans2103
hans2103 - comment - 8 May 2021

created PR to fix the first row of displayed error page.
#33649

another PR should fix the ability to get the template params while being on the error page.

avatar hans2103
hans2103 - comment - 8 May 2021

color issue

At the beginning of login.php and index.php I see:

/** @var JDocumentHtml $this */

(should be rewritten to HTMLDocument and I will do that in a PR)

At the beginning of error.php, error_full.php and error_login.php I see:

/** @var JDocumentError $this */

(should be rewritten to ErrorDocument and I will do that in a PR)

Investigating HTMLDocument I see

/**
* Array of template parameters
*
* @var array
* @since 1.7.0
*/
public $params = null;

Investigating ErrorDocument I can't find $params

Because $params are not present in ErrorDocument one cannot call them on the error pages.


update

I'm confused..

class ErrorDocument extends HtmlDocument

Since ErrorDocument extends HTMLDocument it should be able to get the params. Or am I wrong?

avatar hans2103
hans2103 - comment - 8 May 2021

While debugging I stumbled upon some J3 classNames that should be replaced by J4 namespaced classNames
Created a PR for that #33651

avatar ciar4n ciar4n - change - 8 May 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-05-08 18:01:28
Closed_By ciar4n
avatar ciar4n ciar4n - close - 8 May 2021
avatar ciar4n
ciar4n - comment - 8 May 2021

PR created.. #33654

avatar hans2103
hans2103 - comment - 8 May 2021

@ciar4n you pr solves the issue indeed... but one cannot reach $this->params within ErrorDocument.
Shouldn't that be fixed too?

Add a Comment

Login with GitHub to post a comment