Skip to content
Snippets Groups Projects
Commit c5f524fa authored by Jennifer Hodgdon's avatar Jennifer Hodgdon
Browse files

Issue #1862390 by oriol_e9g, billk2, ACF, LinL: Coding standards - trailing...

Issue #1862390 by oriol_e9g, billk2, ACF, LinL: Coding standards - trailing comments in taxonomy.admin.inc
parent 7e209672
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -39,11 +39,11 @@ function taxonomy_overview_terms($form, &$form_state, Vocabulary $vocabulary) { ...@@ -39,11 +39,11 @@ function taxonomy_overview_terms($form, &$form_state, Vocabulary $vocabulary) {
$parent_fields = FALSE; $parent_fields = FALSE;
$page = isset($_GET['page']) ? $_GET['page'] : 0; $page = isset($_GET['page']) ? $_GET['page'] : 0;
$page_increment = config('taxonomy.settings')->get('terms_per_page_admin'); // Number of terms per page. $page_increment = config('taxonomy.settings')->get('terms_per_page_admin');
$page_entries = 0; // Elements shown on this page. $page_entries = 0;
$before_entries = 0; // Elements at the root level before this page. $before_entries = 0;
$after_entries = 0; // Elements at the root level after this page. $after_entries = 0;
$root_entries = 0; // Elements at the root level on this page. $root_entries = 0;
// Terms from previous and next pages are shown if the term tree would have // Terms from previous and next pages are shown if the term tree would have
// been cut in the middle. Keep track of how many extra terms we show on each // been cut in the middle. Keep track of how many extra terms we show on each
...@@ -83,7 +83,8 @@ function taxonomy_overview_terms($form, &$form_state, Vocabulary $vocabulary) { ...@@ -83,7 +83,8 @@ function taxonomy_overview_terms($form, &$form_state, Vocabulary $vocabulary) {
$back_step++; $back_step++;
if ($pterm->depth == 0) { if ($pterm->depth == 0) {
prev($tree); prev($tree);
continue 2; // Jump back to the start of the root level parent. // Jump back to the start of the root level parent.
continue 2;
} }
} }
} }
...@@ -125,8 +126,10 @@ function taxonomy_overview_terms($form, &$form_state, Vocabulary $vocabulary) { ...@@ -125,8 +126,10 @@ function taxonomy_overview_terms($form, &$form_state, Vocabulary $vocabulary) {
// If this form was already submitted once, it's probably hit a validation // If this form was already submitted once, it's probably hit a validation
// error. Ensure the form is rebuilt in the same order as the user submitted. // error. Ensure the form is rebuilt in the same order as the user submitted.
if (!empty($form_state['input'])) { if (!empty($form_state['input'])) {
$order = array_flip(array_keys($form_state['input']['terms'])); // Get the $_POST order. // Get the $_POST order.
$current_page = array_merge($order, $current_page); // Update our form with the new order. $order = array_flip(array_keys($form_state['input']['terms']));
// Update our form with the new order.
$current_page = array_merge($order, $current_page);
foreach ($current_page as $key => $term) { foreach ($current_page as $key => $term) {
// Verify this is a term for the current page and set at the current // Verify this is a term for the current page and set at the current
// depth. // depth.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment