- Issue created by @s_leu
- Merge request !57Issue #3165131 by munish.kumar, S_Bhandari, Aaronwa, Dave Reid: Update the... → (Open) created by s_leu
The key for a possible rebuild callback provided by an entity type definition in xmlsitemap_get_link_info()
is wrong and leads to errors when setting a process callback on an entity type as the set process callback will get called as the rebuild callback but they are different things.
Also the save method of the link storage interface is missing a parameter that's available on the implemented method.
Implement hook_entity_type_build()
and set a process callback on the entity type, then run a rebuild.
For example
function example_entity_type_build(array &$entity_types) {
if (array_key_exists('node', $entity_types)) {
/** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
$xmlsitemap_settings = $entity_types['node']->get('xmlsitemap') ?? [];
$xmlsitemap_settings['process callback'] = 'example_process_callback;
$entity_types['node']->set('xmlsitemap', $xmlsitemap_settings);
}
}
Fix the key.
Active
2.0
xmlsitemap.module