Skip to content

Commit 39b6bf6

Browse files
committed
Workaround for eZ Publish configuration processor not being able to merge arrays with numeric indexes
1 parent e29bdda commit 39b6bf6

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

DependencyInjection/NetgenOpenGraphExtension.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,23 @@ public function load( array $configs, ContainerBuilder $container )
3030
$loader->load( 'defaults.yml' );
3131
$loader->load( 'templating.yml' );
3232

33+
// The following block is a workaround for eZ Publish configuration processor
34+
// not being able to merge arrays with numeric indexes.
35+
// It works by inserting a dummy 'all_content_types' subkey, basically converting
36+
// the array from numeric based indexes to string based indexes.
37+
if ( !empty( $config['system'] ) )
38+
{
39+
foreach ( $config['system'] as $scope => &$handlers )
40+
{
41+
if ( !empty( $handlers['global_handlers'] ) )
42+
{
43+
$handlers['global_handlers'] = array(
44+
'all_content_types' => $handlers['global_handlers']
45+
);
46+
}
47+
}
48+
}
49+
3350
$processor = new ConfigurationProcessor( $container, 'netgen_open_graph' );
3451
$processor->mapConfig(
3552
$config,

MetaTag/Collector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function collect( Content $content )
6060
if ( isset( $contentTypeHandlers[$contentType->identifier] ) )
6161
{
6262
$allHandlers = array_merge(
63-
$allHandlers,
63+
$allHandlers['all_content_types'],
6464
$contentTypeHandlers[$contentType->identifier]
6565
);
6666
}

Resources/doc/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Netgen Open Graph Bundle changelog
22
==================================
33

4+
## 1.0.2 (22.04.2015)
5+
6+
* Fix an edge case bug where some handler configuration could be duplicated
7+
48
## 1.0.1 (22.04.2015)
59

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

0 commit comments

Comments
 (0)