diff --git a/core/lib/Drupal/Core/Config/TypedConfigManager.php b/core/lib/Drupal/Core/Config/TypedConfigManager.php index 9228d7d..26c54fe 100644 --- a/core/lib/Drupal/Core/Config/TypedConfigManager.php +++ b/core/lib/Drupal/Core/Config/TypedConfigManager.php @@ -298,7 +298,7 @@ public function hasConfigSchema($name) { // The schema system falls back on the Property class for unknown types. // See http://drupal.org/node/1905230 $definition = $this->getDefinition($name); - return is_array($definition) && $definition['class'] != '\Drupal\Core\Config\Schema\Property'; + return is_array($definition) && ($definition['class'] != '\Drupal\Core\Config\Schema\Property'); } } diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php index df50e75..85069a9 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php @@ -44,6 +44,7 @@ public function setUp() { */ function testSchemaMapping() { // Nonexistent configuration key will have Unknown as metadata. + $this->assertIdentical(FALSE, config_typed()->hasSchema('config_test.no_such_key')); $definition = config_typed()->getDefinition('config_test.no_such_key'); $expected = array(); $expected['label'] = 'Unknown'; @@ -51,10 +52,12 @@ function testSchemaMapping() { $this->assertEqual($definition, $expected, 'Retrieved the right metadata for nonexistent configuration.'); // Configuration file without schema will return Unknown as well. + $this->assertIdentical(FALSE, config_typed()->hasSchema('config_test.noschema')); $definition = config_typed()->getDefinition('config_test.noschema'); $this->assertEqual($definition, $expected, 'Retrieved the right metadata for configuration with no schema.'); // Configuration file with only some schema. + $this->assertIdentical(TRUE, config_typed()->hasSchema('config_test.someschema')); $definition = config_typed()->getDefinition('config_test.someschema'); $expected = array(); $expected['label'] = 'Schema test data';