Skip to content
Snippets Groups Projects
Verified Commit b825f8e2 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2651418 by vasike, DieterHolvoet, smustgrave, Xano, rpayanm, quietone,...

Issue #2651418 by vasike, DieterHolvoet, smustgrave, Xano, rpayanm, quietone, alexpott, larowlan, catch, lauriii: Non-array values for #ajax

(cherry picked from commit fe3aa496)
parent e2acd9e0
No related branches found
No related tags found
6 merge requests!8376Drupal views: adding more granularity to the ‘use ajax’ functionality,!8300Issue #3443586 View area displays even when parent view has no results.,!7567Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7565Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7509Change label "Block description" to "Block type",!7344Issue #3292350 by O'Briat, KlemenDEV, hswong3i, smustgrave, quietone: Update...
Pipeline #131206 passed
Pipeline: drupal

#131258

    Pipeline: drupal

    #131252

      Pipeline: drupal

      #131248

        +7
        ......@@ -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' => [],
        ];
        ......@@ -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,
        ......
        ......@@ -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;
        ......@@ -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' => [],
        ];
        ......@@ -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'],
        ......
        ......@@ -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'],
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Finish editing this message first!
        Please register or to comment