Quantcast
Channel: Issues for XML sitemap
Viewing all articles
Browse latest Browse all 1238

Context hash

$
0
0

Hello,

When i used hook_form_xmlsitemap_sitemap_edit_form_alter (hook_form_FORM_ID_alter) the hash of context is different for the same array.

Ex: $context1 = ['domain'=>1, 'language' => 'en', 'node' => '_none', 'taxonomy_term' => 'none'];
$context2 = ['domain'=>1, 'node' => '_none', 'taxonomy_term' => 'none', 'language' => 'en'];

$hash1 = xmlsitemap_sitemap_get_context_hash($context1);
$hash2 = xmlsitemap_sitemap_get_context_hash($context1);

$hash1 is not equal of $hash2.

I purpose to change actual function to:

function xmlsitemap_sitemap_get_context_hash(array &$context) {
uksort($context, 'strcmp'); // Patch to sort index key of context.
asort($context);
return drupal_hash_base64(serialize($context));
}


Viewing all articles
Browse latest Browse all 1238

Trending Articles