diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php index 63fd448..9abcd47 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php @@ -67,7 +67,7 @@ public function form(array $form, array &$form_state, EntityInterface $term) { // items so we check for taxonomy_override_selector before loading the // full vocabulary. Contrib modules can then intercept before // hook_form_alter to provide scalable alternatives. - if (!config('taxonomy')->get('override_selector')) { + if (!config('taxonomy.settings')->get('override_selector')) { $parent = array_keys(taxonomy_term_load_parents($term->tid)); $children = taxonomy_get_tree($vocabulary->vid, $term->tid); diff --git a/core/modules/taxonomy/taxonomy.admin.inc b/core/modules/taxonomy/taxonomy.admin.inc index d4fd172..e769510 100644 --- a/core/modules/taxonomy/taxonomy.admin.inc +++ b/core/modules/taxonomy/taxonomy.admin.inc @@ -152,7 +152,7 @@ function taxonomy_overview_terms($form, &$form_state, Vocabulary $vocabulary) { $page = isset($_GET['page']) ? $_GET['page'] : 0; // Number of terms per page. - $page_increment = config('taxonomy')->get('terms_per_page_admin') ?: 100; + $page_increment = config('taxonomy.settings')->get('terms_per_page_admin'); $page_entries = 0; // Elements shown on this page. $before_entries = 0; // Elements at the root level before this page. $after_entries = 0; // Elements at the root level after this page. diff --git a/core/modules/taxonomy/taxonomy.install b/core/modules/taxonomy/taxonomy.install index ba81052..ee283ee 100644 --- a/core/modules/taxonomy/taxonomy.install +++ b/core/modules/taxonomy/taxonomy.install @@ -9,10 +9,6 @@ * Implements hook_uninstall(). */ function taxonomy_uninstall() { - // Remove variables. - $config = config('taxonomy'); - $config->delete('taxonomy_override_selector'); - $config->delete('taxonomy_terms_per_page_admin'); // Remove taxonomy_term bundles. $vocabularies = db_query("SELECT machine_name FROM {taxonomy_vocabulary}")->fetchCol(); foreach ($vocabularies as $vocabulary) { @@ -350,3 +346,15 @@ function taxonomy_update_8003(&$sandbox) { $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']); } + +/** + * Moves taxonomy settings from variable to config. + * + * @ingroup config_upgrade + */ +function taxonomy_update_8004(&$sandbox) { + update_variables_to_config('taxonomy.settings', array( + 'taxonomy_override_selector' => 'override_selector', + 'taxonomy_terms_per_page_admin' => 'terms_per_page_admin', + )); +}