Error when login with Mobile App


(Dimitar Atanasov) #1

Here is message that I received trying to login with mobile app. It comes after updating to version 2.8.3.


There is an error. Please report the message (Piwik 2.8.3) and full backtrace in the Piwik forums (please do a Search first as it might have been reported already!).

Notice: Undefined property: stdClass::$module in /var/www/analytics/plugins/Dashboard/API.php on line 137

Backtrace -->

#0 Piwik\Error::errorHandler(…) called at [/var/www/analytics/plugins/Dashboard/API.php:137]
#1 Piwik\Plugins\Dashboard\API->widgetExists(…) called at [/var/www/analytics/plugins/Dashboard/API.php:94]
#2 Piwik\Plugins\Dashboard\API->getExistingWidgetsWithinDashboard(…) called at [/var/www/analytics/plugins/Dashboard/API.php:76]
#3 Piwik\Plugins\Dashboard\API->getUserDashboards(…) called at [/var/www/analytics/plugins/Dashboard/API.php:35]
#4 Piwik\Plugins\Dashboard\API->getDashboards(…) called at [:]
#5 call_user_func_array(…) called at [/var/www/analytics/core/API/Proxy.php:211]
#6 Piwik\API\Proxy->call(…) called at [/var/www/analytics/core/API/Request.php:216]
#7 Piwik\API\Request->process(…) called at [/var/www/analytics/plugins/API/API.php:513]
#8 Piwik\Plugins\API\API->getBulkRequest(…) called at [:]
#9 call_user_func_array(…) called at [/var/www/analytics/core/API/Proxy.php:211]
#10 Piwik\API\Proxy->call(…) called at [/var/www/analytics/core/API/Request.php:216]
#11 Piwik\API\Request->process(…) called at [/var/www/analytics/plugins/API/Controller.php:33]
#12 Piwik\Plugins\API\Controller->index(…) called at [:]
#13 call_user_func_array(…) called at [/var/www/analytics/core/FrontController.php:587]
#14 Piwik\FrontController->doDispatch(…) called at [/var/www/analytics/core/FrontController.php:95]
#15 Piwik\FrontController->dispatch(…) called at [/var/www/analytics/core/dispatch.php:34]
#16 require_once(…) called at [/var/www/analytics/index.php:46]


(Dimitar Atanasov) #2

Since nobody give me responce here, I do a manual fix on the code and now it’s working great.
Here is the fix:

In file /plugins/Dashboard/API.php on line 131 replace the function


    private function widgetExists($widget)
    {
        if (empty($widget->parameters)) {
            return false;
        }

        $module = $widget->parameters->module;
        $action = $widget->parameters->action;

        return WidgetsList::isDefined($module, $action);
    }

with this one


    private function widgetExists($widget)
    {
        if (empty($widget->parameters)) {
            return false;
        }
        elseif (!property_exists($widget->parameters, 'module')) {
	    return false;
	}

        $module = $widget->parameters->module;
        $action = $widget->parameters->action;

        return WidgetsList::isDefined($module, $action);
    }

and that will do the trick.


(Matthieu Aubry) #3

Hi there, thanks for the report! it was fixed in Notice: Undefined property: stdClass::$module in plugins/Dashboard/API.php on line 137 · Issue #6798 · matomo-org/matomo · GitHub


(Dimitar Atanasov) #4

You are welcome.