No Code Attached Yet bug
avatar jjnxpct
jjnxpct
5 Aug 2025

ummary

The ActionLogPlugin throws multiple PHP warnings when attempting to access properties on null objects.

Steps to reproduce the issue

Navigate to Joomla administrator backend
Perform actions that trigger the ActionLog plugin
Multiple errors appear in PHP error logs

Expected result

No PHP warnings should be generated.

##Actual result
Multiple PHP warnings are logged.

System information

PHP Version: 8.4.8
Joomla Version: 5.3.2

Additional comments

Error Details:
PHP Warning: Attempt to read property "id" on null in /administrator/components/com_actionlogs/src/Plugin/ActionLogPlugin.php on line 75
PHP Warning: Attempt to read property "username" on null in /administrator/components/com_actionlogs/src/Plugin/ActionLogPlugin.php on line 79
PHP Warning: Attempt to read property "id" on null in /administrator/components/com_actionlogs/src/Plugin/ActionLogPlugin.php on line 83

avatar jjnxpct jjnxpct - open - 5 Aug 2025
avatar joomla-cms-bot joomla-cms-bot - change - 5 Aug 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 5 Aug 2025
avatar jjnxpct jjnxpct - change - 5 Aug 2025
The description was changed
avatar jjnxpct jjnxpct - edited - 5 Aug 2025
avatar jjnxpct jjnxpct - change - 5 Aug 2025
The description was changed
avatar jjnxpct jjnxpct - edited - 5 Aug 2025
avatar jjnxpct jjnxpct - change - 5 Aug 2025
The description was changed
avatar jjnxpct jjnxpct - edited - 5 Aug 2025
avatar brianteeman
brianteeman - comment - 10 Aug 2025

what extensions do you have installed. I ask this because if this was a core problems we would obviously have a lot more reports

avatar jjnxpct
jjnxpct - comment - 11 Aug 2025

I see this warning on most of our managed (nearly 100) sites. All the sites we manage for our clients have extensions like:

  • JCH optimize
  • JCE editor
  • Akeeba Admin Tools
  • Akeeba Backup
    -ACL manager

A number of sites also have:

  • eDocman
  • AcyMailing
  • DPCalendar
  • Convert Forms

And some site have some other extra extension or custom extensions.

But because this warning is on most of our sites I think it is either Joomla core or combined with one of the first 5 mentioned extensions?

Is there anything I can do provide more helpful info?

I am not sure if this is related but we also have a couple of Scheduled Task running on our sites:

  • Remove (old) actionlogs
  • Clear (old) sessions
  • PWT ACL - Rebuild assets
  • PWT ACL Fix assets
  • Rotate logs

But maybe the PHP warning can be fixed by adding some kind of check on the value before proceeding with the script? Just thinking outloud.

avatar brianteeman
brianteeman - comment - 11 Aug 2025

I would start by contacting those extension developers.

If it was something in core then we would obviously have lots of reports not just yours. As the extensions you listed are all commercial extensions its not even possible for someone to voluntarily test them for you.

avatar jjnxpct
jjnxpct - comment - 11 Aug 2025

I don;t feel comfortable just e-mailing multiple developers with an error that is not clearly related to their extension. The answer would also probably be: 'This looks like an issue with the CMS' because com_actionlogs is an Joomla extension.

So I won't be doing that.

I just shared this PHP warning to maybe help out with issues this might cause in the future with the com_actionlogs extension. Because at this point it's 'just' a warning but this might get to be a bigger issue in the future.

Also I would like to have clean logs ;-) But I can add a filter to my logs to ignore this warning.

When my info is not enough to handle this warning feel free to close this issue.

avatar brianteeman
brianteeman - comment - 11 Aug 2025

Please close it then as there is nothing at all that can be done here to help you

avatar jjnxpct
jjnxpct - comment - 11 Aug 2025

It's not about helping me.... I just want to share this so this warning can be assessed and maybe fixed. I will leave it up to moderators (or whoever is responsible for deciding whether this is an issue or not) to close this issue when they think this is not something that needs to be resolved.

I do think something can be done about the warnings. But I am not in a position to decide whether that is the best cause of action regarding this warning.

avatar brianteeman
brianteeman - comment - 11 Aug 2025

nothing can be done here. well not exactly true we could change the action log component to ignore any logs from badly written extensions but hiding errors is never a solution. The action log component reads logs that it is sent by action log plugins. Garbage in will result in garbage out.

avatar alikon alikon - change - 11 Aug 2025
Status New Closed
Closed_Date 0000-00-00 00:00:00 2025-08-11 13:12:48
Closed_By alikon
avatar alikon alikon - close - 11 Aug 2025
avatar alikon
alikon - comment - 11 Aug 2025

You can try to undestand what extension have the problem enabling just one at a time.
This is not a core issue

avatar Fedik
Fedik - comment - 11 Aug 2025

@jjnxpct try temporary add backtrace log after here

Kind of

if (!$user)
{
  ob_start();
  debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
  $dbgStr = ob_get_clean();
  trigger_error('ActionLog backtrace for empty user: ' . PHP_EOL . $dbgStr, E_USER_WARNING);
}

In your php error log should appears the backtrace, before actual error log.
In that trace you should be able to find extension file.

And do not forget to delete that hack.

avatar Fedik Fedik - change - 11 Aug 2025
Status Closed New
Closed_Date 2025-08-11 13:12:48
Closed_By alikon
avatar Fedik Fedik - reopen - 11 Aug 2025
avatar Fedik
Fedik - comment - 11 Aug 2025

I reopen it as a bug,
The ActionLogPlugin should check the user exist before trying to log, because $app->getIdentity() may return null (In opposite to old JFactory::getUser() which ALWAYS return user object)

avatar Fedik Fedik - change - 11 Aug 2025
Labels Added: bug
avatar Fedik Fedik - labeled - 11 Aug 2025
avatar brianteeman
brianteeman - comment - 11 Aug 2025

But the plugin is intended to log the actions of a user so how can it be logging the actions of a non existent user

avatar jjnxpct
jjnxpct - comment - 11 Aug 2025

@Fedik I added the debug code you suggested to log the backtrace. Here are some results from my error log:

/public_html/plugins/actionlog/joomla/src/Extension/Joomla.php(1020): Joomla\Component\Actionlogs\Administrator\Plugin\ActionLogPlugin->addLog()
/public_html/libraries/vendor/joomla/event/src/Dispatcher.php(454): Joomla\Plugin\Actionlog\Joomla\Extension\Joomla->onAfterCheckin()
/public_html/libraries/src/Application/EventAware.php(111): Joomla\Event\Dispatcher->dispatch()
/public_html/plugins/system/cachecleaner/src/Cache/Joomla.php(66): Joomla\CMS\Application\WebApplication->triggerEvent()
/public_html/plugins/system/cachecleaner/src/Cache.php(219): RegularLabs\Plugin\System\CacheCleaner\Cache\Joomla::checkIn()
/public_html/plugins/system/cachecleaner/src/Cache.php(57): RegularLabs\Plugin\System\CacheCleaner\Cache::purge()
/public_html/plugins/system/cachecleaner/cachecleaner.php(59): RegularLabs\Plugin\System\CacheCleaner\Cache::clean()
/public_html/libraries/regularlabs/src/SystemPlugin.php(177): PlgSystemCacheCleaner->handleOnAfterRoute()
/public_html/libraries/src/Plugin/CMSPlugin.php(311): RegularLabs\Library\SystemPlugin->onAfterRoute()
/public_html/libraries/vendor/joomla/event/src/Dispatcher.php(454): Joomla\CMS\Plugin\CMSPlugin->{closure:Joomla\CMS\Plugin\CMSPlugin::registerLegacyListener():295}()
/public_html/libraries/vendor/joomla/application/src/AbstractApplication.php(99): Joomla\Event\Dispatcher->dispatch()
/public_html/libraries/src/Application/AdministratorApplication.php(488): Joomla\Application\AbstractApplication->dispatchEvent()
/public_html/libraries/src/Application/AdministratorApplication.php(180): Joomla\CMS\Application\AdministratorApplication->route()
/public_html/libraries/src/Application/CMSApplication.php(304): Joomla\CMS\Application\AdministratorApplication->doExecute()
/public_html/administrator/includes/app.php(58): Joomla\CMS\Application\CMSApplication->execute()
/public_html/administrator/index.php(32): require_once('/home/########...')

avatar Fedik
Fedik - comment - 11 Aug 2025

But the plugin is intended to log the actions of a user so how can it be logging the actions of a non existent user

Action log can be called in CLI, or in time when the Application does not have user initialized.
There could be 1000 + 1 possibilities.

The fact that $app->getIdentity() may return null tells that this should be checked before using.
In past with JFactory::getUser() it was not important, because it always returned a user object, empty object or object with existing user.

Here are some results from my error log

From trace it seems something with RegularLabs CacheCleaner plugin. You can try to contact them to help with your case.

Add a Comment

Login with GitHub to post a comment