From 1549db614355de2e68384302d239a75faf79f3e0 Mon Sep 17 00:00:00 2001 From: diosmosis <benaka@piwik.pro> Date: Tue, 18 Nov 2014 03:03:00 -0800 Subject: [PATCH] Removing TODOs and tweaking existing code. --- core/API/DataTablePostProcessor.php | 3 +-- core/DataTable/Filter/ColumnCallbackAddColumn.php | 2 -- core/DataTable/Filter/ColumnCallbackAddColumnPercentage.php | 2 -- core/DataTable/Filter/ColumnCallbackAddColumnQuotient.php | 2 -- core/DataTable/Filter/ColumnCallbackReplace.php | 2 -- plugins/API/ProcessedReport.php | 1 - plugins/Live/API.php | 1 - plugins/VisitFrequency/API.php | 5 ----- 8 files changed, 1 insertion(+), 17 deletions(-) diff --git a/core/API/DataTablePostProcessor.php b/core/API/DataTablePostProcessor.php index 815ea3c911..966905f41b 100644 --- a/core/API/DataTablePostProcessor.php +++ b/core/API/DataTablePostProcessor.php @@ -23,7 +23,7 @@ use Piwik\Plugin\Report; /** * Processes DataTables that should be served through Piwik's APIs. This processing handles * special query parameters and computes processed metrics. It does not included rendering to - * output formates (eg, 'xml'). + * output formats (eg, 'xml'). */ class DataTablePostProcessor { @@ -90,7 +90,6 @@ class DataTablePostProcessor $dataTable = $this->applyGenericFilters($dataTable); - // TODO: if dependent metrics for a processed metric are not present in first row of a table, skip computation $this->applyComputeProcessedMetrics($dataTable); // we automatically safe decode all datatable labels (against xss) diff --git a/core/DataTable/Filter/ColumnCallbackAddColumn.php b/core/DataTable/Filter/ColumnCallbackAddColumn.php index 56c291ae3a..27746c4f28 100755 --- a/core/DataTable/Filter/ColumnCallbackAddColumn.php +++ b/core/DataTable/Filter/ColumnCallbackAddColumn.php @@ -12,8 +12,6 @@ use Piwik\DataTable; use Piwik\DataTable\BaseFilter; /** - * **This class is deprecated, use {@link Piwik\Plugin\ProcessedMetric}s instead.** - * * Adds a new column to every row of a {@link DataTable} based on the result of callback. * * **Basic usage example** diff --git a/core/DataTable/Filter/ColumnCallbackAddColumnPercentage.php b/core/DataTable/Filter/ColumnCallbackAddColumnPercentage.php index ac9171973e..056c129440 100644 --- a/core/DataTable/Filter/ColumnCallbackAddColumnPercentage.php +++ b/core/DataTable/Filter/ColumnCallbackAddColumnPercentage.php @@ -11,8 +11,6 @@ namespace Piwik\DataTable\Filter; use Piwik\Piwik; /** - * **This class is deprecated, use {@link Piwik\Plugin\ProcessedMetric}s instead.** - * * Calculates a percentage value for each row of a {@link DataTable} and adds the result * to each row. * diff --git a/core/DataTable/Filter/ColumnCallbackAddColumnQuotient.php b/core/DataTable/Filter/ColumnCallbackAddColumnQuotient.php index 615d126c6a..81d8eadf04 100644 --- a/core/DataTable/Filter/ColumnCallbackAddColumnQuotient.php +++ b/core/DataTable/Filter/ColumnCallbackAddColumnQuotient.php @@ -13,8 +13,6 @@ use Piwik\DataTable; use Piwik\DataTable\Row; /** - * **This class is deprecated, use {@link Piwik\Plugin\ProcessedMetric}s instead.** - * * Calculates the quotient of two columns and adds the result as a new column * for each row of a DataTable. * diff --git a/core/DataTable/Filter/ColumnCallbackReplace.php b/core/DataTable/Filter/ColumnCallbackReplace.php index 56616dfc68..3e167b5593 100644 --- a/core/DataTable/Filter/ColumnCallbackReplace.php +++ b/core/DataTable/Filter/ColumnCallbackReplace.php @@ -13,8 +13,6 @@ use Piwik\DataTable; use Piwik\DataTable\Row; /** - * **This class is deprecated, use {@link Piwik\Plugin\ProcessedMetric}s instead.** - * * Replaces one or more column values in each row of a DataTable with the results * of a callback. * diff --git a/plugins/API/ProcessedReport.php b/plugins/API/ProcessedReport.php index cd70eff8b9..3aa69325e2 100644 --- a/plugins/API/ProcessedReport.php +++ b/plugins/API/ProcessedReport.php @@ -675,7 +675,6 @@ class ProcessedReport $idSiteForRow = (int) $row->getMetadata('idsite'); } - // TODO: should not call this for formatted processed metrics $prettyValue = self::getPrettyValue($formatter, $idSiteForRow, $columnName, $columnValue, $htmlAllowed = false); $enhancedRow->addColumn($columnName, $prettyValue); } // For example the Maps Widget requires the raw metrics to do advanced datavis diff --git a/plugins/Live/API.php b/plugins/Live/API.php index 12f6b05837..dacee9834f 100644 --- a/plugins/Live/API.php +++ b/plugins/Live/API.php @@ -167,7 +167,6 @@ class API extends \Piwik\Plugin\API $dataTable = $this->loadLastVisitorDetailsFromDatabase($idSite, $period, $date, $segment, $countVisitorsToFetch, $visitorId = false, $minTimestamp, $filterSortOrder); $this->addFilterToCleanVisitors($dataTable, $idSite, $flat, $doNotFetchActions); - // TODO: why is this necessary? shouldn't be. uncomment & see if tests pass. $filterSortColumn = Common::getRequestVar('filter_sort_column', false, 'string'); $filterSortOrder = Common::getRequestVar('filter_sort_order', 'desc', 'string'); diff --git a/plugins/VisitFrequency/API.php b/plugins/VisitFrequency/API.php index 0340ea19e5..97a98f27f8 100644 --- a/plugins/VisitFrequency/API.php +++ b/plugins/VisitFrequency/API.php @@ -51,11 +51,6 @@ class API extends \Piwik\Plugin\API $table = Request::processRequest('VisitsSummary.get', $params); $this->prefixColumns($table, $period); - - $table->filter(function (DataTable $table) { - $table->clearQueuedFilters(); - }); - return $table; } -- GitLab