Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Adding segment to VisitorInterest.getNumberOfVisitsPerVisitDuration causes SQL constraint violation #2758

Closed
vpdb opened this Issue · 3 comments

2 participants

Dan Barrett Matthieu Aubry
Dan Barrett

In 1.6, adding the "segment" query parameter like this:

<div id="widgetIframe"><iframe width="100%" height="350" src="http://example.com/piwik/index.php?module=Widgetize&amp;action=iframe&amp;moduleToWidgetize=VisitorInterest&amp;actionToWidgetize=getNumberOfVisitsPerVisitDuration&amp;idSite=9&amp;period=day&amp;date=yesterday&amp;disableLink=1&amp;widget=1&amp;segment=pageTitle!=nexus" scrolling="no" frameborder="0" marginheight="0" marginwidth="0"></iframe></div>

produces this error message:

SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'server_time' in field list is ambiguous

And this backtrace:

#0 /var/www/html/piwik/libs/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/html/piwik/libs/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /var/www/html/piwik/libs/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('????SELECT?????...', Array)
#3 /var/www/html/piwik/core/Db/Adapter/Pdo/Mysql.php(211): Zend_Db_Adapter_Pdo_Abstract->query('????SELECT?????...', Array)
#4 /var/www/html/piwik/core/ArchiveProcessing/Day.php(349): Piwik_Db_Adapter_Pdo_Mysql->query('????SELECT?????...', Array)
#5 /var/www/html/piwik/plugins/VisitTime/VisitTime.php(163): Piwik_ArchiveProcessing_Day->queryConversionsByDimension('HOUR(server_tim...')
#6 /var/www/html/piwik/plugins/VisitTime/VisitTime.php(133): Piwik_VisitTime->archiveDayAggregateGoals(Object(Piwik_ArchiveProcessing_Day))
#7 function: Piwik_VisitTime->archiveDay(Object(Piwik_Event_Notification))
#8 /var/www/html/piwik/libs/Event/Dispatcher.php(284): call_user_func_array(Array, Array)
#9 /var/www/html/piwik/core/PluginsManager.php(609): Event_Dispatcher->postNotification(Object(Piwik_Event_Notification), false, false)
#10 /var/www/html/piwik/core/ArchiveProcessing/Day.php(42): Piwik_PostEvent('ArchiveProcessi...', Object(Piwik_ArchiveProcessing_Day))
#11 /var/www/html/piwik/cor

Dan Barrett

Full backtrace:

#0 /var/www/html/piwik/libs/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/html/piwik/libs/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /var/www/html/piwik/libs/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('????SELECT?????...', Array)
#3 /var/www/html/piwik/core/Db/Adapter/Pdo/Mysql.php(211): Zend_Db_Adapter_Pdo_Abstract->query('????SELECT?????...', Array)
#4 /var/www/html/piwik/core/ArchiveProcessing/Day.php(349): Piwik_Db_Adapter_Pdo_Mysql->query('????SELECT?????...', Array)
#5 /var/www/html/piwik/plugins/VisitTime/VisitTime.php(163): Piwik_ArchiveProcessing_Day->queryConversionsByDimension('HOUR(server_tim...')
#6 /var/www/html/piwik/plugins/VisitTime/VisitTime.php(133): Piwik_VisitTime->archiveDayAggregateGoals(Object(Piwik_ArchiveProcessing_Day))
#7 function: Piwik_VisitTime->archiveDay(Object(Piwik_Event_Notification))
#8 /var/www/html/piwik/libs/Event/Dispatcher.php(284): call_user_func_array(Array, Array)
#9 /var/www/html/piwik/core/PluginsManager.php(609): Event_Dispatcher->postNotification(Object(Piwik_Event_Notification), false, false)
#10 /var/www/html/piwik/core/ArchiveProcessing/Day.php(42): Piwik_PostEvent('ArchiveProcessi...', Object(Piwik_ArchiveProcessing_Day))
#11 /var/www/html/piwik/core/ArchiveProcessing.php(440): Piwik_ArchiveProcessing_Day->compute()
#12 /var/www/html/piwik/core/Archive/Single.php(224): Piwik_ArchiveProcessing->launchArchiving()
#13 /var/www/html/piwik/core/Archive/Single.php(253): Piwik_Archive_Single->prepareArchive()
#14 /var/www/html/piwik/core/Archive/Single.php(499): Piwik_Archive_Single->get('VisitTime_local...', 'blob')
#15 /var/www/html/piwik/plugins/VisitTime/API.php(34): Piwik_Archive_Single->getDataTable('VisitTime_local...')
#16 /var/www/html/piwik/plugins/VisitTime/API.php(43): Piwik_VisitTime_API->getDataTable('VisitTime_local...', '9', 'day', 'yesterday', 'pageTitle!=nexu...')
#17 function: Piwik_VisitTime_API->getVisitInformationPerLocalTime('9', 'day', 'yesterday', 'pageTitle!=nexu...')
#18 /var/www/html/piwik/core/API/Proxy.php(179): call_user_func_array(Array, Array)
#19 /var/www/html/piwik/core/API/Request.php(121): Piwik_API_Proxy->call('Piwik_VisitTime...', 'getVisitInforma...', Array)
#20 /var/www/html/piwik/core/ViewDataTable.php(391): Piwik_API_Request->process()
#21 /var/www/html/piwik/core/ViewDataTable/GenerateGraphData.php(98): Piwik_ViewDataTable->loadDataTableFromAPI()
#22 /var/www/html/piwik/core/Controller.php(146): Piwik_ViewDataTable_GenerateGraphData->main()
#23 /var/www/html/piwik/plugins/VisitTime/Controller.php(58): Piwik_Controller->renderView(Object(Piwik_ViewDataTable_GenerateGraphData_ChartVerticalBar), false)
#24 function: Piwik_VisitTime_Controller->getVisitInformationPerLocalTime()
#25 /var/www/html/piwik/core/FrontController.php(132): call_user_func_array(Array, Array)
#26 /var/www/html/piwik/core/FrontController.php(153): Piwik_FrontController->dispatch('VisitTime', 'getVisitInforma...', Array)
#27 /var/www/html/piwik/core/ViewDataTable/GenerateGraphHTML.php(148): Piwik_FrontController->fetchDispatch('VisitTime', 'getVisitInforma...', Array)
#28 /var/www/html/piwik/core/ViewDataTable/GenerateGraphHTML.php(108): Piwik_ViewDataTable_GenerateGraphHTML->getGraphData()
#29 /var/www/html/piwik/core/ViewDataTable/GenerateGraphHTML.php(92): Piwik_ViewDataTable_GenerateGraphHTML->buildView()
#30 /var/www/html/piwik/core/Controller.php(146): Piwik_ViewDataTable_GenerateGraphHTML->main()
#31 /var/www/html/piwik/plugins/VisitTime/Controller.php(58): Piwik_Controller->renderView(Object(Piwik_ViewDataTable_GenerateGraphHTML_ChartVerticalBar), true)
#32 function: Piwik_VisitTime_Controller->getVisitInformationPerLocalTime(true)
#33 /var/www/html/piwik/core/FrontController.php(132): call_user_func_array(Array, Array)
#34 /var/www/html/piwik/core/FrontController.php(153): Piwik_FrontController->dispatch('VisitTime', 'getVisitInforma...', Array)
#35 /var/www/html/piwik/plugins/Widgetize/Controller.php(67): Piwik_FrontController->fetchDispatch('VisitTime', 'getVisitInforma...', Array)
#36 function: Piwik_Widgetize_Controller->iframe()
#37 /var/www/html/piwik/core/FrontController.php(132): call_user_func_array(Array, Array)
#38 /var/www/html/piwik/index.php(53): Piwik_FrontController->dispatch()
#39 {main}

Matthieu Aubry
Owner

Thanks for the report, we will fix it in the next days.

Matthieu Aubry
Owner

(In [5564]) Fixes #2758

Dan Barrett vpdb added this to the 1.7 Piwik 1.7 milestone
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.