@@ -31,7 +31,7 @@ class CmfCoreExtension extends Extension implements PrependExtensionInterface
3131 */
3232 public function prepend (ContainerBuilder $ container )
3333 {
34- // process the configuration of SymfonyCmfCoreExtension
34+ // process the configuration of CmfCoreExtension
3535 $ configs = $ container ->getExtensionConfig ($ this ->getAlias ());
3636 $ parameterBag = $ container ->getParameterBag ();
3737 $ configs = $ parameterBag ->resolveValue ($ configs );
@@ -182,10 +182,9 @@ public function prepend(ContainerBuilder $container)
182182 'persistence ' => array (
183183 'phpcr ' => array (
184184 'enabled ' => $ persistenceConfig ['enabled ' ],
185- 'use_sonata_admin ' => $ persistenceConfig ['use_sonata_admin ' ],
186- 'content_basepath ' => $ persistenceConfig ['basepath ' ].'/content ' ,
187- )
188- )
185+ ),
186+ ),
187+ 'sonata_admin_extension ' => $ persistenceConfig ['use_sonata_admin ' ],
189188 );
190189 break ;
191190 }
@@ -195,6 +194,31 @@ public function prepend(ContainerBuilder $container)
195194 }
196195 }
197196 }
197+
198+ if ($ config ['persistence ' ]['orm ' ]) {
199+ $ bundles = $ container ->getParameter ('kernel.bundles ' );
200+ $ persistenceConfig = $ config ['persistence ' ]['orm ' ];
201+
202+ foreach ($ container ->getExtensions () as $ name => $ extension ) {
203+ $ prependConfig = array ();
204+
205+ switch ($ name ) {
206+ case 'cmf_seo ' :
207+ $ prependConfig = array (
208+ 'persistence ' => array (
209+ 'orm ' => array (
210+ 'enabled ' => $ persistenceConfig ['enabled ' ],
211+ ),
212+ ),
213+ 'sonata_admin_extension ' => $ persistenceConfig ['use_sonata_admin ' ],
214+ );
215+ }
216+
217+ if ($ prependConfig ) {
218+ $ container ->prependExtensionConfig ($ name , $ prependConfig );
219+ }
220+ }
221+ }
198222 }
199223
200224 /**
0 commit comments