Skip to content

Commit

Permalink
Fix segment SQL fetching for data comparison (#21364)
Browse files Browse the repository at this point in the history
  • Loading branch information
mneudert authored Oct 4, 2023
1 parent b9d6dc8 commit f4209ff
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions core/Segment.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,12 +393,17 @@ protected function getCleanedExpression($expression)
$matchType = $expression[SegmentExpression::INDEX_OPERAND_OPERATOR];
$value = $expression[SegmentExpression::INDEX_OPERAND_VALUE];

$segmentsList = Context::changeIdSite(implode(',', $this->idSites ?: []), function () {
return SegmentsList::get();
});
$segmentObject = $segmentsList->getSegment($name);

$segment = $this->getSegmentByName($name);

if (empty($this->idSites)) {
$segmentsList = SegmentsList::get();
} else {
$segmentsList = Context::changeIdSite(implode(',', $this->idSites), function () {
return SegmentsList::get();
});
}

$segmentObject = $segmentsList->getSegment($name);
$sqlName = $segmentObject->getSqlSegment();

$joinTable = null;
Expand Down

0 comments on commit f4209ff

Please sign in to comment.