@@ -50,6 +50,12 @@ public function process(ContainerBuilder $container)
5050
5151 $ pool = $ container ->getDefinition ('sonata.admin.pool ' );
5252
53+ $ defaultValues = [
54+ 'group ' => $ container ->getParameter ('sonata.admin.configuration.default_group ' ),
55+ 'label_catalogue ' => $ container ->getParameter ('sonata.admin.configuration.default_label_catalogue ' ),
56+ 'icon ' => $ container ->getParameter ('sonata.admin.configuration.default_icon ' ),
57+ ];
58+
5359 foreach ($ container ->findTaggedServiceIds ('sonata.admin ' ) as $ id => $ tags ) {
5460 foreach ($ tags as $ attributes ) {
5561 $ definition = $ container ->getDefinition ($ id );
@@ -88,11 +94,9 @@ public function process(ContainerBuilder $container)
8894
8995 $ resolvedGroupName = isset ($ attributes ['group ' ]) ?
9096 $ parameterBag ->resolveValue ($ attributes ['group ' ]) :
91- $ container ->getParameter ('sonata.admin.configuration.default_group ' );
92- $ labelCatalogue = $ attributes ['label_catalogue ' ] ??
93- $ container ->getParameter ('sonata.admin.configuration.default_label_catalogue ' );
94- $ icon = $ attributes ['icon ' ] ??
95- $ container ->getParameter ('sonata.admin.configuration.default_icon ' );
97+ $ defaultValues ['group ' ];
98+ $ labelCatalogue = $ attributes ['label_catalogue ' ] ?? $ defaultValues ['label_catalogue ' ];
99+ $ icon = $ attributes ['icon ' ] ?? $ defaultValues ['icon ' ];
96100 $ onTop = $ attributes ['on_top ' ] ?? false ;
97101 $ keepOpen = $ attributes ['keep_open ' ] ?? false ;
98102
@@ -135,6 +139,8 @@ public function process(ContainerBuilder $container)
135139 $ groupDefaults [$ resolvedGroupName ] = [
136140 'items ' => [],
137141 'label ' => $ resolvedGroupName ,
142+ 'label_catalogue ' => $ defaultValues ['label_catalogue ' ],
143+ 'icon ' => $ defaultValues ['icon ' ],
138144 'roles ' => [],
139145 'on_top ' => false ,
140146 'keep_open ' => false ,
@@ -150,7 +156,7 @@ public function process(ContainerBuilder $container)
150156 }
151157
152158 if (empty ($ group ['label_catalogue ' ])) {
153- $ groups [$ resolvedGroupName ]['label_catalogue ' ] = ' SonataAdminBundle ' ;
159+ $ groups [$ resolvedGroupName ]['label_catalogue ' ] = $ groupDefaults [ $ resolvedGroupName ][ ' label_catalogue ' ] ;
154160 }
155161
156162 if (empty ($ group ['icon ' ])) {
0 commit comments