diff --git a/core/modules/taxonomy/src/TermForm.php b/core/modules/taxonomy/src/TermForm.php index af287ba881..d8603582e7 100644 --- a/core/modules/taxonomy/src/TermForm.php +++ b/core/modules/taxonomy/src/TermForm.php @@ -211,8 +211,13 @@ public function save(array $form, FormStateInterface $form_state) { $current_parent_count = count($form_state->getValue('parent')); // Root doesn't count if it's the only parent. - if ($current_parent_count == 1 && $form_state->hasValue(['parent', 0])) { - $form_state->setValue('parent', []); + if ($current_parent_count == 1) { + if ((is_array($form_state->getValue('parent'))) + && $form_state->hasValue(['parent', 0]) + || $form_state->getValue('parent') == 0) { + $current_parent_count = 0; + $form_state->setValue('parent', []); + } } $form_state->setValue('tid', $term->id()); diff --git a/core/modules/toolbar/js/views/ToolbarVisualView.js b/core/modules/toolbar/js/views/ToolbarVisualView.js index 87c8fc5b3f..3c1c2907b2 100644 --- a/core/modules/toolbar/js/views/ToolbarVisualView.js +++ b/core/modules/toolbar/js/views/ToolbarVisualView.js @@ -316,10 +316,23 @@ */ adjustPlacement() { const $trays = this.$el.find('.toolbar-tray'); + const orientation = this.model.get('orientation'); if (!this.model.get('isOriented')) { + $trays.find('.toolbar-lining').css('margin-bottom', 0); $trays .removeClass('toolbar-tray-horizontal') .addClass('toolbar-tray-vertical'); + } else { + const height = this.$el.find('.toolbar-bar').outerHeight(); + if (orientation === 'vertical') { + $trays + .find('.toolbar-lining') + .css('margin-bottom', height) + .css('min-height', 'calc(100% - '.concat(height, 'px)')); + } else { + $trays.find('.toolbar-lining').css('margin-bottom', 0); + Drupal.displace(); + } } },