Problem/Motivation
On the single item config export form (/admin/config/development/configuration/single/export), one can change the configuration type in order to see configuration names that match the type, before then choosing a configuration name to be shown the item's export code. However, once a configuration name has been chosen, changing the configuration type leaves the export code in place, which can be confusing UX.
Proposed resolution
The proposed solution is to clear the export field value when the configuration type is changed. This will prevent confusion and allow the user to then choose a configuration name for the newly-select type.
Remaining tasks
A patch for this change is attached, and review/testing/comment would be appreciated. The change does not alter the UI or other behaviour on the form.
| Comment | File | Size | Author |
|---|
Issue fork drupal-3084436
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:
- 3084436-test-only
changes, plain diff MR !630
- 3084436-config-export-field
changes, plain diff MR !629
Comments
Comment #2
simonminter commentedComment #3
simonminter commentedComment #4
longwaveThis looks like a good idea and works as described - a nice simple usability improvement.
Comment #6
longwaveUnrelated fail: #3045612: Random test failure in MediaStandardProfileTest::testMediaSources
Back to RTBC
Comment #7
alexpottAs this is for javascript interaction only we need to add a
js-prefix.Comment #8
simonminter commentedAn updated patch is attached here, which adds a
js-prefix to the element ID as suggested.I haven't written a test due to limitations of time and knowledge. If anybody out there fancies writing one to test this new functionality that'd be great, and a very useful thing for me to learn from!
Comment #10
alisonAgree -- super annoying bug, and catches people in traps sometimes! I was just explaining to a colleague how to export things, and fortunately he noticed that the "filename" below the export field hadn't changed.
-------
This issue is a duplicate of #2710143: Single item: Configuration type change does not update Configuration name config content if one exists with the same name -- not sure which issue to keep, someone else can decide.
For now, I'm just posting the same "YAAASSSS" comment on each issue + mentioning the other 👋
Comment #11
simonminter commentedThanks @alisonjo315 – didn't realise this was a duplicate. The other ticket was raised before mine so I guess that one should be the 'real' one, although this one has my patch included…
I didn't write a test for my patch due to limitations mentioned above. So if anybody out there could do that, this might edge closer towards being a solution!
Comment #12
longwaveThanks for finding the duplicate. Usually we keep the older issue, but in this case there is a patch here and not there, so I've closed the other issue as duplicate of this one.
Comment #13
longwaveI'm also bumping this to 9.3.x as changes will be implemented there first, core committers will decide if the issue is necessary to backport to older versions.
Comment #16
longwaveOpened a merge request, added a test, and a separate test-only branch without the fix to prove that the fix solves the issue.
Comment #17
simonminter commented@longwave Thanks very much for keeping this moving forward!
Comment #18
spokje- Test fails for test-only MR
- TestBot is merrily green for the actual MR.
- Comments in #7 addressed.
- Code changes make sense
======================== +
- RTBC
Comment #19
spokjeComment #20
spokjeComment #23
catchAdding credit from the duplicate issue.
Comment #26
catchCommitted/pushed to 9.3.x and cherry-picked to 9.2.x, thanks!
Comment #27
alisonYay thank you everyone!!
Aaaany chance it could be made on 8.9......? 🤞🤞
Comment #28
simonminter commentedGlad it made it through, thanks everybody! Oh and +1 for 8.9!
Comment #29
alison(I'd be happy to help write a patch for 8.9 if maintainer folks say it could be committed, but I know not all issues/fixes get to be backported.)
Comment #30
pameeela commented8.9 is security fixes only now, so only issues that help people upgrade would be eligible for backport.