diff options
author | Stefan Giehl <stefan@matomo.org> | 2021-10-19 21:57:25 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-19 21:57:25 +0300 |
commit | c1b874bc6f40549e02fe36c5dc5474806ca3a1ae (patch) | |
tree | d39a962a6462918e459fa6a3a71214cfc1e05e74 /plugins/SegmentEditor/javascripts | |
parent | c15d8dbf98890bf18be7f7cf398e02b994264682 (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.js | 7 |
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, |