diff --git a/lib/Segments/SegmentsSimpleListRepository.php b/lib/Segments/SegmentsSimpleListRepository.php index c7a1a2270c..e6924e00be 100644 --- a/lib/Segments/SegmentsSimpleListRepository.php +++ b/lib/Segments/SegmentsSimpleListRepository.php @@ -114,6 +114,8 @@ class SegmentsSimpleListRepository { // Fetch subscribers counts for dynamic segments and correct data types foreach ($segments as $key => $segment) { + // BC compatibility fix. PHP8.1+ returns integer but JS apps expect string + $segments[$key]['id'] = (string)$segment['id']; if ($segment['type'] === SegmentEntity::TYPE_DYNAMIC) { $statisticsKey = $subscriberGlobalStatus ?: 'all'; $segments[$key]['subscribers'] = (int)$this->subscribersCountsController->getSegmentStatisticsCountById($segment['id'])[$statisticsKey];