@nkuehn opened this Issue on October 20th 2014
  • go to Actions->Events
  • select a date range in the date selector (showing e.g. "Date range: From 2014-10-01 to 2014-10-10")

    works

  • switch to pivot view in the widget settings

    error: WARN CoreHome[2014-10-20 15:45:54] [5e6f8] Failed to get data from API: The date '2014-10-01' is not a correct date range. It should have the following format: 'lastN', 'previousN', 'YYYY-MM-DD,YYYY-MM-DD'.

  • select a single day or a week

    pivot works.

Stack trace:

<a href='/0'>#0</a> /srv/www/piwik.excentos.com/piwik/core/Period.php(102): Piwik\Period\Range->generate()
<a href='/1'>#1</a> /srv/www/piwik.excentos.com/piwik/core/Period/Range.php(96): Piwik\Period->getDateStart()
<a href='/2'>#2</a> /srv/www/piwik.excentos.com/piwik/core/Period.php(272): Piwik\Period\Range->getDateStart()
<a href='/3'>#3</a> /srv/www/piwik.excentos.com/piwik/core/Archive/DataCollection.php(120): Piwik\Period->getRangeString()
<a href='/4'>#4</a> /srv/www/piwik.excentos.com/piwik/core/Archive.php(506): Piwik\Archive\DataCollection->__construct(Array, 'blob', Array, Array, NULL)
<a href='/5'>#5</a> /srv/www/piwik.excentos.com/piwik/core/Archive.php(375): Piwik\Archive->get('Events_name_cat...', 'blob', '2')
<a href='/6'>#6</a> /srv/www/piwik.excentos.com/piwik/core/Archive.php(470): Piwik\Archive->getDataTable('Events_name_cat...', '2')
<a href='/7'>#7</a> /srv/www/piwik.excentos.com/piwik/plugins/Events/API.php(156): Piwik\Archive::getDataTableFromArchive('Events_name_cat...', '1', 'range', '2014-10-09', false, false, '2')
<a href='/8'>#8</a> /srv/www/piwik.excentos.com/piwik/plugins/Events/API.php(203): Piwik\Plugins\Events\API->getDataTable('getCategoryFrom...', '1', 'range', '2014-10-09', false, false, '2')
<a href='/9'>#9</a> [internal function]: Piwik\Plugins\Events\API->getCategoryFromNameId('1', 'range', '2014-10-09', '2', false)
<a href='/10'>#10</a> /srv/www/piwik.excentos.com/piwik/core/API/Proxy.php(209): call_user_func_array(Array, Array)
<a href='/11'>#11</a> /srv/www/piwik.excentos.com/piwik/core/API/Request.php(216): Piwik\API\Proxy->call('\Piwik\Plugins\...', 'getCategoryFrom...', Array)
<a href='/12'>#12</a> /srv/www/piwik.excentos.com/piwik/core/API/Request.php(304): Piwik\API\Request->process()
<a href='/13'>#13</a> /srv/www/piwik.excentos.com/piwik/core/Plugin/Report.php(646): Piwik\API\Request::processRequest('Events.getCateg...', Array)
<a href='/14'>#14</a> /srv/www/piwik.excentos.com/piwik/core/DataTable/Filter/PivotByDimension.php(290): Piwik\Plugin\Report->fetchSubtable(2, Array)
<a href='/15'>#15</a> /srv/www/piwik.excentos.com/piwik/core/DataTable/Filter/PivotByDimension.php(263): Piwik\DataTable\Filter\PivotByDimension->loadSubtable(Object(Piwik\DataTable), Object(Piwik\DataTable\Row))
<a href='/16'>#16</a> /srv/www/piwik.excentos.com/piwik/core/DataTable/Filter/PivotByDimension.php(192): Piwik\DataTable\Filter\PivotByDimension->getIntersectedTable(Object(Piwik\DataTable), Object(Piwik\DataTable\Row))
<a href='/17'>#17</a> /srv/www/piwik.excentos.com/piwik/core/DataTable.php(425): Piwik\DataTable\Filter\PivotByDimension->filter(Object(Piwik\DataTable))
<a href='/18'>#18</a> /srv/www/piwik.excentos.com/piwik/core/API/ResponseBuilder.php(172): Piwik\DataTable->filter('PivotByDimensio...', Array)
<a href='/19'>#19</a> /srv/www/piwik.excentos.com/piwik/core/API/ResponseBuilder.php(91): Piwik\API\ResponseBuilder->handleDataTable(Object(Piwik\DataTable))
<a href='/20'>#20</a> /srv/www/piwik.excentos.com/piwik/core/API/Request.php(218): Piwik\API\ResponseBuilder->getResponse(Object(Piwik\DataTable), 'Events', 'getAction')
<a href='/21'>#21</a> /srv/www/piwik.excentos.com/piwik/core/ViewDataTable/Request.php(48): Piwik\API\Request->process()
<a href='/22'>#22</a> /srv/www/piwik.excentos.com/piwik/core/Plugin/ViewDataTable.php(327): Piwik\ViewDataTable\Request->loadDataTableFromAPI(Array)
<a href='/23'>#23</a> /srv/www/piwik.excentos.com/piwik/core/Plugin/Visualization.php(166): Piwik\Plugin\ViewDataTable->loadDataTableFromAPI(Array)
<a href='/24'>#24</a> /srv/www/piwik.excentos.com/piwik/core/Plugin/ViewDataTable.php(414): Piwik\Plugin\Visualization->buildView()
<a href='/25'>#25</a> /srv/www/piwik.excentos.com/piwik/core/Plugin/Report.php(304): Piwik\Plugin\ViewDataTable->render()
<a href='/26'>#26</a> /srv/www/piwik.excentos.com/piwik/plugins/CoreHome/Controller.php(78): Piwik\Plugin\Report->render()
<a href='/27'>#27</a> [internal function]: Piwik\Plugins\CoreHome\Controller->renderReportWidget('Events', 'getAction')
<a href='/28'>#28</a> /srv/www/piwik.excentos.com/piwik/core/FrontController.php(579): call_user_func_array(Array, Array)
<a href='/29'>#29</a> /srv/www/piwik.excentos.com/piwik/core/FrontController.php(87): Piwik\FrontController->doDispatch(NULL, NULL, NULL)
<a href='/30'>#30</a> /srv/www/piwik.excentos.com/piwik/core/dispatch.php(34): Piwik\FrontController->dispatch()
<a href='/31'>#31</a> /srv/www/piwik.excentos.com/piwik/index.php(46): require_once('/srv/www/piwik....')
<a href='/32'>#32</a> {main}

The date '2014-10-09' is not a correct date range. It should have the following format: 'lastN', 'previousN', 'YYYY-MM-DD,YYYY-MM-DD'.

The date range is passed cleanly in the HTTP calls (date=2014-10-10,2014-10-16)

My suspect is this line: https://github.com/piwik/piwik/blob/5754abc5673707697769bf9ed815ea2af1d62561/core/DataTable/Filter/PivotByDimension.php#L431 -> "date" parameter parses just the start date no matter what kind of period.

(mentioned first in #6364 )

@nkuehn commented on October 21st 2014

:-) that was fast.

@diosmosis commented on October 21st 2014 Member

Your intuition was correct, definitely helped :)

This Issue was closed on October 21st 2014
Powered by GitHub Issue Mirror