symfony-cmf / block-bundle

Extends the SonataBlockBundle to integrate with PHPCR ODM
https://cmf.symfony.com
20 stars 51 forks source link

Only register validation metadata when PHPCR is enabled #260

Closed wouterj closed 7 years ago

ElectricMaxxx commented 7 years ago

maybe we can use the routing solution as a generlized one in core-bundle and just extend with some path values from each bundle where we do need it?

wouterj commented 7 years ago

Don't like that very much, as it means a dep on Corebundle for each CMF bundle. Also, there are just 3 or 4 lines of code.

ElectricMaxxx commented 7 years ago

And i don't like code duplication that much. But the dependendency think sounds valid.

dbu commented 7 years ago

apart from the RoutingBundle, our bundles that need the validation depend on the core bundle anyways. @wouterj would you still go for duplication, or would it be ok to provide the compiler pass in core bundle for those bundles that depend on it anyways already?

wouterj commented 7 years ago

Duplicated it now in #264.

Please note that this BC break has been fixed. So we don't get this error in 3.2.1+ anymore. However, it still seems more correct to only register validation metadata when the persistence layer is enabled. Wdyt?

dbu commented 7 years ago

yes, it feels the right way to look at whether the storage method is active, lets keep it in.