Updated: Comment #0
Problem/Motivation
#2099363: Allow single config files to be imported and exported (Resolve regression from Views in Drupal 7) adds the ability to import single config entities.
Once committed, it will require you to have the ID specified in the YAML you are importing, which is a reasonable expectation.
However, in D7 Views, it let you choose to rename it anyway, and we could possibly do that here too.
The biggest problem would be conveying that they shouldn't include the config prefix, but that could be solved by adding a field_prefix to FAPI on AJAX.
Proposed resolution
Add a textfield allowing a custom ID that would override any set in the YAML
Remaining tasks
Decide if it should be made required
User interface changes
Yes
API changes
No
Related Issues
Comment | File | Size | Author |
---|---|---|---|
#11 | 2101691-11.patch | 2.95 KB | swentel |
#9 | config-import-2101691-9.patch | 2.96 KB | tim.plunkett |
Comments
Comment #1
tim.plunkettComment #2
tim.plunkettThis is what I came up with.
I chose to put it in a details element, because it is very much optional, and we might eventually add in more settings.
Manually tested, and added simpletest coverage as well.
Comment #3
tim.plunkettScreenshot:
Comment #4
larowlanCould/should we have an entity_load with the custom id after this - checking we can load the imported object?
Comment #5
tim.plunkettFair point!
Comment #6
larowlanUnless bot disagrees
Comment #7
tim.plunkettJust waiting for a committer. Not likely to conflict with anything soon, since it just touches the import form and test.
Comment #8
effulgentsia CreditAttribution: effulgentsia commentedWhat does UUID have to do with this?
Comment #9
tim.plunkettBad copy/paste from the previous block.
Changed to
// Attempt an import with a custom ID.
Comment #10
alexpottconfig-import-2101691-9.patch no longer applies.
Comment #11
swentel CreditAttribution: swentel commentedrerolled
Comment #12
alexpottCommitted 719dfe1 and pushed to 8.x. Thanks!