-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[FrameworkBundle] Perform-no-deep-merging on workflow transitions' from/to configs #61757
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -471,7 +471,8 @@ | |
| <xsd:element name="metadata" type="metadata" minOccurs="0" maxOccurs="unbounded" /> | ||
| <xsd:element name="guard" type="xsd:string" minOccurs="0" maxOccurs="unbounded" /> | ||
| </xsd:sequence> | ||
| <xsd:attribute name="name" type="xsd:string" use="required" /> | ||
| <xsd:attribute name="name" type="xsd:string" /> | ||
| <xsd:attribute name="key" type="xsd:string" /> | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In XML, we have to differentiate the name and the key of transitions, so that deep-merging them works the same way as in other config formats (appending numeric keys and recursing into associative ones). /cc @jakubtobiasz FYI this is how you'll be able to leverage this fix - use attribute "key" instead of "name" if you use the XML format to define workflows. |
||
| </xsd:complexType> | ||
|
|
||
| <xsd:complexType name="place" mixed="true"> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| <?php | ||
|
|
||
| return function (Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $container) { | ||
| $container->services()->alias('test_workflow', 'workflow.test_workflow')->public(); | ||
| $container->extension('framework', [ | ||
| 'http_method_override' => false, | ||
| 'handle_all_throwables' => true, | ||
| 'annotations' => [ | ||
| 'enabled' => false, | ||
| ], | ||
| 'php_errors' => [ | ||
| 'log' => true, | ||
| ], | ||
| 'workflows' => [ | ||
| 'test_workflow' => [ | ||
| 'type' => 'workflow', | ||
| 'supports' => [ | ||
| 'Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase', | ||
| ], | ||
| 'initial_marking' => ['start'], | ||
| 'places' => [ | ||
| 'start', | ||
| 'middle', | ||
| 'end', | ||
| 'alternative', | ||
| ], | ||
| 'transitions' => [ | ||
| 'base_transition' => [ | ||
| 'from' => ['start'], | ||
| 'to' => ['end'], | ||
| ], | ||
| ], | ||
| ], | ||
| ], | ||
| ]); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| <?php | ||
|
|
||
| return function (Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $container) { | ||
| $container->extension('framework', [ | ||
| 'http_method_override' => false, | ||
| 'handle_all_throwables' => true, | ||
| 'annotations' => [ | ||
| 'enabled' => false, | ||
| ], | ||
| 'php_errors' => [ | ||
| 'log' => true, | ||
| ], | ||
| 'workflows' => [ | ||
| 'test_workflow' => [ | ||
| 'type' => 'workflow', | ||
| 'supports' => [ | ||
| 'Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase', | ||
| ], | ||
| 'initial_marking' => ['start'], | ||
| 'places' => [ | ||
| 'start', | ||
| 'middle', | ||
| 'end', | ||
| 'alternative', | ||
| ], | ||
| 'transitions' => [ | ||
| 'base_transition' => [ | ||
| 'from' => ['middle'], | ||
| 'to' => ['alternative'], | ||
| ], | ||
| ], | ||
| ], | ||
| ], | ||
| ]); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| <?xml version="1.0" encoding="UTF-8" ?> | ||
| <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 https://symfony.com/schema/dic/services/services-1.0.xsd | ||
| http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> | ||
|
|
||
| <services> | ||
| <service id="test_workflow" alias="workflow.test_workflow" public="true" /> | ||
| </services> | ||
| <framework:config http-method-override="false" handle-all-throwables="true"> | ||
| <framework:annotations enabled="false" /> | ||
| <framework:php-errors log="true" /> | ||
| <framework:workflow name="test_workflow" type="workflow"> | ||
| <framework:initial-marking>start</framework:initial-marking> | ||
| <framework:support>Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase</framework:support> | ||
| <framework:place>start</framework:place> | ||
| <framework:place>middle</framework:place> | ||
| <framework:place>end</framework:place> | ||
| <framework:place>alternative</framework:place> | ||
| <framework:transition key="base_transition"> | ||
| <framework:from>start</framework:from> | ||
| <framework:to>end</framework:to> | ||
| </framework:transition> | ||
| </framework:workflow> | ||
| </framework:config> | ||
| </container> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <?xml version="1.0" encoding="UTF-8" ?> | ||
| <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 https://symfony.com/schema/dic/services/services-1.0.xsd | ||
| http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> | ||
|
|
||
| <framework:config http-method-override="false" handle-all-throwables="true"> | ||
| <framework:annotations enabled="false" /> | ||
| <framework:php-errors log="true" /> | ||
| <framework:workflow name="test_workflow" type="workflow"> | ||
| <framework:transition key="base_transition"> | ||
| <framework:from>middle</framework:from> | ||
| <framework:to>alternative</framework:to> | ||
| </framework:transition> | ||
| </framework:workflow> | ||
| </framework:config> | ||
| </container> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| services: | ||
| test_workflow: | ||
| alias: workflow.test_workflow | ||
| public: true | ||
| framework: | ||
| http_method_override: false | ||
| handle_all_throwables: true | ||
| annotations: | ||
| enabled: false | ||
| php_errors: | ||
| log: true | ||
| workflows: | ||
| test_workflow: | ||
| type: workflow | ||
| supports: | ||
| - Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase | ||
| initial_marking: [start] | ||
| places: | ||
| - start | ||
| - middle | ||
| - end | ||
| - alternative | ||
| transitions: | ||
| base_transition: | ||
| from: [start] | ||
| to: [end] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| framework: | ||
| http_method_override: false | ||
| handle_all_throwables: true | ||
| annotations: | ||
| enabled: false | ||
| php_errors: | ||
| log: true | ||
| workflows: | ||
| test_workflow: | ||
| transitions: | ||
| base_transition: | ||
| from: [middle] | ||
| to: [alternative] |
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.
too many intermediary variables made me wonder about this piece of code for too long