"First argument is expected to be a valid callback" message


(ReneS) #1

Hi,

Since installing (not upgrading) 0.4.1, I am getting this in the dashboard where the search engines data is normally showed.

Any ideas?

Thanks,
Rene

Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘Piwik_getSearchEngineUrlFromName’ was given in /is/htdocs/ac5141321_OIQJAJHA/stats-domain-com/core/DataTable/Filter/ColumnCallbackAddMetadata.php on line 51

Backtrace -->
#0 Piwik_ErrorHandler(2, call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘Piwik_getSearchEngineUrlFromName’ was given, /is/htdocs/ac5141321_OIQJAJHA/stats-domain-com/core/DataTable/Filter/ColumnCallbackAddMetadata.php, 51, Array ([row] => Piwik_DataTable_Row Object ([c] => Array ([0] => Array ([label] => Google Images,[nb_uniq_visitors] => 2,[nb_visits] => 2,[nb_actions] => 2,[max_actions] => 1,[sum_visit_length] => 20,[bounce_count] => 2,[nb_visits_converted] => 0),[1] => Array (),[3] => 27)),[key] => 0,[oldValue] => Google Images,[parameters] => Array ([0] => Google Images))) called at [(null):0]
#1 call_user_func_array(Piwik_getSearchEngineUrlFromName, Array ([0] => Google Images)) called at [/is/htdocs/ac5141321_OIQJAJHA/stats-domain-com/core/DataTable/Filter/ColumnCallbackAddMetadata.php:51]
#2 Piwik_DataTable_Filter_ColumnCallbackAddMetadata->filter() called at [/is/htdocs/ac5141321_OIQJAJHA/stats-domain-com/core/DataTable/Filter/ColumnCallbackAddMetadata.php:38]
#3 Piwik_DataTable_Filter_ColumnCallbackAddMetadata->__construct(Piwik_DataTable Object ([] => Array ([0] => Piwik_DataTable_Row Object ([c] => Array ([0] => Array ([label] => Google Images,[nb_uniq_visitors] => 2,[nb_visits] => 2,[nb_actions] => 2,[max_actions] => 1,[sum_visit_length] => 20,[bounce_count] => 2,[nb_visits_converted] => 0),[1] => Array (),[3] => 27)),[1] => Piwik_DataTable_Row Object ([c] => Array ([0] => Array ([label] => Google,[nb_uniq_visitors] => 1,[nb_visits] => 1,[nb_actions] => 7,[max_actions] => 7,[sum_visit_length] => 104,[bounce_count] => 0,[nb_visits_converted] => 0),[1] => Array (),[3] => 28))),[] => 0,[] => 0,[] => 1,[] => ,[] => 2,[] => Array ([0] => Array ([className] => ReplaceColumnNames,[parameters] => Array ([0] => )),[1] => Array ([className] => ReplaceSummaryRowLabel,[parameters] => Array ()),[2] => Array ([className] => ColumnCallbackAddMetadata,[parameters] => Array ([0] => label,[1] => url,[2] => Piwik_getSearchEngineUrlFromName)),[3] => Array ([className] => MetadataCallbackAddMetadata,[parameters] => Array ([0] => url,[1] => logo,[2] => Piwik_getSearchEngineLogoFromUrl)),[4] => Array ([className] => SafeDecodeLabel,[parameters] => Array ())),[] => 2,[] => ,[] => ), label, url, Piwik_getSearchEngineUrlFromName) called at [(null):0]
#4 ReflectionClass->newInstanceArgs(Array ([0] => Piwik_DataTable Object ([] => Array ([0] => Piwik_DataTable_Row Object ([c] => Array ([0] => Array ([label] => Google Images,[nb_uniq_visitors] => 2,[nb_visits] => 2,[nb_actions] => 2,[max_actions] => 1,[sum_visit_length] => 20,[bounce_count] => 2,[nb_visits_converted] => 0),[1] => Array (),[3] => 27)),[1] => Piwik_DataTable_Row Object ([c] => Array ([0] => Array ([label] => Google,[nb_uniq_visitors] => 1,[nb_visits] => 1,[nb_actions] => 7,[max_actions] => 7,[sum_visit_length] => 104,[bounce_count] => 0,[nb_visits_converted] => 0),[1] => Array (),[3] => 28))),[] => 0,[] => 0,[] => 1,[] => ,[] => 2,[] => Array ([0] => Array ([className] => ReplaceColumnNames,[parameters] => Array ([0] => )),[1] => Array ([className] => ReplaceSummaryRowLabel,[parameters] => Array ()),[2] => Array ([className] => ColumnCallbackAddMetadata,[parameters] => Array ([0] => label,[1] => url,[2] => Piwik_getSearchEngineUrlFromName)),[3] => Array ([className] => MetadataCallbackAddMetadata,[parameters] => Array ([0] => url,[1] => logo,[2] => Piwik_getSearchEngineLogoFromUrl)),[4] => Array ([className] => SafeDecodeLabel,[parameters] => Array ())),[] => 2,[] => ,[] => ),[1] => label,[2] => url,[3] => Piwik_getSearchEngineUrlFromName)) called at [/is/htdocs/ac5141321_OIQJAJHA/stats-domain-com/core/DataTable.php:340]
#5 Piwik_DataTable->filter(ColumnCallbackAddMetadata, Array ([0] => label,[1] => url,[2] => Piwik_getSearchEngineUrlFromName)) called at [/is/htdocs/ac5141321_OIQJAJHA/stats-domain-com/core/DataTable.php:373]
#6 Piwik_DataTable->applyQueuedFilters() called at [/is/htdocs/ac5141321_OIQJAJHA/stats-domain-com/core/API/ResponseBuilder.php:262]
#7 Piwik_API_ResponseBuilder->handleDataTable(Piwik_DataTable Object ([] => Array ([0] => Piwik_DataTable_Row Object ([c] => Array ([0] => Array ([label] => Google Images,[nb_uniq_visitors] => 2,[nb_visits] => 2,[nb_actions] => 2,[max_actions] => 1,[sum_visit_length] => 20,[bounce_count] => 2,[nb_visits_converted] => 0),[1] => Array (),[3] => 27)),[1] => Piwik_DataTable_Row Object ([c] => Array ([0] => Array ([label] => Google,[nb_uniq_visitors] => 1,[nb_visits] => 1,[nb_actions] => 7,[max_actions] => 7,[sum_visit_length] => 104,[bounce_count] => 0,[nb_visits_converted] => 0),[1] => Array (),[3] => 28))),[] => 0,[] => 0,[] => 1,[] => ,[] => 2,[] => Array ([0] => Array ([className] => ReplaceColumnNames,[parameters] => Array ([0] => )),[1] => Array ([className] => ReplaceSummaryRowLabel,[parameters] => Array ()),[2] => Array ([className] => ColumnCallbackAddMetadata,[parameters] => Array ([0] => label,[1] => url,[2] => Piwik_getSearchEngineUrlFromName)),[3] => Array ([className] => MetadataCallbackAddMetadata,[parameters] => Array ([0] => url,[1] => logo,[2] => Piwik_getSearchEngineLogoFromUrl)),[4] => Array ([className] => SafeDecodeLabel,[parameters] => Array ())),[] => 2,[] => ,[] => )) called at [/is/htdocs/ac5141321_OIQJAJHA/stats-domain-com/core/API/ResponseBuilder.php:49]
#8 Piwik_API_ResponseBuilder->getResponse(Piwik_DataTable Object ([] => Array ([0] => Piwik_DataTable_Row Object ([c] => Array ([0] => Array ([label] => Google Images,[nb_uniq_visitors] => 2,[nb_visits] => 2,[nb_actions] => 2,[max_actions] => 1,[sum_visit_length] => 20,[bounce_count] => 2,[nb_visits_converted] => 0),[1] => Array (),[3] => 27)),[1] => Piwik_DataTable_Row Object ([c] => Array ([0] => Array ([label] => Google,[nb_uniq_visitors] => 1,[nb_visits] => 1,[nb_actions] => 7,[max_actions] => 7,[sum_visit_length] => 104,[bounce_count] => 0,[nb_visits_converted] => 0),[1] => Array (),[3] => 28))),[] => 0,[] => 0,[] => 1,[] => ,[] => 2,[] => Array ([0] => Array ([className] => ReplaceColumnNames,[parameters] => Array ([0] => )),[1] => Array ([className] => ReplaceSummaryRowLabel,[parameters] => Array ()),[2] => Array ([className] => ColumnCallbackAddMetadata,[parameters] => Array ([0] => label,[1] => url,[2] => Piwik_getSearchEngineUrlFromName)),[3] => Array ([className] => MetadataCallbackAddMetadata,[parameters] => Array ([0] => url,[1] => logo,[2] => Piwik_getSearchEngineLogoFromUrl)),[4] => Array ([className] => SafeDecodeLabel,[parameters] => Array ())),[] => 2,[] => ,[] => )) called at [/is/htdocs/ac5141321_OIQJAJHA/stats-domain-com/core/API/Request.php:115]
#9 Piwik_API_Request->process() called at [/is/htdocs/ac5141321_OIQJAJHA/stats-domain-com/core/ViewDataTable.php:348]
#10 Piwik_ViewDataTable->loadDataTableFromAPI() called at [/is/htdocs/ac5141321_OIQJAJHA/stats-domain-com/core/ViewDataTable/HtmlTable.php:72]
#11 Piwik_ViewDataTable_HtmlTable->main() called at [/is/htdocs/ac5141321_OIQJAJHA/stats-domain-com/core/Controller.php:109]
#12 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] => 1,[show_search] => ,[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.getSearchEngines,[uniqueId] => ReferersgetSearchEngines),[] => 0,[] => ,[] => getSearchEngines,[] => Referers,[] => getKeywordsFromSearchEngineId,[] => Referers.getSearchEngines,[] => ,[] => Array ([label] => Search Engine,[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 Site,[bounce_rate] => Bounce Rate,[revenue_per_visit] => Value per Visit,[goals_conversion_rate] => Visits with Conversions),[] => Array ([0] => label,[1] => nb_visits)), 1) called at [/is/htdocs/ac5141321_OIQJAJHA/stats-domain-com/plugins/Referers/Controller.php:106]
#13 Piwik_Referers_Controller->getSearchEngines(1) called at [/is/htdocs/ac5141321_OIQJAJHA/stats-domain-com/plugins/Referers/Controller.php:43]
#14 Piwik_Referers_Controller->getSearchEnginesAndKeywords() called at [(null):0]
#15 call_user_func_array(Array ([0] => Piwik_Referers_Controller Object ([] => Array ([1] => Referers_DirectEntry,[2] => Referers_SearchEngines,[3] => Referers_Websites,[6] => Referers_Campaigns),[] => Referers,[] => 2009-06-29,[] => Piwik_Date Object ([] => 1246226400),[] => 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] => getSearchEnginesAndKeywords), Array ()) called at [/is/htdocs/ac5141321_OIQJAJHA/stats-domain-com/core/FrontController.php:119]
#16 Piwik_FrontController->dispatch() called at [/is/htdocs/ac5141321_OIQJAJHA/stats-domain-com/index.php:58]


(vipsoft) #2

What version of PHP?


(ReneS) #3

PHPInfo reports 5.2.6.


(vipsoft) #4

I can’t reproduce this in my 5.2.6 set-up.

Make sure plugins/Referers/functions.php exists and is readable.

Try re-activating any plugins that you might have disabled.


(ReneS) #5

I enabled and disabled all plugins. Stays the same. I removed the “Best Search Engines” widget for now to be able to use my installation. See screenshot when browsing the single widget.

Thanks for the help.
[attachment=62:bestsearchengines.png]


(vipsoft) #6

For some reason, API.php isn’t loading.

In plugins/Referers/Controller.php, try adding:

require_once PIWIK_INCLUDE_PATH. "/plugins/Referers/functions.php"

(ReneS) #7

Great… I found it. Piwik is fine, but my /plugins/Referers/functions.php file was damaged. I uploaded it again and everything works great now. Sorry for the confusion and thanks for all the fast responses.