Skip to content
Snippets Groups Projects
Commit 080fc6ee authored by Ere Maijala's avatar Ere Maijala Committed by Demian Katz
Browse files

Omit Parent_Config section from returned configuration

- avoids problems with e.g. combined search, permissions handling.
parent f6fb865c
No related merge requests found
......@@ -113,6 +113,13 @@ class PluginFactory implements AbstractFactoryInterface
)
: [];
foreach ($child as $section => $contents) {
// Omit Parent_Config from the returned configuration; it is only
// needed during loading, and its presence will cause problems in
// config files that iterate through all of the sections (e.g.
// combined.ini, permissions.ini).
if ($section === 'Parent_Config') {
continue;
}
if (in_array($section, $overrideSections)
|| !isset($config->$section)
) {
......
......@@ -177,6 +177,21 @@ class PluginFactoryTest extends \VuFindTest\Unit\TestCase
$this->assertEquals('7', $config->Section3->g);
}
/**
* Test that the plugin factory omits the Parent_Config section from the
* merged configuration.
*
* @void
*/
public function testParentConfigOmission()
{
if (self::$writeFailed) {
$this->markTestSkipped('Could not write test configurations.');
}
$config = $this->getConfig('unit-test-child');
$this->assertFalse(isset($config->Parent_Config));
}
/**
* Test configuration is read-only.
*
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment