Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#1328 closed Bug (fixed)

PHP 5.1.x Notice: Object of class Piwik_Date to string conversion

Reported by: mnlipp Owned by:
Priority: critical Milestone: Piwik 0.6.1
Component: Core Keywords:
Cc: Sensitive: no

Description

After updating to 0.6 I get the following error displayed all over the pages (and I wish I hadn't believed in the magic and made a backup...)

Notice: Object of class Piwik_Date to string conversion in /var/www/html/piwik/libs/Zend/Db/Statement/Pdo.php on line 228

Backtrace -->
#0 Piwik_ErrorHandler(8, Object of class Piwik_Date to string conversion, /var/www/html/piwik/libs/Zend/Db/Statement/Pdo.php, 228, Array ([params] => Array ([0] => 5,[1] => 1,[2] => Piwik_Date Object ([] => 1273017600,[] => UTC),[3] => Piwik_Date Object ([] => 1273017600,[] => UTC),[4] => 1,[5] => 2010-05-05 20:19:06,[6] => done,[7] => 2)))
#1 PDOStatement->execute(Array ([0] => 5,[1] => 1,[2] => Piwik_Date Object ([] => 1273017600,[] => UTC),[3] => Piwik_Date Object ([] => 1273017600,[] => UTC),[4] => 1,[5] => 2010-05-05 20:19:06,[6] => done,[7] => 2)) called at var/www/html/piwik/libs/Zend/Db/Statement/Pdo.php:228
#2 Zend_Db_Statement_Pdo->_execute(Array ([0] => 5,[1] => 1,[2] => Piwik_Date Object ([] => 1273017600,[] => UTC),[3] => Piwik_Date Object ([] => 1273017600,[] => UTC),[4] => 1,[5] => 2010-05-05 20:19:06,[6] => done,[7] => 2)) called at var/www/html/piwik/libs/Zend/Db/Statement.php:300
#3 Zend_Db_Statement->execute(Array ([0] => 5,[1] => 1,[2] => Piwik_Date Object ([] => 1273017600,[] => UTC),[3] => Piwik_Date Object ([] => 1273017600,[] => UTC),[4] => 1,[5] => 2010-05-05 20:19:06,[6] => done,[7] => 2)) called at var/www/html/piwik/libs/Zend/Db/Adapter/Abstract.php:468
#4 Zend_Db_Adapter_Abstract->query(INSERT IGNORE INTO piwik2_archive_numeric_2010_05 (idarchive, idsite, date1, date2, period, ts_archived, name, value)
VALUES (?,?,?,?,?,?,?,?), Array ([0] => 5,[1] => 1,[2] => Piwik_Date Object ([] => 1273017600,[] => UTC),[3] => Piwik_Date Object ([] => 1273017600,[] => UTC),[4] => 1,[5] => 2010-05-05 20:19:06,[6] => done,[7] => 2)) called at var/www/html/piwik/libs/Zend/Db/Adapter/Pdo/Abstract.php:238
#5 Zend_Db_Adapter_Pdo_Abstract->query(INSERT IGNORE INTO piwik2_archive_numeric_2010_05 (idarchive, idsite, date1, date2, period, ts_archived, name, value)
VALUES (?,?,?,?,?,?,?,?), Array ([0] => 5,[1] => 1,[2] => Piwik_Date Object ([] => 1273017600,[] => UTC),[3] => Piwik_Date Object ([] => 1273017600,[] => UTC),[4] => 1,[5] => 2010-05-05 20:19:06,[6] => done,[7] => 2)) called at var/www/html/piwik/core/PluginsFunctions/Sql.php:41
#6 Piwik_Sql::query(INSERT IGNORE INTO piwik2_archive_numeric_2010_05 (idarchive, idsite, date1, date2, period, ts_archived, name, value)
VALUES (?,?,?,?,?,?,?,?), Array ([0] => 5,[1] => 1,[2] => Piwik_Date Object ([] => 1273017600,[] => UTC),[3] => Piwik_Date Object ([] => 1273017600,[] => UTC),[4] => 1,[5] => 2010-05-05 20:19:06,[6] => done,[7] => 2)) called at var/www/html/piwik/core/PluginsFunctions/Sql.php:86
#7 Piwik_Query(INSERT IGNORE INTO piwik2_archive_numeric_2010_05 (idarchive, idsite, date1, date2, period, ts_archived, name, value)
VALUES (?,?,?,?,?,?,?,?), Array ([0] => 5,[1] => 1,[2] => Piwik_Date Object ([] => 1273017600,[] => UTC),[3] => Piwik_Date Object ([] => 1273017600,[] => UTC),[4] => 1,[5] => 2010-05-05 20:19:06,[6] => done,[7] => 2)) called at var/www/html/piwik/core/ArchiveProcessing.php:634
#8 Piwik_ArchiveProcessing->insertRecord(Piwik_ArchiveProcessing_Record_Numeric Object ([name] => done,[value] => 2)) called at var/www/html/piwik/core/ArchiveProcessing.php:567
#9 Piwik_ArchiveProcessing->insertNumericRecord(done, 2) called at var/www/html/piwik/core/ArchiveProcessing.php:428
#10 Piwik_ArchiveProcessing->initCompute() called at var/www/html/piwik/core/ArchiveProcessing.php:409
#11 Piwik_ArchiveProcessing->launchArchiving() called at var/www/html/piwik/core/Archive/Single.php:185
#12 Piwik_Archive_Single->prepareArchive() called at var/www/html/piwik/core/Archive.php:170
#13 Piwik_Archive::build(1, day, 2010-05-05) called at var/www/html/piwik/plugins/Referers/API.php:44
#14 Piwik_Referers_API->getDataTable(Referers_searchEngineByKeyword, 1, day, 2010-05-05, ) called at var/www/html/piwik/plugins/Referers/API.php:73
#15 Piwik_Referers_API->getKeywords(1, day, 2010-05-05, )
#16 call_user_func_array(Array ([0] => Piwik_Referers_API Object (),[1] => getKeywords), Array ([0] => 1,[1] => day,[2] => 2010-05-05,[3] => )) called at var/www/html/piwik/core/API/Proxy.php:147
#17 Piwik_API_Proxy->call(Piwik_Referers_API, getKeywords, Array ([method] => Referers.getKeywords,[format] => original,[filter_limit] => 10,[filter_sort_column] => nb_visits,[filter_sort_order] => desc,[module] => Referers,[action] => getKeywords,[idSite] => 1,[period] => day,[date] => 2010-05-05)) called at var/www/html/piwik/core/API/Request.php:113
#18 Piwik_API_Request->process() called at var/www/html/piwik/core/ViewDataTable.php:341
#19 Piwik_ViewDataTable->loadDataTableFromAPI() called at var/www/html/piwik/core/ViewDataTable/HtmlTable.php:75
#20 Piwik_ViewDataTable_HtmlTable->main() called at var/www/html/piwik/core/Controller.php:153
#21 Piwik_Controller->renderView(Piwik_ViewDataTable_HtmlTable Object ([] => ,[arrayDataTable] => ,[] => CoreHome/templates/datatable.tpl,[] => 1,[] => Array ([enable_sort] => 1,[filter_sort_column] => nb_visits,[filter_sort_order] => desc,[filter_limit] => 10),[] => Array ([show_goals] => ,[show_search] => 1,[show_table] => 1,[show_table_all_columns] => 1,[show_all_views_icons] => 1,[show_export_as_image_icon] => ,[show_exclude_low_population] => ,[show_offset_information] => 1,[show_footer] => 1,[show_footer_icons] => 1,[apiMethodToRequestDataTable] => Referers.getKeywords,[uniqueId] => ReferersgetKeywords),[] => 0,[] => ,[] => getKeywords,[] => Referers,[] => getSearchEnginesFromKeywordId,[] => Referers.getKeywords,[] => ,[] => Array ([label] => Stichwort,[nb_visits] => Besucher,[nb_actions] => Aktionen,[max_actions] => Maximale Aktionen bei einem Besuch,[sum_visit_length] => Von Besuchern verbrachte Gesamtzeit (in Sekunden),[nb_uniq_visitors] => Eindeutige Besucher,[nb_actions_per_visit] => Aktionen pro Besuch,[avg_time_on_site] => Durchschnittszeit auf der Seite,[bounce_rate] => Absprungsrate,[revenue_per_visit] => Wert pro Besuch,[goals_conversion_rate] => Besuche mit Konversionen),[] => Array ([0] => label,[1] => nb_visits),[isDataAvailable] => 1), ) called at var/www/html/piwik/plugins/Referers/Controller.php:91
#22 Piwik_Referers_Controller->getKeywords()
#23 call_user_func_array(Array ([0] => Piwik_Referers_Controller Object ([] => Array ([1] => Referers_DirectEntry,[2] => Referers_SearchEngines,[3] => Referers_Websites,[6] => Referers_Campaigns),[] => Referers,[] => 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] => getKeywords), Array ()) called at var/www/html/piwik/core/FrontController.php:129
#24 Piwik_FrontController->dispatch() called at var/www/html/piwik/index.php:59

Attachments (1)

1328.patch (1.1 KB) - added by vipsoft 4 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 4 years ago by vipsoft (robocoder)

PHP 5.1.x, right?

Please try the attached patch. (I'm not sure the change to core/ViewDataTable/GenerateGraphData/ChartEvolution.php is necessary.)

comment:2 Changed 4 years ago by vipsoft (robocoder)

  • Milestone set to 1 - Piwik 0.7 - DigitalVibes

Changed 4 years ago by vipsoft (robocoder)

comment:3 Changed 4 years ago by mnlipp

Great, thank you very much, it works now!

And yes, PHP 5.1.6, mentioned as sufficient in the technical requirements (I know it's old, but these server editions, CentOS in my case, move on slowly).

Somehow, I had assumed that new releases would still be tested on this platform...

comment:4 Changed 4 years ago by matt (mattab)

  • Resolution set to fixed
  • Status changed from new to closed

(In [2141]) Fixes #1328 patch from Anthon

comment:5 Changed 4 years ago by demondmitriy

comment:6 Changed 4 years ago by vipsoft (robocoder)

  • Summary changed from piwik 0.6 fails: Object of class Piwik_Date to string conversion to PHP 5.1.x Notice: Object of class Piwik_Date to string conversion
Note: See TracTickets for help on using tickets.