Commit 77adc383 authored by andrei.dincu's avatar andrei.dincu

Issue #2249723 by andrei.dincu: Add...

Issue #2249723 by andrei.dincu: Add hook_form_language_admin_overview_form_alter() in xmlsitemap.module
parent a0da5ba6
......@@ -1289,6 +1289,7 @@ function xmlsitemap_calculate_changefreq($timestamps) {
* calls to variable_set().
*/
function xmlsitemap_form_submit_flag_regenerate($form, $form_state) {
drupal_set_message('bogdan are mere');
foreach ($form_state['values'] as $variable => $value) {
if (\Drupal::config('xmlsitemap.settings')->get($variable) == NULL) {
$stored_value = 'not_a_variable';
......@@ -2055,12 +2056,28 @@ function xmlsitemap_form_xmlsitemap_sitemap_edit_form_alter(&$form, $form_state)
);
}
/**
* Implements hook_form_FORM_ID_alter().
*
* Set the regeneration needed flag if settings are changed.
*/
function xmlsitemap_form_language_admin_overview_form_alter(&$form, $form_state) {
if (!\Drupal::moduleHandler()->moduleExists('language') || !\Drupal::moduleHandler()->moduleExists('config_translation')) {
return;
}
drupal_set_message(count($form['#submit']));
array_unshift($form['#submit'], 'xmlsitemap_form_submit_flag_regenerate');
}
/**
* Implements hook_query_TAG_alter().
*
* @see i18n_db_rewrite_where()
*/
function xmlsitemap_query_xmlsitemap_generate_alter(QueryAlterableInterface $query) {
if (!\Drupal::moduleHandler()->moduleExists('language') || !\Drupal::moduleHandler()->moduleExists('config_translation')) {
return;
}
//$mode = variable_get('i18n_selection_mode', 'simple');
$mode = \Drupal::config('xmlsitemap.settings')->get('i18n_selection_mode');
if (!$mode) {
......
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