diff --git a/core/includes/language.inc b/core/includes/language.inc index 46f1535..c394236 100644 --- a/core/includes/language.inc +++ b/core/includes/language.inc @@ -211,26 +211,26 @@ function language_types_disable($types) { * at the same time. This is redundant. We need to change variable_set to * configuration in http://drupal.org/node/2010542. */ -function language_types_set(array $configurables) { +function language_types_set(array $configurable) { // Ensure that we are getting the defined language negotiation information. An // invocation of module_enable() or module_disable() could outdate the cached // information. drupal_static_reset('language_types_info'); drupal_static_reset('language_negotiation_info'); - $configurable = array(); + $config_values = array(); $language_types = array(); $negotiation_info = language_negotiation_info(); foreach (language_types_info() as $type => $info) { - $configurable[$type] = in_array($type, $configurables); + $config_values[$type] = in_array($type, $configurable); // Check if the language is locked. The configuration of a locked language // type cannot be changed using the UI. if ($locked = !empty($info['locked'])) { // Locked languages with a default configuration (using the 'fixed' // property) are always non-configurable and viceversa. - $configurable[$type] = empty($info['fixed']); + $config_values[$type] = empty($info['fixed']); $language_types[$type] = !$locked; - if (!$configurable[$type]) { + if (!$config_values[$type]) { $method_weights = array(); foreach ($info['fixed'] as $weight => $method_id) { if (isset($negotiation_info[$method_id])) { @@ -242,9 +242,9 @@ function language_types_set(array $configurables) { } else { // The configuration of an unlocked language will be based on the - // $configurable array (stored in configuration). These values may be + // $config_values array (stored in configuration). These values may be // altered using the UI. - $language_types[$type] = !empty($configurable[$type]); + $language_types[$type] = !empty($config_values[$type]); if (!$language_types[$type] && empty($info['fixed'])) { // If the language is not configurable and there is no default language // negotiation setting then provide one. @@ -257,7 +257,7 @@ function language_types_set(array $configurables) { // Save enabled language types. variable_set('language_types', $language_types); - config('system.language.types')->set('configurable', array_keys(array_filter($configurable)))->save(); + config('system.language.types')->set('configurable', array_keys(array_filter($config_values)))->save(); // Ensure that subsequent calls of language_types_get_configurable() return // the updated language type information. diff --git a/core/modules/language/language.admin.inc b/core/modules/language/language.admin.inc index d01b4d9..9fe37a7 100644 --- a/core/modules/language/language.admin.inc +++ b/core/modules/language/language.admin.inc @@ -559,18 +559,18 @@ function theme_language_negotiation_configure_form($variables) { function language_negotiation_configure_form_submit($form, &$form_state) { $configurable_types = $form['#language_types']; - $configurables = config('system.language.types')->get('configurable'); - $configurable = array(); + $configurable = config('system.language.types')->get('configurable'); + $config_values = array(); $method_weights_type = array(); foreach ($configurable_types as $type) { - $configurable[$type] = in_array($type, $configurables); + $config_values[$type] = in_array($type, $configurable); $method_weights = array(); $enabled_methods = $form_state['values'][$type]['enabled']; $enabled_methods[LANGUAGE_NEGOTIATION_SELECTED] = TRUE; $method_weights_input = $form_state['values'][$type]['weight']; if (isset($form_state['values'][$type]['configurable'])) { - $configurable[$type] = !empty($form_state['values'][$type]['configurable']); + $config_values[$type] = !empty($form_state['values'][$type]['configurable']); } foreach ($method_weights_input as $method_id => $weight) { @@ -585,7 +585,7 @@ function language_negotiation_configure_form_submit($form, &$form_state) { // Update non-configurable language types and the related language negotiation // configuration. - language_types_set(array_keys(array_filter($configurable))); + language_types_set(array_keys(array_filter($config_values))); // Update the language negotiations after setting the configurability. foreach ($method_weights_type as $type => $method_weights) { @@ -597,7 +597,7 @@ function language_negotiation_configure_form_submit($form, &$form_state) { if (module_exists('block')) { // If there is an active language switcher for a language type that has been // made not configurable, deactivate it first. - $non_configurable = array_keys(array_diff($configurable, array_filter($configurable))); + $non_configurable = array_keys(array_diff($config_values, array_filter($config_values))); _language_disable_language_switcher($non_configurable); Drupal::service('plugin.manager.block')->clearCachedDefinitions(); }