Problem/Motivation

I wanted to export a content type for inclusion in a contrib module's config/install folder.

I went to the admin/config/development/configuration/single/export path on my site to do the export.

I ended up not being able to export anything, because the selector dropdowns duplicated themselves and then didn't perform any AJAX type queries to give me the data to export.

Proposed resolution

Allow the user to do exports.

Remaining tasks

User interface changes

API changes

CommentFileSizeAuthor
#3 duplicate-views-ui.png101.42 KByoroy
single_export.png77.2 KBMile23
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Mile23’s picture

yoroy’s picture

I see UI elements getting repeated in other parts of admin as well, looks like this is a more general issue.

yoroy’s picture

FileSize
101.42 KB

I noticed it in https://www.drupal.org/node/1997692#comment-9389129, where drag/drop causes submit buttons to duplicate.

Also, in views, when creating a new view, filling out the path for a new page, when that field loses focus it duplicates parts of the interface:

Berdir’s picture

I would assume that this is related to #2384545: $element['#ajax']['callback'] is broken, hence breaking e.g. inserting images in CKEditor. Not sure if it is a duplicate, as it should still work without #ajax?

Wim Leers’s picture

Status: Active » Closed (duplicate)

Confirming that this is a duplicate of #2384545: $element['#ajax']['callback'] is broken, hence breaking e.g. inserting images in CKEditor.

From \Drupal\config\Form\ConfigSingleExportForm:

    $form['config_type'] = array(
      '#title' => $this->t('Configuration type'),
      '#type' => 'select',
      '#options' => $config_types,
      '#default_value' => $config_type,
      '#ajax' => array(
        'callback' => '::updateConfigurationType',
        'wrapper' => 'edit-config-type-wrapper',
      ),
    );
    $default_type = $form_state->getValue('config_type', $config_type);
    $form['config_name'] = array(
      '#title' => $this->t('Configuration name'),
      '#type' => 'select',
      '#options' => $this->findConfiguration($default_type),
      '#default_value' => $config_name,
      '#required' => TRUE,
      '#prefix' => '<div id="edit-config-type-wrapper">',
      '#suffix' => '</div>',
      '#ajax' => array(
        'callback' => '::updateExport',
        'wrapper' => 'edit-export-wrapper',
      ),
    );
Not sure if it is a duplicate, as it should still work without #ajax?

It's not designed to work that way:

  public function submitForm(array &$form, FormStateInterface $form_state) {
    // Nothing to submit.
  }
tim.plunkett’s picture

Is it a bug that it doesn't work with JS disabled completely? I forget what our policy is for that (it is administration, not end-user facing)