Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The configuration form 'Export -> Single item' has no default item for simple configuration. This leads to a confusing experience:
Proposed resolution
Add the empty value '- Select -' for simple configuration as well:
Remaining tasks
Address comments #14 and #27
User interface changes
Export single simple configuration name has an empty value by default '- Select -'
API changes
None
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#48 | 2622468-48.patch | 2.79 KB | kostyashupenko |
#47 | 2622468-nr-bot.txt | 2.02 KB | needs-review-queue-bot |
#45 | interdiff_40-45.txt | 4.79 KB | Leticia Gauna |
#45 | 2622468-45.patch | 2.82 KB | Leticia Gauna |
#40 | 2622468-40.patch | 2.78 KB | ranjith_kumar_k_u |
Comments
Comment #2
idebr CreditAttribution: idebr at iO commentedAttached patch implements the proposed resolution.
Comment #3
swentel CreditAttribution: swentel commentedmakes much sense, the only 'annoying' part is that if you would select '- Select - ' again, you get 'false', not sure if we should protect against that.
Comment #10
PanchoRerolled against 8.6.x.
Minor, but IMO clearly an omission and RTBC if tests passing.
Comment #11
idebr CreditAttribution: idebr commentedI did a manual test and found an issue when switching back to the '- Select' state: the textarea shows `false` and the description below shows `Filename: .yml`. I expected the textarea and its description to be empty, similar to the state when loading the page:
Comment #12
PanchoThanks for bringing this up. Actually, even without the patch, this happens when switching back to "- Select -".
Enclosed patch fixes that as well. Do we need a test?
Comment #13
idebr CreditAttribution: idebr commentedNot sure if we need a test, considering the change is fairly trivial. Let's leave it up to the maintainers.
Comment #14
tim.plunkettIt's a bug, I think it should have a test.
It's not clear if #3 was addressed.
The need for this change is not clear.
Also, there is a possibility that $names will not have been defined and this will trigger a warning.
Note that the first set of changes is confusing to read because of the change to use local variables. None of the code is actually changing there; it is being wrapped in a !empty() check.
Comment #15
tim.plunkettComment #21
smustgrave CreditAttribution: smustgrave at Mobomo commentedComment #24
andypostWondering why it still reproducible after related is fixed #3225381: PHP Notice logged when switching "Configuration type" in single configuration export screen
Comment #25
smustgrave CreditAttribution: smustgrave at Mobomo commentedThis is more of a UI issue then an error thrown. If you go to the export single item page the dropdown is selected the first item but the config is not loaded by default.
Comment #26
smustgrave CreditAttribution: smustgrave at Mobomo commentedComment #27
tim.plunkett80% of this patch is switching to local variables and indenting. These are the new actual lines.
(no feedback, just pointing it out to other reviewers)
Why is this moved to the bottom? The change from `''` to `'_none_'` could be done where it was before, no?
If this test was changed to assert that
optionExists('config_name', '');
, wouldn't that pass already? (also no need for double quotes here)The test coverage should help expose the bug.
Comment #28
smustgrave CreditAttribution: smustgrave at Mobomo commented@tim.plunkett originally was just a reroll. Picking up tickets that needed tests.
regarding #27.2 it looked like it was cleaner code to me. Changed to _none_ though because setting to nothing was difficult to pickup in the tests. Which answers #27.3
Comment #30
Bushra Shaikh CreditAttribution: Bushra Shaikh at QED42 for Drupal India Association commentedComment #31
Bushra Shaikh CreditAttribution: Bushra Shaikh at QED42 for Drupal India Association commentedVerified and tested patch#26 on drupal 9.5.x-dev. Patch applied successfully.
Testing Steps:
Testing result:
I observed that when switching back to the '- Select' state: the text area shows `false` and the description below shows `Filename: _none_.yml`.
Needs review.
Comment #32
smustgrave CreditAttribution: smustgrave at Mobomo commented2 reviews so going to say RTBC
Comment #33
quietone CreditAttribution: quietone at PreviousNext commentedIt would be nice to have this changed.
Code reviews were done in #14 and #27 which have not been addressed. Setting to Needs Work for those to be done.
The testing done in #29 onwards on this patch seems pre-mature when there are changes to the patch to be made. Remember to read the comments before working on an issue.
Comment #35
quietone CreditAttribution: quietone at PreviousNext commentedStill true, updated the remaining tasks.
Comment #36
Leticia Gauna CreditAttribution: Leticia Gauna at Zoocha commentedHello,
I made a new patch and in this case I am correcting both problems:
I added a gif where you can check that is working.
If there's anything I can improve just let me know!
Thanks
Comment #37
omkar_yewale CreditAttribution: omkar_yewale as a volunteer and at Srijan | A Material+ Company for Drupal Association commentedI have verified and tested patch #36 on Drupal 9.5 and it working fine.
Both of the issues were addressed.
@Leticia Gauna provide an interdiff file.
Comment #38
Leticia Gauna CreditAttribution: Leticia Gauna at Zoocha commentedSorry delay @omkar_yewale!
Here is the interdiff file, the patch is in the comment #36 https://www.drupal.org/project/drupal/issues/2622468#comment-15027683
Thanks
Comment #39
smustgrave CreditAttribution: smustgrave at Mobomo commentedWill need a simple assertion to show the bug is fixed please.
Comment #40
ranjith_kumar_k_u CreditAttribution: ranjith_kumar_k_u as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedAdded test, please review
Comment #41
ranjith_kumar_k_u CreditAttribution: ranjith_kumar_k_u as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedComment #42
smustgrave CreditAttribution: smustgrave at Mobomo commentedConfirmed applying patch #40 that going to the configuration export page the first option is -Select-
Comment #43
smustgrave CreditAttribution: smustgrave at Mobomo commentedComment #44
larowlanwe're calling $this->configStorage->read($name) 3 times here now
How about we do something like this instead
$exists = $this->configStorage->exists($name)
And then use that for our logic instead
Other than that, this looks great - thanks!
Comment #45
Leticia Gauna CreditAttribution: Leticia Gauna at Zoocha commentedHey - Here is the patch with test and larowlan suggestion!
Comment #46
Leticia Gauna CreditAttribution: Leticia Gauna at Zoocha commentedComment #47
needs-review-queue-bot CreditAttribution: needs-review-queue-bot as a volunteer commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #48
kostyashupenkoRemoved extra + symbols from previous patch.
Comment #49
smustgrave CreditAttribution: smustgrave at Mobomo commentedSeems point #44 has been addressed.
Comment #51
smustgrave CreditAttribution: smustgrave at Mobomo commentedSeems to be unrelated failure.
Comment #52
lauriiiCommitted 288f761 and pushed to 11.x. Thanks!