Code that handles the case when the 'format_metrics' query parameter value is 'bc' should be removed as well. This code is in API\Request and DataTablePostProcessor. Should be removed before releasing Piwik 3.0.
Пример #1
0
 /**
  * @param DataTableInterface $dataTable
  * @return DataTableInterface
  */
 public function applyMetricsFormatting($dataTable)
 {
     $formatMetrics = Common::getRequestVar('format_metrics', 0, 'string', $this->request);
     if ($formatMetrics == '0') {
         return $dataTable;
     }
     // in Piwik 2.X & below, metrics are not formatted in API responses except for percents.
     // this code implements this inconsistency
     $onlyFormatPercents = $formatMetrics === 'bc';
     $metricsToFormat = null;
     if ($onlyFormatPercents) {
         $metricsToFormat = $this->apiInconsistencies->getPercentMetricsToFormat();
     }
     $dataTable->filter(array($this->formatter, 'formatMetrics'), array($this->report, $metricsToFormat));
     return $dataTable;
 }