Skip to content

Commit

Permalink
Merge pull request mautic#7806 from heathdutton/duplicate-internal-ips
Browse files Browse the repository at this point in the history
Duplicate internal IPs from campaign_lead_event_log with master/slave connections.
  • Loading branch information
dennisameling authored Mar 11, 2020
2 parents 1ca632f + 5e39c77 commit d9c51cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ public function buildLogEntry(Event $event, Lead $contact = null, $isInactiveEve
{
$log = new LeadEventLog();

$log->setIpAddress($this->ipLookupHelper->getIpAddress());
if (!defined('MAUTIC_CAMPAIGN_SYSTEM_TRIGGERED')) {
$log->setIpAddress($this->ipLookupHelper->getIpAddress());
}

$log->setEvent($event);
$log->setCampaign($event->getCampaign());
Expand Down
8 changes: 5 additions & 3 deletions app/bundles/CampaignBundle/Model/EventLogModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,11 @@ public function updateContactEvent(Event $event, Lead $contact, array $parameter
);
break;
case 'ipAddress':
$log->setIpAddress(
$this->ipLookupHelper->getIpAddress($value)
);
if (!defined('MAUTIC_CAMPAIGN_SYSTEM_TRIGGERED')) {
$log->setIpAddress(
$this->ipLookupHelper->getIpAddress($value)
);
}
break;
case 'metadata':
$metadata = $log->getMetadata();
Expand Down

0 comments on commit d9c51cc

Please sign in to comment.