1717use Pimcore \Bundle \StudioBackendBundle \Exception \InvalidHostException ;
1818use Pimcore \Bundle \StudioBackendBundle \Perspective \Util \Constant \WidgetTypes ;
1919use Pimcore \Bundle \StudioBackendBundle \Setting \Admin \Repository \SettingRepository ;
20+ use Pimcore \Bundle \StudioBackendBundle \Util \Config \ConfigKeyMapper ;
2021use Pimcore \Bundle \StudioBackendBundle \Util \Constant \Asset \DownloadLimits ;
2122use Pimcore \Bundle \StudioBackendBundle \Util \Constant \Asset \MimeTypes ;
2223use Pimcore \Bundle \StudioBackendBundle \Util \Constant \Asset \ResizeModes ;
@@ -361,6 +362,11 @@ private function addNoteTypes(ArrayNodeDefinition $node): void
361362 ->addDefaultsIfNotSet ()
362363 ->children ()
363364 ->arrayNode ('types ' )
365+ ->beforeNormalization ()
366+ ->always (fn (mixed $ v ) => is_array ($ v )
367+ ? ConfigKeyMapper::convertKeysForApp ($ v )
368+ : $ v )
369+ ->end ()
364370 ->info ('List all note types for asset, document, and data-object. ' )
365371 ->normalizeKeys (false )
366372 ->children ()
@@ -451,6 +457,11 @@ private function addPerspectivesConfigurationNode(ArrayNodeDefinition $node): vo
451457 ->defaultValue ([])
452458 ->useAttributeAsKey ('id ' )
453459 ->arrayPrototype ()
460+ ->beforeNormalization ()
461+ ->always (fn (mixed $ v ) => is_array ($ v )
462+ ? ConfigKeyMapper::convertKeysForConfig ($ v )
463+ : $ v )
464+ ->end ()
454465 ->children ()
455466 ->scalarNode ('name ' )
456467 ->isRequired ()
@@ -475,7 +486,7 @@ private function addPerspectivesConfigurationNode(ArrayNodeDefinition $node): vo
475486 ->end ()
476487 ->end ()
477488 ->end ()
478- ->arrayNode ('widgetsLeft ' )
489+ ->arrayNode ('widgets_left ' )
479490 ->useAttributeAsKey ('id ' )
480491 ->scalarPrototype ()
481492 ->validate ()
@@ -484,7 +495,7 @@ private function addPerspectivesConfigurationNode(ArrayNodeDefinition $node): vo
484495 ->end ()
485496 ->end ()
486497 ->end ()
487- ->arrayNode ('widgetsRight ' )
498+ ->arrayNode ('widgets_right ' )
488499 ->useAttributeAsKey ('id ' )
489500 ->scalarPrototype ()
490501 ->validate ()
@@ -493,7 +504,7 @@ private function addPerspectivesConfigurationNode(ArrayNodeDefinition $node): vo
493504 ->end ()
494505 ->end ()
495506 ->end ()
496- ->arrayNode ('widgetsBottom ' )
507+ ->arrayNode ('widgets_bottom ' )
497508 ->useAttributeAsKey ('id ' )
498509 ->scalarPrototype ()
499510 ->validate ()
@@ -502,15 +513,15 @@ private function addPerspectivesConfigurationNode(ArrayNodeDefinition $node): vo
502513 ->end ()
503514 ->end ()
504515 ->end ()
505- ->scalarNode ('expandedLeft ' )
516+ ->scalarNode ('expanded_left ' )
506517 ->info ('The id of the widget that should be expanded on the left side. ' )
507518 ->defaultNull ()
508519 ->end ()
509- ->scalarNode ('expandedRight ' )
520+ ->scalarNode ('expanded_right ' )
510521 ->info ('The id of the widget that should be expanded on the right side. ' )
511522 ->defaultNull ()
512523 ->end ()
513- ->arrayNode ('contextPermissions ' )
524+ ->arrayNode ('context_permissions ' )
514525 ->useAttributeAsKey ('key ' )
515526 ->arrayPrototype ()
516527 ->useAttributeAsKey ('key ' )
@@ -536,18 +547,23 @@ private function addElementTreeWidgetConfigurationNode(ArrayNodeDefinition $node
536547 ->defaultValue ([])
537548 ->useAttributeAsKey ('id ' )
538549 ->arrayPrototype ()
550+ ->beforeNormalization ()
551+ ->always (fn (mixed $ v ) => is_array ($ v )
552+ ? ConfigKeyMapper::convertKeysForConfig ($ v )
553+ : $ v )
554+ ->end ()
539555 ->children ()
540556 ->scalarNode ('name ' )
541557 ->isRequired ()
542558 ->end ()
543- ->scalarNode ('elementType ' )
559+ ->scalarNode ('element_type ' )
544560 ->defaultValue (ElementTypes::TYPE_OBJECT )
545561 ->end ()
546- ->scalarNode ('pageSize ' )
562+ ->scalarNode ('page_size ' )
547563 ->defaultNull ()
548564 ->validate ()
549565 ->ifTrue (fn ($ v ) => !is_null ($ v ) && !is_int ($ v ))
550- ->thenInvalid ('The "pageSize " must be an integer or null. ' )
566+ ->thenInvalid ('The "page_size " must be an integer or null. ' )
551567 ->end ()
552568 ->end ()
553569 ->arrayNode ('icon ' )
@@ -570,11 +586,11 @@ private function addElementTreeWidgetConfigurationNode(ArrayNodeDefinition $node
570586 ->end ()
571587 ->end ()
572588 ->end ()
573- ->scalarNode ('rootFolder ' )
589+ ->scalarNode ('root_folder ' )
574590 ->defaultValue ('/ ' )
575591 ->isRequired ()
576592 ->end ()
577- ->booleanNode ('showRoot ' )
593+ ->booleanNode ('show_root ' )
578594 ->defaultFalse ()
579595 ->end ()
580596 ->arrayNode ('classes ' )
@@ -589,7 +605,7 @@ private function addElementTreeWidgetConfigurationNode(ArrayNodeDefinition $node
589605 ->scalarNode ('pql ' )
590606 ->defaultNull ()
591607 ->end ()
592- ->arrayNode ('contextPermissions ' )
608+ ->arrayNode ('context_permissions ' )
593609 ->scalarPrototype ()
594610 ->validate ()
595611 ->ifNotInArray ([true , false ])
@@ -705,7 +721,7 @@ private function addGdprDataExtractorNode(ArrayNodeDefinition $node): void
705721 ->arrayNode ('gdpr_data_extractor ' )
706722 ->addDefaultsIfNotSet ()
707723 ->children ()
708- ->arrayNode ('dataObjects ' )
724+ ->arrayNode ('data_objects ' )
709725 ->addDefaultsIfNotSet ()
710726 ->info ('Settings for DataObjects DataProvider ' )
711727 ->children ()
@@ -714,8 +730,13 @@ private function addGdprDataExtractorNode(ArrayNodeDefinition $node): void
714730 ->useAttributeAsKey ('name ' )
715731 ->defaultValue ([])
716732 ->arrayPrototype ()
733+ ->beforeNormalization ()
734+ ->always (fn (mixed $ v ) => is_array ($ v )
735+ ? ConfigKeyMapper::convertKeysForConfig ($ v )
736+ : $ v )
737+ ->end ()
717738 ->children ()
718- ->booleanNode ('allowDelete ' )
739+ ->booleanNode ('allow_delete ' )
719740 ->info ('Allow delete of objects directly in preview grid. ' )
720741 ->defaultFalse ()
721742 ->end ()
0 commit comments