diff options
author | Stefan Giehl <stefan@matomo.org> | 2019-05-17 12:24:31 +0300 |
---|---|---|
committer | diosmosis <diosmosis@users.noreply.github.com> | 2019-05-17 12:24:31 +0300 |
commit | 60a33e2f4571580526bc02568af87cd2b148ed9e (patch) | |
tree | 93752ffd59bf92d2b7b899d238c3e71446bb61b2 /plugins/Referrers | |
parent | 813c2e2ff9c4f36f816c6bbf60abfaeba8f59a57 (diff) |
Replace internal API requests with processed ones (#14416)
* replace internal API requests with processed ones
* disable generic filters
* updates expected test file
Diffstat (limited to 'plugins/Referrers')
-rw-r--r-- | plugins/Referrers/API.php | 11 | ||||
-rw-r--r-- | plugins/Referrers/DataTable/Filter/SetGetReferrerTypeSubtables.php | 17 | ||||
-rw-r--r-- | plugins/Referrers/tests/System/expected/test_phpSerialized__Referrers.getReferrerType_year.original | bin | 2864 -> 2864 bytes |
3 files changed, 20 insertions, 8 deletions
diff --git a/plugins/Referrers/API.php b/plugins/Referrers/API.php index 39709278e7..51641e44e5 100644 --- a/plugins/Referrers/API.php +++ b/plugins/Referrers/API.php @@ -9,6 +9,7 @@ namespace Piwik\Plugins\Referrers; use Exception; +use Piwik\API\Request; use Piwik\API\ResponseBuilder; use Piwik\Archive; use Piwik\Common; @@ -144,7 +145,15 @@ class API extends \Piwik\Plugin\API Piwik::checkUserHasViewAccess($idSite); $this->checkSingleSite($idSite, 'getAll'); - $dataTable = $this->getReferrerType($idSite, $period, $date, $segment, $typeReferrer = false, $idSubtable = false, $expanded = true); + $dataTable = Request::processRequest('Referrers.getReferrerType', [ + 'idSite' => $idSite, + 'period' => $period, + 'date' => $date, + 'segment' => $segment, + 'expanded' => true, + 'disable_generic_filters' => true, + 'disable_queued_filters' => true, + ], []); if ($dataTable instanceof DataTable\Map) { throw new Exception("Referrers.getAll with multiple sites or dates is not supported (yet)."); diff --git a/plugins/Referrers/DataTable/Filter/SetGetReferrerTypeSubtables.php b/plugins/Referrers/DataTable/Filter/SetGetReferrerTypeSubtables.php index 22702d66fb..28632f414d 100644 --- a/plugins/Referrers/DataTable/Filter/SetGetReferrerTypeSubtables.php +++ b/plugins/Referrers/DataTable/Filter/SetGetReferrerTypeSubtables.php @@ -8,6 +8,7 @@ */ namespace Piwik\Plugins\Referrers\DataTable\Filter; +use Piwik\API\Request; use Piwik\Common; use Piwik\DataTable\Row; use Piwik\DataTable; @@ -74,13 +75,15 @@ class SetGetReferrerTypeSubtables extends DataTable\BaseFilter // otherwise, we have to get the other datatables // NOTE: not yet possible to do this w/ DataTable\Map instances // (actually it would be maybe possible by using $map->mergeChildren() or so build it would be slow) - $subtable = API::getInstance()->getReferrerType( - $this->idSite, $this->period, $this->date, $this->segment, $type = false, $idSubtable = $typeReferrer - ); - - if ($this->expanded) { - $subtable->applyQueuedFilters(); - } + $subtable = Request::processRequest('Referrers.getReferrerType', [ + 'idSite' => $this->idSite, + 'period' => $this->period, + 'date' => $this->date, + 'segment' => $this->segment, + 'idSubtable' => $typeReferrer, + 'disable_generic_filters' => true, + 'disable_queued_filters' => !$this->expanded + ], []); $row->setSubtable($subtable); } diff --git a/plugins/Referrers/tests/System/expected/test_phpSerialized__Referrers.getReferrerType_year.original b/plugins/Referrers/tests/System/expected/test_phpSerialized__Referrers.getReferrerType_year.original Binary files differindex 6c9207ed0a..95308f2b8b 100644 --- a/plugins/Referrers/tests/System/expected/test_phpSerialized__Referrers.getReferrerType_year.original +++ b/plugins/Referrers/tests/System/expected/test_phpSerialized__Referrers.getReferrerType_year.original |