You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug #49682 [FrameworkBundle] Workflow - Fix LogicException about a wrong configuration of "enabled" node (adpauly)
This PR was merged into the 5.4 branch.
Discussion
----------
[FrameworkBundle] Workflow - Fix LogicException about a wrong configuration of "enabled" node
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | /
| License | MIT
| Doc PR | /
When I try to configure the YAML node "enabled" under a workflow configuration:
```yaml
framework:
workflows:
order_approval_state:
enabled: false # <--- HERE
type: state_machine
supports:
- AppBundle\Entity\OrderApproval
```
The following exception is thrown:
```php
//vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
if (isset($workflow['enabled']) && false === $workflow['enabled']) {
throw new LogicException(sprintf('Cannot disable a single workflow. Remove the configuration for the workflow "%s" instead.', $workflow['name']));
}
```
But it actually throws the following PHP error:
```bash
In Configuration.php line 262:
Notice: Undefined index: name
```
I think we should use the **`$key` variable instead of this undefined index.**
`$key` contains the workflow name.
When changing, I get the attempted exception:
```bash
In Configuration.php line 262:
Cannot disable a single workflow. Remove the configuration for the workflow "order_approval_state" instead.
```
(I took a look in 6.2, it doesn't fix yet.)
Commits
-------
14a4fcf [FrameworkBundle] Workflow - Fix LogicException about a wrong configuration of "enabled" node
0 commit comments