Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Giehl <stefan@matomo.org>2021-10-19 21:57:25 +0300
committerGitHub <noreply@github.com>2021-10-19 21:57:25 +0300
commitc1b874bc6f40549e02fe36c5dc5474806ca3a1ae (patch)
treed39a962a6462918e459fa6a3a71214cfc1e05e74 /plugins/SegmentEditor/javascripts
parentc15d8dbf98890bf18be7f7cf398e02b994264682 (diff)
Fix segment creation fails when enable_create_realtime_segments = 0 (#18181)
Diffstat (limited to 'plugins/SegmentEditor/javascripts')
-rw-r--r--plugins/SegmentEditor/javascripts/Segmentation.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/SegmentEditor/javascripts/Segmentation.js b/plugins/SegmentEditor/javascripts/Segmentation.js
index 620965d6c1..483c05a251 100644
--- a/plugins/SegmentEditor/javascripts/Segmentation.js
+++ b/plugins/SegmentEditor/javascripts/Segmentation.js
@@ -664,7 +664,12 @@ Segmentation = (function($) {
var segmentStr = getSegmentGeneratorController().getSegmentString();
var segmentId = $(self.form).find(".available_segments_select").val() || "";
var user = $(self.form).find(".enable_all_users_select option:selected").val();
- var autoArchive = $(self.form).find(".auto_archive_select option:selected").val() || 0;
+ // if create realtime segments is disabled, the select field is not available, but we need to use autoArchive = 1
+ if ($(self.form).find(".auto_archive_select").length) {
+ var autoArchive = $(self.form).find(".auto_archive_select option:selected").val() || 0;
+ } else {
+ var autoArchive = 1;
+ }
var params = {
"name": segmentName,
"definition": segmentStr,