Support

Admin Tools

#42176 PHP Warning: Attempt to read property "guest" on null in AdminTools Base.php

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
5.3.2
PHP version
8.4.8
Admin Tools version
Admin Tools Pro

Latest post by nicholas on Wednesday, 06 August 2025 09:10 CDT

jjst135

AdminTools system plugin is generating a PHP warning when attempting to access the "guest" property on a null object.

PHP Warning: Attempt to read property "guest" on null in /plugins/system/admintools/src/Feature/Base.php on line 125

nicholas
Akeeba Staff
Manager

You don't happen to have a full backtrace, do you?

The warning is not particularly helpful because the code is like so:

// If the user is already logged in we don't have a login attempt
$user = $this->app->getIdentity();

if (!$user->guest)
{
return false;
}

The error comes from the "if" line. The problem here is that $this->app->getIdentity() is supposed to always return a user object, even if it's a guest. The only case it wouldn't is the CLI application, but this code should be triggered in this case either as it'll have returned a few lines above when we check if this is the administrator application.

Can you please tell me the steps you followed to get this error message? Did it happen when your session expired, perchance?

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

jjst135

Hi Nicholas!

I have created a log analyzer tool that shows / filters errors and warnings from all our sites. My goal is t monitor the sites for warnings and errors. I ha e managed to reduce the amount of errors and warnings signically. 

Back to this warning: In noticed those warnings in my log watcher application. At that point I only have the log lines themselves. It's not very easy to figure out what triggert the warnings. When they are template warnings I usually know pretty well where to look because the are my own templates. But warning sin third party extenson are harder for me to figure out.

 

So for now I don;t have any additional info. But when I come acrooss these warnings again I will try to figure out when and why or how the might be triggered.

Kind regards,

Jip

nicholas
Akeeba Staff
Manager

OK, thank you.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!