Skip to content

Commit

Permalink
Updated segment filter
Browse files Browse the repository at this point in the history
  • Loading branch information
shinde-rahul committed May 9, 2023
1 parent 39efd24 commit 797a1e8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions EventListener/LeadSubscriber.php
Expand Up @@ -171,7 +171,7 @@ public function onListChoicesGenerate(LeadListFiltersChoicesEvent $event)

foreach ($activeProducts as $product) {
$eventNames = $this->model->getDistinctEventNamesDesc($product);
$eventNames = array_combine($eventNames, $eventNames);
$eventNames = array_flip($eventNames);
$eventNamesWithoutAny = array_merge(
[
'-' => '-',
Expand Down Expand Up @@ -261,7 +261,6 @@ public function onListFiltering(LeadListFilteringEvent $event)
$currentFilter = $details['field'];
$citrixEventsTable = $em->getClassMetadata('MauticGoToBundle:GoToEvent')->getTableName();
$citrixProductsTable = $em->getClassMetadata('MauticGoToBundle:GoToProduct')->getTableName();
$leadTable = $em->getClassMetadata(Lead::class)->getTableName();

foreach ($activeProducts as $product) {
$eventFilters = [$product.'-registration', $product.'-attendance', $product.'-no-attendance'];
Expand All @@ -273,9 +272,7 @@ public function onListFiltering(LeadListFilteringEvent $event)
if (!$isAnyEvent) {
$eventIds = [];
foreach ($eventNameFilter as $filter) {
preg_match('#^([^ ]+ +[^ ]+) +(.*)$#', $filter, $matches);

$id = $this->model->getIdByNameAndDate($matches[2], $matches[1]);
$id = $this->model->getProductRepository()->findOneByProductKey($filter)->getId();
if ($id) {
$eventIds[] = $id;
}
Expand Down

0 comments on commit 797a1e8

Please sign in to comment.