Error in segment editor Pre-processed

Using the segment editor with Piwik 1.12 in real-time works without problem but turning it into “Pre-processed” ( segmented reports are pre-processed (faster, requires archive.php cron)) gives me:


Warning: array_merge(): Argument #1 is not an array in /piwik/plugins/SegmentEditor/SegmentEditor.php on line 50 

Backtrace -->

#0 Piwik_ErrorHandler(...) called at [:]
#1 array_merge(...) called at [/piwik/plugins/SegmentEditor/SegmentEditor.php:50]
#2 Piwik_SegmentEditor->getKnownSegmentsToArchiveAllSites(...) called at [:]
#3 call_user_func_array(...) called at [/piwik/libs/Event/Dispatcher.php:284]
#4 Event_Dispatcher->postNotification(...) called at [/piwik/core/PluginsManager.php:674]
#5 Piwik_PostEvent(...) called at [/piwik/core/Piwik.php:1544]
#6 Piwik::getKnownSegmentsToArchive(...) called at [/piwik/core/ArchiveProcessing.php:1020]
#7 Piwik_ArchiveProcessing::shouldProcessReportsAllPluginsFor(...) called at [/piwik/core/ArchiveProcessing.php:1006]
#8 Piwik_ArchiveProcessing->shouldProcessReportsAllPlugins(...) called at [/piwik/core/ArchiveProcessing/Period.php:287]
#9 Piwik_ArchiveProcessing_Period->isThereSomeVisits(...) called at [/piwik/core/Archive/Single.php:233]
#10 Piwik_Archive_Single->prepareArchive(...) called at [/piwik/core/Archive/Single.php:251]
#11 Piwik_Archive_Single->get(...) called at [/piwik/core/Archive/Single.php:499]
#12 Piwik_Archive_Single->getDataTable(...) called at [/piwik/plugins/UserCountry/API.php:197]
#13 Piwik_UserCountry_API->getDataTable(...) called at [/piwik/plugins/UserCountry/API.php:36]
#14 Piwik_UserCountry_API->getCountry(...) called at [:]
#15 call_user_func_array(...) called at [/piwik/core/API/Proxy.php:188]
#16 Piwik_API_Proxy->call(...) called at [/piwik/core/API/Request.php:145]
#17 Piwik_API_Request->process(...) called at [/piwik/core/ViewDataTable.php:423]
#18 Piwik_ViewDataTable->loadDataTableFromAPI(...) called at [/piwik/core/ViewDataTable/HtmlTable.php:79]
#19 Piwik_ViewDataTable_HtmlTable->main(...) called at [/piwik/core/Controller.php:147]
#20 Piwik_Controller->renderView(...) called at [/piwik/plugins/UserCountry/Controller.php:317]
#21 Piwik_UserCountry_Controller->getCountry(...) called at [/piwik/plugins/UserCountry/Controller.php:25]
#22 Piwik_UserCountry_Controller->index(...) called at [:]
#23 call_user_func_array(...) called at [/piwik/core/FrontController.php:125]
#24 Piwik_FrontController->dispatch(...) called at [/piwik/index.php:47]

The segment generating the error is 4 “OR” Visitor IP “is not” x.x.x.x ( I’m filtering out local traffic).

If I do a simple segment based also on Visitor IP but with a single IP, I’m able to turn it into a pre-processed segment.

Dali

I also had this problem if you only apply the segment to a single website it will reslove the error at lease on my instance it does.

I just checked here and Abrady is right, the condition to get the error is also to set " and displayed for all websites".

I added a bug report there: archive.php outputs messages when pre-processing segments · Issue #4005 · matomo-org/matomo · GitHub

Dali

Bug is fixed see: Fix bug in SegmentEditor plugin, make sure getKnownSegmentsToArchiveA… · matomo-org/matomo@c5de357 · GitHub