Problem/Motivation

While attempting to export a single configuration using ConfigSingleExportForm, when selecting any Configuration type, I get an Ajax error "Notice: Undefined index: #value in core/includes/form.inc on line 389" and the Configuration name field fails to refresh with usable values.

Steps to reproduce

Visit the `admin/config/development/configuration/single/export` page as an admin and select a Configuration type other than the default.

Note that I am not able to get consistent reproduction on different sites using very similar codebases. On some sites, the ajax behavior is broken by the Notice. On others, it works fine -- but there is still an attempt to access an undefined index in `forms.inc::template_preprocess_textarea()` which you can see in a debugger.

Proposed resolution

In the ajax callback "ConfigSingleExportForm::updateConfigurationType", change `unset($form['export']['#value']);` to set the value to an empty string rather than unsetting the index completely.

Remaining tasks

Review patch.

User interface changes

none

API changes

none

Data model changes

none

Release notes snippet

Use a safer method for resetting the "export" field on the Configuration Single Export utility.

Issue fork drupal-3252178

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

gcb created an issue. See original summary.

gcb’s picture

Status: Active » Needs review
larowlan’s picture

This is a duplicate, there's three other reports of this

larowlan’s picture