-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] deal with explicitly enabled workflow nodes #28769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...e/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows_explicitly_enabled.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
$container->loadFromExtension('framework', array( | ||
'workflows' => array( | ||
'enabled' => true, | ||
'foo' => array( | ||
'type' => 'workflow', | ||
'supports' => array('Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest'), | ||
'initial_place' => 'bar', | ||
'places' => array('bar', 'baz'), | ||
'transitions' => array( | ||
'bar_baz' => array( | ||
'from' => array('foo'), | ||
'to' => array('bar'), | ||
), | ||
), | ||
), | ||
), | ||
)); |
19 changes: 19 additions & 0 deletions
19
...e/Tests/DependencyInjection/Fixtures/php/workflows_explicitly_enabled_named_workflows.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
$container->loadFromExtension('framework', array( | ||
'workflows' => array( | ||
'enabled' => true, | ||
'workflows' => array( | ||
'type' => 'workflow', | ||
'supports' => array('Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest'), | ||
'initial_place' =&g 8000 t; 'bar', | ||
'places' => array('bar', 'baz'), | ||
'transitions' => array( | ||
'bar_baz' => array( | ||
'from' => array('foo'), | ||
'to' => array('bar'), | ||
), | ||
), | ||
), | ||
), | ||
)); |
19 changes: 19 additions & 0 deletions
19
...e/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/workflows_explicitly_enabled.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" ?> | ||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:framework="http://symfony.com/schema/dic/symfony" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd | ||
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> | ||
|
||
<framework:config> | ||
<framework:workflow enabled="true" name="foo" type="workflow" initial-place="bar"> | ||
<framework:support>Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest</framework:support> | ||
<framework:place>bar</framework:place> | ||
<framework:place>baz</framework:place> | ||
<framework:transition name="bar_baz"> | ||
<framework:from>bar</framework:from> | ||
<framework:to>baz</framework:to> | ||
</framework:transition> | ||
</framework:workflow> | ||
</framework:config> | ||
</container> |
19 changes: 19 additions & 0 deletions
19
...e/Tests/DependencyInjection/Fixtures/xml/workflows_explicitly_enabled_named_workflows.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" ?> | ||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:framework="http://symfony.com/schema/dic/symfony" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd | ||
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> | ||
|
||
<framework:config> | ||
<framework:workflow enabled="true" name="workflows" type="workflow" initial-place="bar"> | ||
<framework:support>Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest</framework:support> | ||
<framework:place>bar</framework:place> | ||
<framework:place>baz</framework:place> | ||
<framework:transition name="bar_baz"> | ||
<framework:from>bar</framework:from> | ||
<framework:to>baz</framework:to> | ||
</framework:transition> | ||
</framework:workflow> | ||
</framework:config> | ||
</container> |
16 changes: 16 additions & 0 deletions
16
...e/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflows_explicitly_enabled.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
framework: | ||
workflows: | ||
enabled: true | ||
workflows: | ||
foo: | ||
type: workflow | ||
supports: | ||
- Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest | ||
initial_place: bar | ||
places: | ||
- bar | ||
- baz | ||
transitions: | ||
bar_baz: | ||
from: [foo] | ||
to: [bar] |
15 changes: 15 additions & 0 deletions
15
...e/Tests/DependencyInjection/Fixtures/yml/workflows_explicitly_enabled_named_workflows.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
framework: | ||
workflows: | ||
enabled: true | ||
workflows: | ||
type: workflow | ||
supports: | ||
- Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest | ||
initial_place: bar | ||
places: | ||
- bar | ||
- baz | ||
transitions: | ||
bar_baz: | ||
from: [foo] | ||
to: [bar] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test currently does not pass. For the other formats the attribute is not configured per workflow but only once. How do we want to handle it in XML? Completely forbidding it? Requiring it to have the same value for each workflow if the attribute is set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@symfony/deciders What is your opinion here? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually what's the meaning of the "enabled" option on the configuration?
as soon as one workflow is defined, workflow is enabled - and if no workflows are defined, it's disabled.
Wouldn't this make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally yes, this option was introduced to be able to explicitly enable the workflow services while not using the config to define your workflows (see #24051 for the context).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XML are boring for the framework configuration.
I would like instead close #28662 as won't fix. Use should use the "regular" way to define workflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway, I would go for supporting
<framework:workflow enabled="true" />
or your current exemple without
enabled="true"
and that's all