diff --git a/core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php b/core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php index 218131c..d458d2b 100644 --- a/core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php +++ b/core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php @@ -100,6 +100,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta '#element_validate' => [[get_class($this), 'elementValidateFilter']], '#ajax' => TRUE, '#limit_validation_errors' => [], + '#weight' => -5, ]; $form['target_bundles_update'] = [ @@ -142,6 +143,11 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta } } + $form['sort'] = [ + '#type' => 'container', + '#weight' => -4, + ]; + $form['sort']['field'] = [ '#type' => 'select', '#title' => $this->t('Sort by'), diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php index 70f9dc9..ffa2161 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php @@ -345,7 +345,7 @@ public function fieldSettingsForm(array $form, FormStateInterface $form_state) { ]; $form['handler'] = [ '#type' => 'details', - '#title' => t('Reference type'), + '#title' => t('Reference options'), '#open' => TRUE, '#tree' => TRUE, '#process' => [[get_class($this), 'formProcessMergeParent']], @@ -359,6 +359,7 @@ public function fieldSettingsForm(array $form, FormStateInterface $form_state) { '#required' => TRUE, '#ajax' => TRUE, '#limit_validation_errors' => [], + '#weight' => 10, ]; $form['handler']['handler_submit'] = [ '#type' => 'submit', @@ -373,6 +374,7 @@ public function fieldSettingsForm(array $form, FormStateInterface $form_state) { $form['handler']['handler_settings'] = [ '#type' => 'container', '#attributes' => ['class' => ['entity_reference-settings']], + '#weight' => -10, ]; $handler = \Drupal::service('plugin.manager.entity_reference_selection')->getSelectionHandler($field); diff --git a/core/modules/field_ui/src/Form/FieldConfigEditForm.php b/core/modules/field_ui/src/Form/FieldConfigEditForm.php index cc1ecf3..eeb3376 100644 --- a/core/modules/field_ui/src/Form/FieldConfigEditForm.php +++ b/core/modules/field_ui/src/Form/FieldConfigEditForm.php @@ -56,6 +56,7 @@ public function form(array $form, FormStateInterface $form_state) { '#required' => TRUE, '#weight' => -20, ]; + // Create an arbitrary entity object (used by the 'default value' widget). $ids = (object) [ 'entity_type' => $this->entity->getTargetEntityTypeId(), @@ -86,8 +87,6 @@ public function form(array $form, FormStateInterface $form_state) { '#weight' => -5, ]; - - // Add field settings for the field type and a container for third party // settings that modules can add to via hook_form_FORM_ID_alter(). $form['settings'] = [