Skip to content

Commit

Permalink
Workaround for eZ Publish configuration processor not being able to m…
Browse files Browse the repository at this point in the history
…erge arrays with numeric indexes
  • Loading branch information
emodric committed Apr 22, 2015
1 parent e29bdda commit 39b6bf6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
17 changes: 17 additions & 0 deletions DependencyInjection/NetgenOpenGraphExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,23 @@ public function load( array $configs, ContainerBuilder $container )
$loader->load( 'defaults.yml' );
$loader->load( 'templating.yml' );

// The following block is a workaround for eZ Publish configuration processor
// not being able to merge arrays with numeric indexes.
// It works by inserting a dummy 'all_content_types' subkey, basically converting
// the array from numeric based indexes to string based indexes.
if ( !empty( $config['system'] ) )
{
foreach ( $config['system'] as $scope => &$handlers )
{
if ( !empty( $handlers['global_handlers'] ) )
{
$handlers['global_handlers'] = array(
'all_content_types' => $handlers['global_handlers']
);
}
}
}

$processor = new ConfigurationProcessor( $container, 'netgen_open_graph' );
$processor->mapConfig(
$config,
Expand Down
2 changes: 1 addition & 1 deletion MetaTag/Collector.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function collect( Content $content )
if ( isset( $contentTypeHandlers[$contentType->identifier] ) )
{
$allHandlers = array_merge(
$allHandlers,
$allHandlers['all_content_types'],
$contentTypeHandlers[$contentType->identifier]
);
}
Expand Down
4 changes: 4 additions & 0 deletions Resources/doc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Netgen Open Graph Bundle changelog
==================================

## 1.0.2 (22.04.2015)

* Fix an edge case bug where some handler configuration could be duplicated

## 1.0.1 (22.04.2015)

* Remove need for specifying image alias in `ezimage` field type handler
Expand Down

0 comments on commit 39b6bf6

Please sign in to comment.