Permalink
Browse files

Fixed a backwards compatibility issue with Mautic < 2.14.

  • Loading branch information...
collinkrawll committed Sep 10, 2018
1 parent be4b0ab commit 83323ff9572e0901602c2c77c6ce58c7265541e9
Showing with 12 additions and 7 deletions.
  1. +12 −7 DependencyInjection/Compiler/OverrideServiceCompilerPass.php
@@ -14,9 +14,9 @@
/**
* Class OverrideServiceCompilerPass.
*
*
* This class has overrides for the Symfony services.
* See:
* See:
* * http://symfony.com/doc/2.8/bundles/override.html#services-configuration
* * http://symfony.com/doc/2.8/service_container/compiler_passes.html
*
@@ -30,23 +30,28 @@ class OverrideServiceCompilerPass implements CompilerPassInterface
*/
public function process(ContainerBuilder $container)
{
$schedulerDefinition = null;
$schedulerDefinition = $container->getDefinition('mautic.campaign.scheduler');
try {
$schedulerDefinition = $container->getDefinition('mautic.campaign.scheduler');
} catch (\Exception $ex) {
//
}
if($schedulerDefinition != null) {
// Mautic >= v2.14.0
$schedulerDefinition
->setClass('MauticPlugin\ThirdSetMauticTimingBundle\Executioner\Scheduler\EventScheduler')
->addArgument(new Reference('plugin.thirdset.timing.timing_helper'));
$eventExecutionerDefinition = $container->getDefinition('mautic.campaign.event_executioner');
$eventExecutionerDefinition->setClass('MauticPlugin\ThirdSetMauticTimingBundle\Executioner\EventExecutioner');
$kickoffExecutionerDefinition = $container->getDefinition('mautic.campaign.executioner.kickoff');
$kickoffExecutionerDefinition->setClass('MauticPlugin\ThirdSetMauticTimingBundle\Executioner\KickoffExecutioner');
$realtimeExecutionerDefinition = $container->getDefinition('mautic.campaign.executioner.realtime');
$realtimeExecutionerDefinition->setClass('MauticPlugin\ThirdSetMauticTimingBundle\Executioner\RealTimeExecutioner');
$scheduledExecutionerDefinition = $container->getDefinition('mautic.campaign.executioner.scheduled');
$scheduledExecutionerDefinition->setClass('MauticPlugin\ThirdSetMauticTimingBundle\Executioner\ScheduledExecutioner');
} else {

0 comments on commit 83323ff

Please sign in to comment.