bundle/DependencyInjection/ExtensionPlugin.php
private function fixUpViewConfig(array $config): array
    {
        foreach ($config['system'] as $scope => $scopeConfig) {
            if ($scope === 'default') {
                continue;
            }

            foreach (array_keys($scopeConfig['view']) as $viewName) {
                if (isset($config['system']['default']['view'][$viewName])) {
                    foreach ($config['system']['default']['view'][$viewName] as $context => $defaultRules) {
                        if (!isset($config['system'][$scope]['view'][$viewName][$context])) {
                            $config['system'][$scope]['view'][$viewName][$context] = [];
                        }

                        $config['system'][$scope]['view'][$viewName][$context] += $defaultRules;
                    }
                }
            }
        }

        return $config;
    }
private function fixUpViewConfig(array $config): array
    {
        foreach ($config['system'] as $scope => $scopeConfig) {
            if ($scope === 'default') {
                continue;
            }

            foreach (array_keys($scopeConfig['view']) as $viewName) {
                if (isset($config['system']['default']['view'][$viewName])) {
                    foreach ($config['system']['default']['view'][$viewName] as $context => $defaultRules) {
                        if (!isset($config['system'][$scope]['view'][$viewName][$context])) {
                            $config['system'][$scope]['view'][$viewName][$context] = [];
                        }

                        $config['system'][$scope]['view'][$viewName][$context] += $defaultRules;
                    }
                }
            }
        }

        return $config;
    }
private function fixUpViewConfig ( array $ config ) : array { foreach ( $ config [ 'system' ] as $ scope => $ scopeConfig ) { if ( $ scope === 'default' ) { continue ; } foreach ( array_keys ( $ scopeConfig [ 'view' ] ) as $ viewName ) { if ( isset ( $ config [ 'system' ] [ 'default' ] [ 'view' ] [ $ viewName ] ) ) { foreach ( $ config [ 'system' ] [ 'default' ] [ 'view' ] [ $ viewName ] as $ context => $ defaultRules ) { if ( ! isset ( $ config [ 'system' ] [ $ scope ] [ 'view' ] [ $ viewName ] [ $ context ] ) ) { $ config [ 'system' ] [ $ scope ] [ 'view' ] [ $ viewName ] [ $ context ] = [ ] ; } $ config [ 'system' ] [ $ scope ] [ 'view' ] [ $ viewName ] [ $ context ] += $ defaultRules ; } } } } return $ config ; }
Ugly hack to support semantic view config. The problem is, eZ semantic config
supports only merging arrays up to second level, but in view config we have three.

view:
block_view:
context:
config1: ...
config2: ...

So instead of merging view.block_view.context, eZ merges view.block_view, thus loosing
a good deal of config.

This iterates over all default view configs for each view and context, and merges
them in any found siteaccess or siteaccess group config, to make sure they're not lost
after contextualizer does it's thing.
Ugly hack to support semantic view config . The problem is eZ semantic config supports only merging arrays up to second level but in view config we have three .