Skip to content
Extraits de code Groupes Projets
Valider 04d330ec rédigé par Thomas Steur's avatar Thomas Steur
Parcourir les fichiers

refs #4633 we should convert a segment value to a segment filter before queued...

refs #4633 we should convert a segment value to a segment filter before queued filters are applied which allows us to use the prependSegment filter in combination with AddSegmentValue
parent c20303e1
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -95,17 +95,16 @@ class DataTablePostProcessor ...@@ -95,17 +95,16 @@ class DataTablePostProcessor
// we automatically safe decode all datatable labels (against xss) // we automatically safe decode all datatable labels (against xss)
$dataTable->queueFilter('SafeDecodeLabel'); $dataTable->queueFilter('SafeDecodeLabel');
$dataTable = $this->convertSegmentValueToSegment($dataTable);
$dataTable = $this->applyQueuedFilters($dataTable); $dataTable = $this->applyQueuedFilters($dataTable);
$dataTable = $this->applyRequestedColumnDeletion($dataTable); $dataTable = $this->applyRequestedColumnDeletion($dataTable);
$dataTable = $this->applyLabelFilter($dataTable); $dataTable = $this->applyLabelFilter($dataTable);
$dataTable = $this->applyMetricsFormatting($dataTable); $dataTable = $this->applyMetricsFormatting($dataTable);
$dataTable = $this->convertSegmentValueToSegment($dataTable);
return $dataTable; return $dataTable;
} }
public function convertSegmentValueToSegment(DataTableInterface $dataTable) private function convertSegmentValueToSegment(DataTableInterface $dataTable)
{ {
$dataTable->filter('AddSegmentBySegmentValue', array($this->report)); $dataTable->filter('AddSegmentBySegmentValue', array($this->report));
$dataTable->filter('ColumnCallbackDeleteMetadata', array('segmentValue')); $dataTable->filter('ColumnCallbackDeleteMetadata', array('segmentValue'));
......
...@@ -140,13 +140,8 @@ class API extends \Piwik\Plugin\API ...@@ -140,13 +140,8 @@ class API extends \Piwik\Plugin\API
public function getKeywords($idSite, $period, $date, $segment = false, $expanded = false) public function getKeywords($idSite, $period, $date, $segment = false, $expanded = false)
{ {
$dataTable = $this->getDataTable(Archiver::KEYWORDS_RECORD_NAME, $idSite, $period, $date, $segment, $expanded); $dataTable = $this->getDataTable(Archiver::KEYWORDS_RECORD_NAME, $idSite, $period, $date, $segment, $expanded);
$dataTable->filter('AddSegmentValue', array(function ($label) { $dataTable->filter('AddSegmentValue');
if ($label === false) { $dataTable->queueFilter('PrependSegment', array('referrerType==search;'));
return false;
}
return $label . ';referrerType==search';
}));
$dataTable = $this->handleKeywordNotDefined($dataTable); $dataTable = $this->handleKeywordNotDefined($dataTable);
return $dataTable; return $dataTable;
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter