Problem/Motivation

The issue proposes a solution for the problems listed in
#3585400: Simplify and stabilize ConfigSingleExportForm implementation
and
#3568570: Config single export JavaScript fails

Steps to reproduce

Go to single config export page and click on select items.
Content is not updated accordingly.

This problem does not occur on a new install, but on a real instance with a lot of views, some of which are complex (8000+ lines of yml). I guess that processing long lists and bigger yml increases the issue that on a clean install is not visible.

Proposed resolution

Refactor code to

  • remove dependency on Form Api, get config type and name directly from the requests
  • refer to DOM elements by id, no longer use :has selector
  • update the whole form (#config-export-form), instead of single elements, to avoid issues due to js libraries that alter the DOM (i.e. chosen)
  • remove programmatic calls like (new Htmx())->post() , use hx attributes when possible

Considering that the form is fairly simple (2 selects and one textarea), the loss of performances due to the update of the whole form instead of only a portion of it (i.e. select or textarea) is not significant.

User interface changes

No changes, the UI looks like the previous implementation

CommentFileSizeAuthor
#10 Screenshot 2026-04-18 185418.png14.68 KBveverka42

Issue fork drupal-3585442

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

veverka42 created an issue. See original summary.

veverka42’s picture

Issue summary: View changes
veverka42’s picture

Issue summary: View changes

veverka42’s picture

Issue summary: View changes
quietone’s picture

Version: 11.3.x-dev » main
Priority: Major » Normal
Issue summary: View changes
Issue tags: +Possible duplicate
Related issues: +#3585400: Simplify and stabilize ConfigSingleExportForm implementation, +#3568570: Config single export JavaScript fails

Issues are fixed on the main branch first.

If this is a fix for another issue, the MR should be made in that issue. In Drupal we work collaboratively, typically on the same MR. Other MRs are sometimes created, to show a different approach or when needed for a different branch. I think the work here and comments should be moved to #3568570: Config single export JavaScript fails.

fathershawn’s picture

Status: Active » Postponed (maintainer needs more info)

If this is not reproducible on a Drupal site without any additional modules, then I don't see how it can be an issue with the core implementation of this form.

fathershawn’s picture

Category: Bug report » Support request

update the whole form (#config-export-form), instead of single elements, to avoid issues due to js libraries that alter the DOM (i.e. chosen)

Is the implementation of chosen using drupal behaviors to attach it's JS?

fathershawn’s picture

Title: Wrong values in select and/or config yml not updated in ConfigSingleExportForm » Wrong values in ConfigSingleExportForm when paired with Chosen
veverka42’s picture

StatusFileSize
new14.68 KB

Finally I found out the root cause of the problem. In my case, it was not due to "chosen" module (which is not installed on my instance), but "webform_devel".

Specifically, there is the hook webform_devel_form_config_single_export_form_alter which was meant to apply codemirror formatting but breaks the htmx functionality on the Single Export Page.

To find this:
- first I looked to "network" tab in web browser inspector. On a clean Drupal 11.3.7 install, changing"config_type" or "config_name" from the single config export page showed calls initiated by htmx.js. On the instance in which I noticed the issue, changing "config_name" was showing also a call initiated by jquery.js.
network calls

- then I wrote "drupalSettings ajax" in the web browser console, which showed this

Object { "edit-config-name": {…} }
​
"edit-config-name": Object { callback: "_webform_devel_form_config_single_export_form_update_export", event: "change", url: "/it/admin/config/development/configuration/single/export?_wrapper_format=drupal_htmx&ajax_form=1", … }

The callback from _webform_devel_form_config_single_export_form_update_export is the clue...

Uninstalling Webform Devel module is only a temporary workaround to avoid the problem.

Note: with the change I proposed in the MR, the form was working correctly just as a side effect, because I was using the whole form as htmx target and select, therefore replacing the whole form instead of the single elements. Because of this, the issue did not occur. There is no need to apply the change I proposed, the actual code is correct. I will open an issue on Webform Devel module (which is part of this, not this), since the root cause is there.

veverka42’s picture

Title: Wrong values in ConfigSingleExportForm when paired with Chosen » Wrong values in ConfigSingleExportForm when paired with Webform Devel
veverka42’s picture

Title: Wrong values in ConfigSingleExportForm when paired with Webform Devel » Wrong values in ConfigSingleExportForm when paired with Webform Devel (part of Webform)
nicxvan’s picture

Project: Drupal core » Webform
Version: main » 6.3.x-dev
Component: configuration system » Code
Category: Support request » Task
Status: Postponed (maintainer needs more info) » Active

Moving to the correct project.