From 65d8b66b7dee20cc156c690c2842df209182c812 Mon Sep 17 00:00:00 2001 From: Nikita Makarov Date: Fri, 17 Feb 2017 20:41:55 +0300 Subject: [PATCH] BAP-13894: Cron scheduled workflow transitions are not working - CR Fixes --- src/Oro/Bundle/CronBundle/Command/CronCommand.php | 6 +++--- .../Command/HandleTransitionCronTriggerCommand.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Oro/Bundle/CronBundle/Command/CronCommand.php b/src/Oro/Bundle/CronBundle/Command/CronCommand.php index 77213c60e1f..eb190927786 100644 --- a/src/Oro/Bundle/CronBundle/Command/CronCommand.php +++ b/src/Oro/Bundle/CronBundle/Command/CronCommand.php @@ -81,23 +81,23 @@ protected function execute(InputInterface $input, OutputInterface $output) } /** + * Convert command arguments to options. It needed for correctly pass this arguments into ArrayInput: + * new ArrayInput(['name' => 'foo', '--bar' => 'foobar']); + * * @param array $commandOptions * @return array */ protected function resolveOptions(array $commandOptions) { $options = []; - foreach ($commandOptions as $key => $option) { $params = explode('=', $option, 2); - if (is_array($params) && count($params) === 2) { $options[$params[0]] = $params[1]; } else { $options[$key] = $option; } } - return $options; } diff --git a/src/Oro/Bundle/WorkflowBundle/Command/HandleTransitionCronTriggerCommand.php b/src/Oro/Bundle/WorkflowBundle/Command/HandleTransitionCronTriggerCommand.php index beaa687b014..1cdb43d4142 100644 --- a/src/Oro/Bundle/WorkflowBundle/Command/HandleTransitionCronTriggerCommand.php +++ b/src/Oro/Bundle/WorkflowBundle/Command/HandleTransitionCronTriggerCommand.php @@ -4,12 +4,12 @@ use Doctrine\Common\Persistence\ObjectRepository; -use Oro\Bundle\CronBundle\Command\CronCommandInterface; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use Oro\Bundle\CronBundle\Command\CronCommandInterface; use Oro\Bundle\WorkflowBundle\Async\TransitionTriggerMessage; use Oro\Bundle\WorkflowBundle\Async\TransitionTriggerProcessor; use Oro\Bundle\WorkflowBundle\Entity\TransitionCronTrigger;