Skip to content

Documentation issue: Unable to override statemachine (eg. remove state/transition)Β #12788

Open
@leflings

Description

Sylius docs version: 1.10 (though it looks unchanged for the last several versions). Problem was the same on 1.9. With 1.8 it worked.

Edit: provided reproduction that it works in 1.8

Description
I am trying to follow the guide for customizing state machines, specifically the part about how to remove a state and its transitions. This links to the cookbook about How to customize Sylius checkout which I am aware is outdated.

I am hoping, that since the possibility of removing states/transitions is hinted in the up-to-date part of the docs, some helpful eyes can take a look at this. Prior to 1.9 this approach seemed to work.

I have provided a repository reproducing the problem. Base commit is sylius/sylius-standard installation. Second commit is adding the src/Resources/SyliusCoreBundle/config/app/state_machine/sylius_order_checkout.yml file (unmodified, verbatim copy of the vendor file). Third commit removes two transitions.

Prior to any modification the output of bin/console debug:config winzou_state_machine sylius_order_checkout looks like this (full dump)

...

transitions:
    address:
        from:
            - cart
            - addressed
            - shipping_selected
            - shipping_skipped
            - payment_selected
            - payment_skipped
        to: addressed
    ...
...

After making changes to the local resource file I expect the output to reflect the changes like this:

...
transitions:
    address:
        from:
            - cart
            - addressed
            - shipping_selected
            - shipping_skipped
        to: addressed
    ...
...

However the two removed transitions ([payment_selected, payment_skipped] -> address) are still there.

This stopped working with 1.9. It worked with 1.8.

I am aware that with 1.9 Symfony was updated to 5.X, and I believe this somehow changed the behaviour of resource overriding, though I can't find anything about it in release notes. I have tried getting help for this in both the Sylius and Symfony slack channels, but with no luck.

I am hoping someone can help with this (and update the documentation - I'd be happy to help if only I knew what had changed). It is a very important usecase for us to remove states/transitions.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions