diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesTest.php index ab90257..db9ef14 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesTest.php @@ -45,10 +45,10 @@ function testGetRdfNamespaces() { \Drupal::moduleHandler()->install(array('rdf_conflicting_namespaces'), TRUE); try { $ns = rdf_get_namespaces(); - $this->fail(t('Expected exception not thrown for conflicting namespace declaration.')); + $this->fail('Expected exception not thrown for conflicting namespace declaration.'); } catch (\Exception $e) { - $this->pass(t('Expected exception thrown: @message', array('@message' => $e->getMessage()))); + $this->pass('Expected exception thrown: ' . $e->getMessage()); } } } diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module index 680731b..f0f33f5 100644 --- a/core/modules/rdf/rdf.module +++ b/core/modules/rdf/rdf.module @@ -112,14 +112,12 @@ function rdf_get_namespaces() { // namespace, do not use \Drupal::moduleHandler()->invokeAll(). foreach (\Drupal::moduleHandler()->getImplementations('rdf_namespaces') as $module) { $function = $module . '_rdf_namespaces'; - if (function_exists($function)) { - foreach($function() as $prefix => $namespace) { - if (array_key_exists($prefix, $namespaces) && $namespace !== $namespaces[$prefix]) { - throw new Exception(t('Tried to map @prefix to @namespace, but @prefix is already mapped to @orig_namespace.', array('@prefix' => $prefix, '@namespace' => $namespace, '@orig_namespace' => $namespaces[$prefix]))); - } - else { - $namespaces[$prefix] = $namespace; - } + foreach($function() as $prefix => $namespace) { + if (array_key_exists($prefix, $namespaces) && $namespace !== $namespaces[$prefix]) { + throw new Exception(t('Tried to map @prefix to @namespace, but @prefix is already mapped to @orig_namespace.', array('@prefix' => $prefix, '@namespace' => $namespace, '@orig_namespace' => $namespaces[$prefix]))); + } + else { + $namespaces[$prefix] = $namespace; } } } diff --git a/core/modules/rdf/tests/rdf_conflicting_namespaces/rdf_conflicting_namespaces.module b/core/modules/rdf/tests/rdf_conflicting_namespaces/rdf_conflicting_namespaces.module index 97d0e18..2fbdba4 100644 --- a/core/modules/rdf/tests/rdf_conflicting_namespaces/rdf_conflicting_namespaces.module +++ b/core/modules/rdf/tests/rdf_conflicting_namespaces/rdf_conflicting_namespaces.module @@ -10,6 +10,6 @@ */ function rdf_conflicting_namespaces_rdf_namespaces() { return array( - 'dc' => 'http://purl.org/conflicting/namespace', + 'dc' => 'http://purl.org/conflicting/namespace', ); }