@@ -31,7 +31,7 @@ class CmfCoreExtension extends Extension implements PrependExtensionInterface
31
31
*/
32
32
public function prepend (ContainerBuilder $ container )
33
33
{
34
- // process the configuration of SymfonyCmfCoreExtension
34
+ // process the configuration of CmfCoreExtension
35
35
$ configs = $ container ->getExtensionConfig ($ this ->getAlias ());
36
36
$ parameterBag = $ container ->getParameterBag ();
37
37
$ configs = $ parameterBag ->resolveValue ($ configs );
@@ -182,10 +182,9 @@ public function prepend(ContainerBuilder $container)
182
182
'persistence ' => array (
183
183
'phpcr ' => array (
184
184
'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 ' ],
189
188
);
190
189
break ;
191
190
}
@@ -195,6 +194,31 @@ public function prepend(ContainerBuilder $container)
195
194
}
196
195
}
197
196
}
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
+ }
198
222
}
199
223
200
224
/**
0 commit comments