🇪🇬Egypt @Ahmed Eldesoky

Account created on 25 April 2018, almost 7 years ago
#

Recent comments

🇪🇬Egypt Ahmed Eldesoky

I can confirm this issue when placing the ajax callback within the same class that provides the options form

however a simple fix would be placing the ajax callback on your .module file
something like this

/**
   * {@inheritdoc}
   */
  public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    parent::buildOptionsForm($original_form, $form_state);
    $form['test']=[
      "#type" => "select",
      '#default_value' => "test",
      "#title" => t("Component"),
      "#options" => ['test'=>'test','test2'],
      '#ajax' => [
        'callback' => '_your_module_ajax_callback',
        'wrapper' => 'test',
        'effect' => 'fade',
        '#suffix' => '<div id="test"></div>'
      ],
      '#executes_submit_callback' => FALSE,
      '#required' => TRUE,
    ];
  }

and in your .module file

function _your_module_ajax_callback($form,FormStateInterface $form_state ) {
    return ['#markup'=>'hello'];
  }
🇪🇬Egypt Ahmed Eldesoky

what remains
add override configuration on module install
alter the settings form to add some descriptions

🇪🇬Egypt Ahmed Eldesoky

Done , visualizations was done in a table , not symfony var dumper

🇪🇬Egypt Ahmed Eldesoky

ahmed eldesoky changed the visibility of the branch 3495619-settings-form to active.

🇪🇬Egypt Ahmed Eldesoky

ahmed eldesoky changed the visibility of the branch 3495619-settings-form to hidden.

🇪🇬Egypt Ahmed Eldesoky

The previous patch had some missing files, fixed in this version

🇪🇬Egypt Ahmed Eldesoky

#15 causes JS issues with Drupal 10 , because jquery.once is removed
this is Drupal 10 JS compatible version of #15

Production build 0.71.5 2024