Skip to content
Snippets Groups Projects
Commit 211ff3f2 authored by Angie Byron's avatar Angie Byron
Browse files

Revert "Issue #1089040 by Remon, mlncn: Added Cache rdf_get_namespaces() using...

Revert "Issue #1089040 by Remon, mlncn: Added Cache rdf_get_namespaces() using drupal_static(). Don't add caches unless there's a demonstrated performance degradation."

This reverts commit 8d153441.
parent 0549db82
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -95,18 +95,16 @@ function rdf_rdf_namespaces() {
* hook_rdf_namespaces().
*/
function rdf_get_namespaces() {
$rdf_namespaces = &drupal_static(__FUNCTION__);
if (!isset($rdf_namespaces)) {
$rdf_namespaces = module_invoke_all('rdf_namespaces');
// module_invoke_all() uses array_merge_recursive() which might return
// nested arrays if several modules redefine the same prefix multiple
// times. We need to ensure the array of namespaces is flat and only
// contains strings as URIs.
// module_invoke_all() uses array_merge_recursive() which might return nested
// arrays if several modules redefine the same prefix multiple times. We need
// to ensure the array of namespaces is flat and only contains strings as
// URIs.
foreach ($rdf_namespaces as $prefix => $uri) {
if (is_array($uri)) {
if (count(array_unique($uri)) == 1) {
// All namespaces declared for this prefix are the same, merge them
// all into a single namespace.
// All namespaces declared for this prefix are the same, merge them all
// into a single namespace.
$rdf_namespaces[$prefix] = $uri[0];
}
else {
......@@ -117,7 +115,6 @@ function rdf_get_namespaces() {
}
}
}
}
return $rdf_namespaces;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment