I want to customize (or fully override if needed) some Symfony workflows which are defined in a vendor package.
With the Symfony configuration merging strategy, it’s easy to add some workflow places, transitions, etc… But is it possible to remove them? The most important is to be able to remove transitions, as unreachable places are not a problem.
Example
Let’s say we have this vendor workflow:
framework:
workflows:
vendor_workflow:
places:
- one
- two
- three
transitions:
to_two:
from: [one]
to: two
to_three:
from: [one, two]
to: three
Then how is it possible to:
- Remove transition
to_two
, - Remove
from: one
for transitionto_three
, - Remove the place
one
,
Which would result to this config:
framework:
workflows:
vendor_workflow:
places:
- two
- three
transitions:
to_three:
from: [two]
to: three
What I tried
I tried to add a compiler pass to mutate the unmerged Symfony config of the framework
extension, by removing all the $frameworkConfig['workflows']['vendor_workflow']
keys, but the container builder does not allow to mutate the unmerged config (it only allows to prepend configs with $container->prependExtensionConfig()
)
Context
The vendor is Sylius 1.13, by using the Symfony workflow adapter, and I’m trying to simplify the sylius_order_checkout
workflow by removing everything related to shipping:
- Places
shipping_selected
andshipping_skipped
; - Transitions
skip_shipping
andselect_shipping
.