diff options
author | Matthieu Aubry <mattab@users.noreply.github.com> | 2017-11-20 00:11:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-20 00:11:48 +0300 |
commit | 89569c9c6f223456c0139f41add2e941b2368c55 (patch) | |
tree | dc64ae5470a2035ec9b359352250acb38fff2b86 /plugins/SegmentEditor | |
parent | 016634913d642bd5fadb4ecd00afa4eda4c85c02 (diff) |
Make all new segments "Pre-processed" when browser_archiving_disabled_enforce=1 (#12254)
* Make all new segments "Pre-processed" when browser_archiving_disabled_enforce=1
If real time processing of segments is disabled via browser_archiving_disabled_enforce=1
then any segment set to "segmented reports are processed in real time (default)"
will NEVER be showing data (except in the Live/real time reports)
With this PR all new segments will be set to "segmented reports are pre-processed (requires cron)"
It does not fix up existing real segments, but existing real time segments would display a modal explaining the issue (refs https://github.com/piwik/piwik/issues/12253)
* Re-use existing method
* Re-use existing method
Diffstat (limited to 'plugins/SegmentEditor')
-rw-r--r-- | plugins/SegmentEditor/SegmentSelectorControl.php | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/plugins/SegmentEditor/SegmentSelectorControl.php b/plugins/SegmentEditor/SegmentSelectorControl.php index 47434019ef..be9afe1552 100644 --- a/plugins/SegmentEditor/SegmentSelectorControl.php +++ b/plugins/SegmentEditor/SegmentSelectorControl.php @@ -60,7 +60,7 @@ class SegmentSelectorControl extends UIControl $segmentsByCategory[$segment['category']][] = $segment; } - $this->createRealTimeSegmentsIsEnabled = Config::getInstance()->General['enable_create_realtime_segments']; + $this->createRealTimeSegmentsIsEnabled = $this->isCreatingRealTimeSegmentsEnabled(); $this->segmentsByCategory = $segmentsByCategory; $this->nameOfCurrentSegment = ''; $this->isSegmentNotAppliedBecauseBrowserArchivingIsDisabled = 0; @@ -94,9 +94,7 @@ class SegmentSelectorControl extends UIControl private function wouldApplySegment($savedSegment) { - $isBrowserArchivingDisabled = Config::getInstance()->General['browser_archiving_disabled_enforce']; - - if (!$isBrowserArchivingDisabled) { + if (Rules::isBrowserArchivingAvailableForSegments()) { return true; } @@ -133,4 +131,15 @@ class SegmentSelectorControl extends UIControl } return $translations; } + + protected function isCreatingRealTimeSegmentsEnabled() + { + // when browser archiving is disabled for segments, we force new segments to be created as pre-processed + if(!Rules::isBrowserArchivingAvailableForSegments()) { + return false; + } + + return (bool) Config::getInstance()->General['enable_create_realtime_segments']; + } + } |