Customizing Sylius grids & state machines does not work #9865
Description
Sylius version affected: 1.3.1
Description
When I try to remove a field from Sylius grid or customize Sylius state machine order for sylius_order_checkout
, my configurations are overriden by vendor. For instance, if I add such state_machine config to _sylius.yaml
:
winzou_state_machine:
sylius_order_checkout:
class: "%sylius.model.order.class%"
property_path: checkoutState
graph: sylius_order_checkout
state_machine_class: "%sylius.state_machine.class%"
states:
cart: ~
shipping_selected: ~
addressed: ~
shipping_skipped: ~
payment_skipped: ~
payment_selected: ~
completed: ~
transitions:
select_shipping:
from: [cart, shipping_selected, addressed, payment_selected, payment_skipped]
to: shipping_selected
address:
from: [addressed, shipping_selected, shipping_skipped, payment_selected, payment_skipped]
to: addressed
skip_shipping:
from: [addressed]
to: shipping_skipped
skip_payment:
from: [addressed]
to: payment_skipped
select_payment:
from: [addressed, payment_selected, shipping_skipped, shipping_selected]
to: payment_selected
complete:
from: [payment_selected, payment_skipped]
to: completed
callbacks:
after:
sylius_process_cart:
on: ["select_shipping", "address", "select_payment", "skip_shipping", "skip_payment"]
do: ["@sylius.order_processing.order_processor", "process"]
args: ["object"]
sylius_create_order:
on: ["complete"]
do: ["@sm.callback.cascade_transition", "apply"]
args: ["object", "event", "'create'", "'sylius_order'"]
sylius_save_checkout_completion_date:
on: ["complete"]
do: ["object", "completeCheckout"]
args: ["object"]
sylius_skip_shipping:
on: ["address"]
do: ["@sylius.state_resolver.order_checkout", "resolve"]
args: ["object"]
priority: 1
sylius_skip_payment:
on: ["select_shipping"]
do: ["@sylius.state_resolver.order_checkout", "resolve"]
args: ["object"]
priority: 1
sylius_control_payment_state:
on: ["complete"]
do: ["@sylius.state_resolver.order_payment", "resolve"]
args: ["object"]
sylius_control_shipping_state:
on: ["complete"]
do: ["@sylius.state_resolver.order_shipping", "resolve"]
args: ["object"]
it only get's parsed when I remove the content from vendor/sylius/sylius/src/Sylius/Bundle/CoreBundle/Resources/config/app/state_machine/sylius_order_checkout.yml
. Moving the config to src/Resources/SyliusCoreBundle/config/app/state_machine/sylius_order_checkout.yml
does not help either.
Similar thing applies to customizing grids, when I want to remove or override a specific field.
My conslusion is that the vendor has higher priority in config load than app. I suppose this bug applies to overriding all configs from vendor and it could be Symfony 4 bug as well.