?
avatar 810
810
9 Apr 2021

Steps to reproduce the issue

load backend 3th party component.

Expected result

No error.

Actual result

Notice: Trying to get property 'message' of non-object in C:\wamp64\www\j4\plugins\system\stats\stats.php on line 582


Notice: Trying to get property 'message' of non-object in C:\wamp64\www\j4\plugins\system\stats\stats.php on line 582
--


1 | 0.0008 | 365952 | {main}( ) | ...\index.php:0
2 | 0.0009 | 366608 | require_once( 'C:\wamp64\www\j4\administrator\includes\app.php ) | ...\index.php:32
3 | 0.0145 | 1282608 | Joomla\CMS\Application\AdministratorApplication->execute( ) | ...\app.php:63
4 | 0.0157 | 1373400 | Joomla\CMS\Application\AdministratorApplication->doExecute( ) | ...\CMSApplication.php:278
5 | 0.1232 | 2993424 | Joomla\CMS\Application\AdministratorApplication->dispatch( $component = ??? ) | ...\AdministratorApplication.php:186
6 | 0.1289 | 3058016 | Joomla\CMS\Component\ComponentHelper::renderComponent( $option = 'com_ajax', $params = ??? ) | ...\AdministratorApplication.php:143
7 | 0.1325 | 3124216 | Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch( ) | ...\ComponentHelper.php:389
8 | 0.1520 | 3126088 | Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure:C:\wamp64\www\j4\libraries\src\Dispatcher\LegacyComponentDispatcher.php:68-70}( $path = 'C:\\wamp64\\www\\j4\\administrator/components/com_ajax/ajax.php' ) | ...\LegacyComponentDispatcher.php:71
9 | 0.1523 | 3126336 | require_once( 'C:\wamp64\www\j4\administrator\components\com_ajax\ajax.php ) | ...\LegacyComponentDispatcher.php:69
10 | 0.1525 | 3128096 | require_once( 'C:\wamp64\www\j4\components\com_ajax\ajax.php ) | ...\ajax.php:12
11 | 0.1529 | 3136520 | Joomla\CMS\Application\AdministratorApplication->triggerEvent( $eventName = 'onAjaxSendStats', $args = ??? ) | ...\ajax.php:158
12 | 0.1529 | 3136616 | Joomla\Event\Dispatcher->dispatch( $name = 'onAjaxSendStats', $event = class Joomla\Event\Event { protected $name = 'onAjaxSendStats'; protected $arguments = []; protected $stopped = FALSE } ) | ...\EventAware.php:111
13 | 0.1529 | 3137264 | PlgSystemStats->Joomla\CMS\Plugin\{closure:C:\wamp64\www\j4\libraries\src\Plugin\CMSPlugin.php:267-296}( $event = class Joomla\Event\Event { protected $name = 'onAjaxSendStats'; protected $arguments = []; protected $stopped = FALSE } ) | ...\Dispatcher.php:495
14 | 0.1529 | 3137264 | PlgSystemStats->onAjaxSendStats( ) | ...\CMSPlugin.php:285
15 | 0.1624 | 3171776 | PlgSystemStats->sendStats( ) | ...\stats.php:270

System information (as much as possible)

‎4.0.0-beta8-dev git version 8-4-21

Additional comments

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar 810 810 - open - 9 Apr 2021
avatar joomla-cms-bot joomla-cms-bot - change - 9 Apr 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 9 Apr 2021
avatar infograf768
infograf768 - comment - 10 Apr 2021

This happens here too after login in admin, but not always.

Screen Shot 2021-04-10 at 08 03 49

avatar richard67
richard67 - comment - 10 Apr 2021

The code where this exception is thrown looks pretty much the same in J3 and J4 and hasn't changed much in recent years, except prepared statements and namespacing in J4:

In both cases it seem weird to me to use $data->message directly after the $data = json_decode($response->body);. Can we really always assume that the $response->body is valid json and contains a message property for any response code not equal to 200?

avatar Quy
Quy - comment - 10 Apr 2021

Duplicate #32005

avatar HLeithner HLeithner - close - 10 Apr 2021
avatar HLeithner
HLeithner - comment - 10 Apr 2021

A stats server update yesterday broke the server. It's fixed in the meantime.

Maybe the stats code should expect an unreachable server or failure response and should handle it carefully.

avatar HLeithner HLeithner - change - 10 Apr 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-04-10 15:24:04
Closed_By HLeithner
avatar sandramay0905
sandramay0905 - comment - 13 Apr 2021

Maybe the stats code should expect an unreachable server or failure response and should handle it carefully.

@HLeithner #32005 (comment) by @PhilETaylor: "As the collection of stats is optional, a nice-to-have, and is in no way connected with a Joomla admins use of their site, I propose that the code above is changed to remove the throwing of exceptions that report to the user, unless in debug mode.

avatar PhilETaylor
PhilETaylor - comment - 15 Apr 2021

PR #33149

Add a Comment

Login with GitHub to post a comment