Lead events filter not work


Typing something in the search box won't filter events correctly.

Typing something in the search box won’t filter events correctly.

I added these few lines…

case ‘page.hit’:
$this->addSearchTextIdentifiedEntry($event, $type, $name);


* @param EventsLeadTimelineEvent $event
* @param $eventTypeKey
* @param $eventTypeName
protected function addSearchTextIdentifiedEntry(EventsLeadTimelineEvent $event, $eventTypeKey, $eventTypeName)
$lead = $event->getLead();
$hits = $this->em->getRepository(‘MauticPageBundle:Hit’)->getHitsByLead($lead->getId(), $event->getQueryOptions());

    // Add to counter
    $event->addToCounter($eventTypeKey, $hits);

    if (!$event->isEngagementCount()) {
        // Add the logs to the event array
        foreach ($hits['results'] as $hit) {
            $icon = 'fa-link';
                        'event'      => $eventTypeKey,
                        'eventType'  => $eventTypeName,
                        'eventLabel' => $hit['url_title'],
                        'timestamp'  => $hit['date_hit'],
                        'icon'       => $icon,
                        'extra'      => [
                            'hits' => $hit,
                        'contentTemplate' => 'MauticLeadBundle:SubscribedEventsTimeline:pagehitadded.html.php',
    } else {
        // Purposively not including this in engagements graph as the engagement is counted by the page hit

please tell me if it is a good approach or not. I’ll tear my hair when an upgrade will take place…