Skip to content

Commit 4f96305

Browse files
committed
simplified logic for setting the always publish workflow checker
1 parent fe3c1f8 commit 4f96305

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

DependencyInjection/CmfCoreExtension.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,10 @@ public function load(array $configs, ContainerBuilder $container)
184184
$container->setParameter($this->getAlias() . '.persistence.phpcr.basepath', $config['persistence']['phpcr']['basepath']);
185185
}
186186
if ($config['publish_workflow']['enabled']) {
187-
$checker = $this->loadPublishWorkflow($config['publish_workflow'], $loader, $container);
187+
$this->loadPublishWorkflow($config['publish_workflow'], $loader, $container);
188188
} else {
189189
$loader->load('no-publish-workflow.xml');
190-
$checker = 'cmf_core.publish_workflow.checker.always';
191190
}
192-
$container->setAlias('cmf_core.publish_workflow.checker', $checker);
193191

194192
if (isset($config['multilang'])) {
195193
$container->setParameter($this->getAlias() . '.multilang.locales', $config['multilang']['locales']);
@@ -229,8 +227,6 @@ public function setupFormTypes(ContainerBuilder $container, LoaderInterface $loa
229227
* @param XmlFileLoader $loader
230228
* @param ContainerBuilder $container
231229
*
232-
* @return string the name of the workflow checker service to alias
233-
*
234230
* @throws InvalidConfigurationException
235231
*/
236232
private function loadPublishWorkflow($config, XmlFileLoader $loader, ContainerBuilder $container)
@@ -249,7 +245,7 @@ private function loadPublishWorkflow($config, XmlFileLoader $loader, ContainerBu
249245
$container->removeDefinition($this->getAlias() . '.admin_extension.publish_workflow.time_period');
250246
}
251247

252-
return $config['checker_service'];
248+
$container->setAlias('cmf_core.publish_workflow.checker', $config['checker_service']);
253249
}
254250

255251
/**

Resources/config/no-publish-workflow.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<services>
1212

13-
<service id="cmf_core.publish_workflow.checker.always" class="%cmf_core.publish_workflow.checker.class%"/>
13+
<service id="cmf_core.publish_workflow.checker" class="%cmf_core.publish_workflow.checker.class%"/>
1414

1515
</services>
1616
</container>

0 commit comments

Comments
 (0)