Loading core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php +6 −0 Original line number Diff line number Diff line Loading @@ -183,6 +183,9 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta '#size' => 6, '#multiple' => TRUE, '#element_validate' => [[static::class, 'elementValidateFilter']], // Use a form process callback to build #ajax property properly and also // to avoid code duplication. // @see \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::fieldSettingsAjaxProcess() '#ajax' => TRUE, '#limit_validation_errors' => [], ]; Loading Loading @@ -232,6 +235,9 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta '#type' => 'select', '#title' => $this->t('Sort by'), '#options' => $fields, // Use a form process callback to build #ajax property properly and also // to avoid code duplication. // @see \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::fieldSettingsAjaxProcess() '#ajax' => TRUE, '#empty_value' => '_none', '#sort_options' => TRUE, Loading core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php +5 −1 Original line number Diff line number Diff line Loading @@ -2,11 +2,11 @@ namespace Drupal\Core\Field\Plugin\Field\FieldType; use Drupal\Component\Plugin\Exception\PluginNotFoundException; use Drupal\Component\Render\FormattableMarkup; use Drupal\Component\Utility\Html; use Drupal\Core\Entity\ContentEntityStorageInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Component\Plugin\Exception\PluginNotFoundException; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\FieldableEntityInterface; use Drupal\Core\Entity\TypedData\EntityDataDefinition; Loading Loading @@ -477,6 +477,9 @@ public function fieldSettingsForm(array $form, FormStateInterface $form_state) { '#options' => $handlers_options, '#default_value' => $field->getSetting('handler'), '#required' => TRUE, // Use a form process callback to build #ajax property properly and also // to avoid code duplication. // @see \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::fieldSettingsAjaxProcess() '#ajax' => TRUE, '#limit_validation_errors' => [], ]; Loading Loading @@ -703,6 +706,7 @@ public static function fieldSettingsAjaxProcess($form, FormStateInterface $form_ * @see static::fieldSettingsAjaxProcess() */ public static function fieldSettingsAjaxProcessElement(&$element, $main_form) { // Elements are marked as TRUE ('#ajax' => TRUE,), so not empty. if (!empty($element['#ajax'])) { $element['#ajax'] = [ 'trigger_as' => ['name' => 'handler_settings_submit'], Loading core/modules/user/src/Plugin/EntityReferenceSelection/UserSelection.php +3 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,9 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta '_none' => $this->t('- None -'), 'role' => $this->t('User role'), ], // Use a form process callback to build #ajax property properly and also // to avoid code duplication. // @see \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::fieldSettingsAjaxProcess() '#ajax' => TRUE, '#limit_validation_errors' => [], '#default_value' => $configuration['filter']['type'], Loading Loading
core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php +6 −0 Original line number Diff line number Diff line Loading @@ -183,6 +183,9 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta '#size' => 6, '#multiple' => TRUE, '#element_validate' => [[static::class, 'elementValidateFilter']], // Use a form process callback to build #ajax property properly and also // to avoid code duplication. // @see \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::fieldSettingsAjaxProcess() '#ajax' => TRUE, '#limit_validation_errors' => [], ]; Loading Loading @@ -232,6 +235,9 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta '#type' => 'select', '#title' => $this->t('Sort by'), '#options' => $fields, // Use a form process callback to build #ajax property properly and also // to avoid code duplication. // @see \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::fieldSettingsAjaxProcess() '#ajax' => TRUE, '#empty_value' => '_none', '#sort_options' => TRUE, Loading
core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php +5 −1 Original line number Diff line number Diff line Loading @@ -2,11 +2,11 @@ namespace Drupal\Core\Field\Plugin\Field\FieldType; use Drupal\Component\Plugin\Exception\PluginNotFoundException; use Drupal\Component\Render\FormattableMarkup; use Drupal\Component\Utility\Html; use Drupal\Core\Entity\ContentEntityStorageInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Component\Plugin\Exception\PluginNotFoundException; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\FieldableEntityInterface; use Drupal\Core\Entity\TypedData\EntityDataDefinition; Loading Loading @@ -477,6 +477,9 @@ public function fieldSettingsForm(array $form, FormStateInterface $form_state) { '#options' => $handlers_options, '#default_value' => $field->getSetting('handler'), '#required' => TRUE, // Use a form process callback to build #ajax property properly and also // to avoid code duplication. // @see \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::fieldSettingsAjaxProcess() '#ajax' => TRUE, '#limit_validation_errors' => [], ]; Loading Loading @@ -703,6 +706,7 @@ public static function fieldSettingsAjaxProcess($form, FormStateInterface $form_ * @see static::fieldSettingsAjaxProcess() */ public static function fieldSettingsAjaxProcessElement(&$element, $main_form) { // Elements are marked as TRUE ('#ajax' => TRUE,), so not empty. if (!empty($element['#ajax'])) { $element['#ajax'] = [ 'trigger_as' => ['name' => 'handler_settings_submit'], Loading
core/modules/user/src/Plugin/EntityReferenceSelection/UserSelection.php +3 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,9 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta '_none' => $this->t('- None -'), 'role' => $this->t('User role'), ], // Use a form process callback to build #ajax property properly and also // to avoid code duplication. // @see \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::fieldSettingsAjaxProcess() '#ajax' => TRUE, '#limit_validation_errors' => [], '#default_value' => $configuration['filter']['type'], Loading