Commit 3002bf4a authored by gbyte.co's avatar gbyte.co Committed by gbyte.co

Issue #3012860 by gbyte.co: Review state of hooks for 3.x

parent 1119396a
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
* Array containing multilingual links generated for each path to be indexed * Array containing multilingual links generated for each path to be indexed
* *
* @param string|null $sitemap_variant * @param string|null $sitemap_variant
*
* @todo Make work for sitemap types.
*/ */
function hook_simple_sitemap_links_alter(array &$links, $sitemap_variant) { function hook_simple_sitemap_links_alter(array &$links, $sitemap_variant) {
...@@ -139,28 +137,6 @@ function hook_simple_sitemap_sitemap_types_alter(array &$sitemap_types) { ...@@ -139,28 +137,6 @@ function hook_simple_sitemap_sitemap_types_alter(array &$sitemap_types) {
} }
/**
* @param array $variants
*/
function hook_simple_sitemap_variants_alter(array &$variants) {
// Add a new sitemap variant of the 'fight_club_sitemap_type' type.
$variants['fight_club'] = [
'type' => 'fight_club_sitemap_type',
'label' => t('Fight Club'),
];
}
/**
* @param array $bundle_settings
* @param array $bundle_context
* @param string|null $sitemap_variant
*/
function hook_simple_sitemap_bundle_settings_alter(array &$bundle_settings, $bundle_context, $sitemap_variant) {
}
/** /**
* @} End of "addtogroup hooks". * @} End of "addtogroup hooks".
*/ */
...@@ -115,7 +115,7 @@ class SimplesitemapSettingsForm extends SimplesitemapFormBase { ...@@ -115,7 +115,7 @@ class SimplesitemapSettingsForm extends SimplesitemapFormBase {
$row['status']['data']['#markup'] = $this->t('<a href="@url" target="_blank">published</a>', ['@url' => $url]); $row['status']['data']['#markup'] = $this->t('<a href="@url" target="_blank">published</a>', ['@url' => $url]);
break; break;
case 2: case 2:
$row['status'] = $this->t('<a href="@url" target="_blank">published</a> | regenerating', ['@url' => $url]); $row['status'] = $this->t('<a href="@url" target="_blank">published</a>, regenerating', ['@url' => $url]);
break; break;
} }
} }
......
...@@ -110,21 +110,6 @@ class EntityMenuLinkContentUrlGenerator extends UrlGeneratorBase { ...@@ -110,21 +110,6 @@ class EntityMenuLinkContentUrlGenerator extends UrlGeneratorBase {
->getBundleSettings(); ->getBundleSettings();
if (!empty($bundle_settings['menu_link_content'])) { if (!empty($bundle_settings['menu_link_content'])) {
foreach ($bundle_settings['menu_link_content'] as $bundle_name => $bundle_settings) { foreach ($bundle_settings['menu_link_content'] as $bundle_name => $bundle_settings) {
// Skip this bundle if it is to be generated in a different sitemap variant.
if (NULL !== $this->sitemapVariant && isset($bundle_settings['variant'])
&& $bundle_settings['variant'] !== $this->sitemapVariant) {
$bundle_settings['index'] = FALSE;
}
unset($bundle_settings['variant']);
$bundle_context = [
'entity_type_id' => 'menu_link_content',
'bundle_name' => $bundle_name,
];
$sitemap_variant = $this->sitemapVariant;
$this->moduleHandler->alter('simple_sitemap_bundle_settings', $bundle_settings, $bundle_context, $sitemap_variant);
if (!empty($bundle_settings['index'])) { if (!empty($bundle_settings['index'])) {
// Retrieve the expanded tree. // Retrieve the expanded tree.
......
...@@ -115,21 +115,6 @@ class EntityUrlGenerator extends UrlGeneratorBase { ...@@ -115,21 +115,6 @@ class EntityUrlGenerator extends UrlGeneratorBase {
$keys = $sitemap_entity_types[$entity_type_name]->getKeys(); $keys = $sitemap_entity_types[$entity_type_name]->getKeys();
foreach ($bundles as $bundle_name => $bundle_settings) { foreach ($bundles as $bundle_name => $bundle_settings) {
// Skip this bundle if it is to be generated in a different sitemap variant.
if (NULL !== $this->sitemapVariant && isset($bundle_settings['variant'])
&& $bundle_settings['variant'] !== $this->sitemapVariant) {
$bundle_settings['index'] = FALSE;
}
unset($bundle_settings['variant']);
$bundle_context = [
'entity_type_id' => $entity_type_name,
'bundle_name' => $bundle_name,
];
$sitemap_variant = $this->sitemapVariant;
$this->moduleHandler->alter('simple_sitemap_bundle_settings', $bundle_settings, $bundle_context, $sitemap_variant);
if (!empty($bundle_settings['index'])) { if (!empty($bundle_settings['index'])) {
$query = $entityTypeStorage->getQuery(); $query = $entityTypeStorage->getQuery();
......
...@@ -138,7 +138,6 @@ class QueueWorker { ...@@ -138,7 +138,6 @@ class QueueWorker {
public function rebuildQueue($variants = NULL) { public function rebuildQueue($variants = NULL) {
$all_data_sets = []; $all_data_sets = [];
$sitemap_variants = $this->manager->getSitemapVariants(); $sitemap_variants = $this->manager->getSitemapVariants();
$this->moduleHandler->alter('simple_sitemap_variants', $sitemap_variants);
$type_definitions = $this->manager->getSitemapTypes(); $type_definitions = $this->manager->getSitemapTypes();
$this->deleteQueue(); $this->deleteQueue();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment