Skip to content
Extraits de code Groupes Projets
Valider 238f4972 rédigé par mattab's avatar mattab
Parcourir les fichiers

Fix notice

parent 353bb6b1
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -55,11 +55,8 @@ class API extends \Piwik\Plugin\API ...@@ -55,11 +55,8 @@ class API extends \Piwik\Plugin\API
/** /**
* @ignore * @ignore
*/ */
public function getActionToLoadSubtables($apiMethod, $secondaryDimension = false) public function getActionToLoadSubtables($apiMethod, $secondaryDimension)
{ {
if(empty($secondaryDimension)) {
$secondaryDimension = $this->getDefaultSecondaryDimension($apiMethod);
}
$recordName = $this->getRecordNameForAction($apiMethod, $secondaryDimension); $recordName = $this->getRecordNameForAction($apiMethod, $secondaryDimension);
$apiMethod = array_search( $recordName, $this->mappingApiToRecord ); $apiMethod = array_search( $recordName, $this->mappingApiToRecord );
return $apiMethod; return $apiMethod;
......
...@@ -150,10 +150,9 @@ class Events extends \Piwik\Plugin ...@@ -150,10 +150,9 @@ class Events extends \Piwik\Plugin
$documentation = $this->getMetricDocumentation(); $documentation = $this->getMetricDocumentation();
$labelTranslations = $this->getLabelTranslations(); $labelTranslations = $this->getLabelTranslations();
$secondaryDimension = $this->getSecondaryDimensionFromRequest();
$order = 0; $order = 0;
foreach($labelTranslations as $action => $translations) { foreach($labelTranslations as $action => $translations) {
$secondaryDimension = $this->getSecondaryDimensionFromRequest($action);
$actionToLoadSubtables = API::getInstance()->getActionToLoadSubtables($action, $secondaryDimension); $actionToLoadSubtables = API::getInstance()->getActionToLoadSubtables($action, $secondaryDimension);
$reports[] = array( $reports[] = array(
'category' => Piwik::translate('Events_Events'), 'category' => Piwik::translate('Events_Events'),
...@@ -216,7 +215,7 @@ class Events extends \Piwik\Plugin ...@@ -216,7 +215,7 @@ class Events extends \Piwik\Plugin
// eg. 'Events.getCategory' // eg. 'Events.getCategory'
$apiMethod = $view->requestConfig->getApiMethodToRequest(); $apiMethod = $view->requestConfig->getApiMethodToRequest();
$secondaryDimension = $this->getSecondaryDimensionFromRequest(); $secondaryDimension = $this->getSecondaryDimensionFromRequest($apiMethod);
$view->config->subtable_controller_action = API::getInstance()->getActionToLoadSubtables($apiMethod, $secondaryDimension); $view->config->subtable_controller_action = API::getInstance()->getActionToLoadSubtables($apiMethod, $secondaryDimension);
$view->config->columns_to_display = array('label', 'nb_events', 'sum_event_value'); $view->config->columns_to_display = array('label', 'nb_events', 'sum_event_value');
...@@ -297,8 +296,9 @@ class Events extends \Piwik\Plugin ...@@ -297,8 +296,9 @@ class Events extends \Piwik\Plugin
/** /**
* @return mixed * @return mixed
*/ */
protected function getSecondaryDimensionFromRequest() protected function getSecondaryDimensionFromRequest($apiMethod)
{ {
$defaultSecondaryDimension = API::getInstance()->getDefaultSecondaryDimension($apiMethod);
return Common::getRequestVar('secondaryDimension', false, 'string'); return Common::getRequestVar('secondaryDimension', false, 'string');
} }
} }
Subproject commit 728645ac2dbd9a1f74ac59ecea156f44e138c601 Subproject commit a60c3c63088d339a6ca8dd630422eb33833997f4
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter