@robocoder opened this issue on May 5th 2010

php 5.1.6 user reported getting a notice: - http://forum.piwik.org/index.php?showtopic=7971&view=findpost&p=32671 - http://forum.piwik.org/index.php?showtopic=8501

Notice: Object of class Piwik_Date to string conversion in /var/www/vhosts/mydomainname.com/httpdocs/livestats/libs/Zend/Db/Statement/Pdo.php on line 228

Backtrace -->
#0 Piwik_ErrorHandler(8, Object of class Piwik_Date to string conversion, /var/www/vhosts/mydomainname.com/httpdocs/livestats/libs/Zend/Db/Statement/Pdo.php, 228, Array ([params] => Array ([0] => 2,[1] => 1,[2] => Piwik_Date Object ([] => 1273017600,[] => UTC),[3] => Piwik_Date Object ([] => 1273017600,[] => UTC),[4] => 1,[5] => 2010-05-05 20:41:07,[6] => done,[7] => 2)))
#1 PDOStatement->execute(Array ([0] => 2,[1] => 1,[2] => Piwik_Date Object ([] => 1273017600,[] => UTC),[3] => Piwik_Date Object ([] => 1273017600,[] => UTC),[4] => 1,[5] => 2010-05-05 20:41:07,[6] => done,[7] => 2)) called at [/var/www/vhosts/mydomainname.com/httpdocs/livestats/libs/Zend/Db/Statement/Pdo.php:228]
#2 Zend_Db_Statement_Pdo->_execute(Array ([0] => 2,[1] => 1,[2] => Piwik_Date Object ([] => 1273017600,[] => UTC),[3] => Piwik_Date Object ([] => 1273017600,[] => UTC),[4] => 1,[5] => 2010-05-05 20:41:07,[6] => done,[7] => 2)) called at [/var/www/vhosts/mydomainname.com/httpdocs/livestats/libs/Zend/Db/Statement.php:300]
#3 Zend_Db_Statement->execute(Array ([0] => 2,[1] => 1,[2] => Piwik_Date Object ([] => 1273017600,[] => UTC),[3] => Piwik_Date Object ([] => 1273017600,[] => UTC),[4] => 1,[5] => 2010-05-05 20:41:07,[6] => done,[7] => 2)) called at [/var/www/vhosts/mydomainname.com/httpdocs/livestats/libs/Zend/Db/Adapter/Abstract.php:468]
#4 Zend_Db_Adapter_Abstract->query(INSERT IGNORE INTO piwik_archive_numeric_2010_05 (idarchive, idsite, date1, date2, period, ts_archived, name, value)
VALUES (?,?,?,?,?,?,?,?), Array ([0] => 2,[1] => 1,[2] => Piwik_Date Object ([] => 1273017600,[] => UTC),[3] => Piwik_Date Object ([] => 1273017600,[] => UTC),[4] => 1,[5] => 2010-05-05 20:41:07,[6] => done,[7] => 2)) called at [/var/www/vhosts/mydomainname.com/httpdocs/livestats/libs/Zend/Db/Adapter/Pdo/Abstract.php:238]
#5 Zend_Db_Adapter_Pdo_Abstract->query(INSERT IGNORE INTO piwik_archive_numeric_2010_05 (idarchive, idsite, date1, date2, period, ts_archived, name, value)
VALUES (?,?,?,?,?,?,?,?), Array ([0] => 2,[1] => 1,[2] => Piwik_Date Object ([] => 1273017600,[] => UTC),[3] => Piwik_Date Object ([] => 1273017600,[] => UTC),[4] => 1,[5] => 2010-05-05 20:41:07,[6] => done,[7] => 2)) called at [/var/www/vhosts/mydomainname.com/httpdocs/livestats/core/PluginsFunctions/Sql.php:41]
#6 Piwik_Sql::query(INSERT IGNORE INTO piwik_archive_numeric_2010_05 (idarchive, idsite, date1, date2, period, ts_archived, name, value)
VALUES (?,?,?,?,?,?,?,?), Array ([0] => 2,[1] => 1,[2] => Piwik_Date Object ([] => 1273017600,[] => UTC),[3] => Piwik_Date Object ([] => 1273017600,[] => UTC),[4] => 1,[5] => 2010-05-05 20:41:07,[6] => done,[7] => 2)) called at [/var/www/vhosts/mydomainname.com/httpdocs/livestats/core/PluginsFunctions/Sql.php:86]
#7 Piwik_Query(INSERT IGNORE INTO piwik_archive_numeric_2010_05 (idarchive, idsite, date1, date2, period, ts_archived, name, value)
VALUES (?,?,?,?,?,?,?,?), Array ([0] => 2,[1] => 1,[2] => Piwik_Date Object ([] => 1273017600,[] => UTC),[3] => Piwik_Date Object ([] => 1273017600,[] => UTC),[4] => 1,[5] => 2010-05-05 20:41:07,[6] => done,[7] => 2)) called at [/var/www/vhosts/mydomainname.com/httpdocs/livestats/core/ArchiveProcessing.php:634]
#8 Piwik_ArchiveProcessing->insertRecord(Piwik_ArchiveProcessing_Record_Numeric Object ([name] => done,[value] => 2)) called at [/var/www/vhosts/mydomainname.com/httpdocs/livestats/core/ArchiveProcessing.php:567]
#9 Piwik_ArchiveProcessing->insertNumericRecord(done, 2) called at [/var/www/vhosts/mydomainname.com/httpdocs/livestats/core/ArchiveProcessing.php:428]
#10 Piwik_ArchiveProcessing->initCompute() called at [/var/www/vhosts/mydomainname.com/httpdocs/livestats/core/ArchiveProcessing.php:409]
#11 Piwik_ArchiveProcessing->launchArchiving() called at [/var/www/vhosts/mydomainname.com/httpdocs/livestats/core/Archive/Single.php:185]
#12 Piwik_Archive_Single->prepareArchive() called at [/var/www/vhosts/mydomainname.com/httpdocs/livestats/core/Archive.php:170]
#13 Piwik_Archive::build(1, day, 2010-05-05) called at [/var/www/vhosts/mydomainname.com/httpdocs/livestats/plugins/VisitorInterest/API.php:33]
#14 Piwik_VisitorInterest_API->getDataTable(VisitorInterest_timeGap, 1, day, 2010-05-05) called at [/var/www/vhosts/mydomainname.com/httpdocs/livestats/plugins/VisitorInterest/API.php:43]
#15 Piwik_VisitorInterest_API->getNumberOfVisitsPerVisitDuration(1, day, 2010-05-05)
#16 call_user_func_array(Array ([0] => Piwik_VisitorInterest_API Object (),[1] => getNumberOfVisitsPerVisitDuration), Array ([0] => 1,[1] => day,[2] => 2010-05-05)) called at [/var/www/vhosts/mydomainname.com/httpdocs/livestats/core/API/Proxy.php:147]
#17 Piwik_API_Proxy->call(Piwik_VisitorInterest_API, getNumberOfVisitsPerVisitDuration, Array ([method] => VisitorInterest.getNumberOfVisitsPerVisitDuration,[format] => original,[filter_limit] => 30,[filter_sort_column] => label,[filter_sort_order] => asc,[module] => VisitorInterest,[action] => getNumberOfVisitsPerVisitDuration,[idSite] => 1,[period] => day,[date] => 2010-05-05)) called at [/var/www/vhosts/mydomainname.com/httpdocs/livestats/core/API/Request.php:113]
#18 Piwik_API_Request->process() called at [/var/www/vhosts/mydomainname.com/httpdocs/livestats/core/ViewDataTable.php:341]
#19 Piwik_ViewDataTable->loadDataTableFromAPI() called at [/var/www/vhosts/mydomainname.com/httpdocs/livestats/core/ViewDataTable/Cloud.php:66]
#20 Piwik_ViewDataTable_Cloud->main() called at [/var/www/vhosts/mydomainname.com/httpdocs/livestats/core/Controller.php:153]
#21 Piwik_Controller->renderView(Piwik_ViewDataTable_Cloud Object ([] => ,[] => CoreHome/templates/cloud.tpl,[] => 1,[] => Array ([filter_sort_column] => label,[filter_sort_order] => asc,[filter_limit] => 30),[] => Array ([show_goals] => ,[show_search] => ,[show_table] => 1,[show_table_all_columns] => ,[show_all_views_icons] => 1,[show_export_as_image_icon] => ,[show_exclude_low_population] => ,[show_offset_information] => ,[show_footer] => 1,[show_footer_icons] => 1,[apiMethodToRequestDataTable] => VisitorInterest.getNumberOfVisitsPerVisitDuration,[uniqueId] => VisitorInterestgetNumberOfVisitsPerVisitDuration),[] => 0,[] => ,[] => getNumberOfVisitsPerVisitDuration,[] => VisitorInterest,[] => ,[] => VisitorInterest.getNumberOfVisitsPerVisitDuration,[] => ,[] => Array ([label] => Visit duration,[nb_visits] => Visits,[nb_actions] => Actions,[max_actions] => Maximum actions in one visit,[sum_visit_length] => Total time spent by visitors (in seconds),[nb_uniq_visitors] => Unique visitors,[nb_actions_per_visit] => Actions per Visit,[avg_time_on_site] => Avg. Time on Website,[bounce_rate] => Bounce Rate,[revenue_per_visit] => Value per Visit,[goals_conversion_rate] => Visits with Conversions),[] => Array ([0] => label,[1] => nb_visits),[isDataAvailable] => 1), ) called at [/var/www/vhosts/mydomainname.com/httpdocs/livestats/plugins/VisitorInterest/Controller.php:40]
#22 Piwik_VisitorInterest_Controller->getNumberOfVisitsPerVisitDuration()
#23 call_user_func_array(Array ([0] => Piwik_VisitorInterest_Controller Object ([] => VisitorInterest,[] => 2010-05-05,[] => Piwik_Date Object ([] => 1273017600,[] => UTC),[] => 1,[] => Piwik_Site Object ([] => 1),[] => Array ([label] => General_ColumnLabel,[nb_visits] => General_ColumnNbVisits,[nb_actions] => General_ColumnNbActions,[max_actions] => General_ColumnMaxActions,[sum_visit_length] => General_ColumnSumVisitLength,[nb_uniq_visitors] => General_ColumnNbUniqVisitors,[nb_actions_per_visit] => General_ColumnActionsPerVisit,[avg_time_on_site] => General_ColumnAvgTimeOnSite,[bounce_rate] => General_ColumnBounceRate,[revenue_per_visit] => General_ColumnValuePerVisit,[goals_conversion_rate] => General_ColumnVisitsWithConversions)),[1] => getNumberOfVisitsPerVisitDuration), Array ()) called at [/var/www/vhosts/mydomainname.com/httpdocs/livestats/core/FrontController.php:129]
#24 Piwik_FrontController->dispatch() called at [/var/www/vhosts/mydomainname.com/httpdocs/livestats/index.php:59]

It's not apparent from the manual ( http://us3.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.tostring ), but I think we need to explicitly cast Piwik_Date objects to string, in order to suppress the notice.

@robocoder commented on May 6th 2010

dupes #1328

This issue was closed on May 6th 2010
Powered by GitHub Issue Mirror