Problem/Motivation
The ConfigInstaller::createConfiguration() function is used to create configuration at module install time. It is marked as "Protected". However, the ability to create configuration programmatically is very useful.
The Config Update module provides a "Revert" service that does something similar, and is used by the Features module to import/revert configuration. However, the code in config_update is out of sync with core, and specifically doesn't create any "new" config, but only modifies existing config.
This presents a problem when new configuration is added to a Feature and then someone attempts to "revert" that feature...none of the new config gets created.
To fix this in config_update or in Features I could copy/paste the code from createConfiguration(), but it seems better to just make that code available to be used.
Proposed resolution
Make ConfigInstaller::createConfiguration() public.
Remaining tasks
Implement.
User interface changes
None.
Introduced terminology
None.
API changes
ConfigInstaller::createConfiguration() is available for use.
Data model changes
None.
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | createConfiguration_2852626-2.patch | 1.9 KB | mpotter |
Issue fork drupal-2852626
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:
- 2852626-can-we-make
changes, plain diff MR !14285
Comments
Comment #2
mpotter commentedHere is a straight-forward patch.
Comment #4
Grayside commentedComment #17
smustgrave commentedThank you for sharing your idea for improving Drupal.
We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or there is no community support. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #20
liam morlandThis looks to me like a useful feature. I have created a merge request with the patch in #2.
Comment #21
smustgrave commentedIf it’s going to stay summary needs to be updated and will need test coverage as well
Comment #22
liam morlandAll tests and checks are passing.
Should I be adding the return type as I did or adding to
$ignoreErrors?Comment #23
smustgrave commentedLeaving the tag for stats
Comment #25
samitk commentedTests have been added. Please review. Changing the Status to Needs review for Test review.
Comment #27
smustgrave commentedMR needs a rebase but also updated to point to main, I can make the change for that.
Comment #28
liam morlandRe-rolled.
Comment #29
smustgrave commentedThanks think one of the last things needed will be a CR since this is now technically an interface addition.
Comment #30
liam morlandI have created a change notice.
Comment #31
borisson_Fixed one word in the CR, this now looks good.
I'm personally not convinced about the need to do this, I've never needed anything like this, and I've spent some time in the config system lately.
However if we do want to do this. This issue looks to be resolving it well.
Comment #32
borisson_I am going to mark this rtbc, because I think the problem in the issue is resolved by the merge request.
I am still not 100% sure if we really need this, but putting this to rtbc will surface it to the people that know how to make that decision.
Comment #33
godotislateTagging for config subsystem maintainer review.
Comment #34
needs-review-queue-bot 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 necessarily 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 #35
nod_this is probably a problem with the bot.
Comment #36
godotislateClarifying that tagging for subsystem maintainer review in #33 is for this in #32:
Comment #37
alexpottI think we've lived without this for a very long time and the work on this has been because this is in the core queue rather than because it is needed. I'm going to set a reminder to myself to close this issue in a week unless someone has an existing use-case and sets it back to rtbc. I think contrib already can extend the config installer and make the method public so this does not really block anything.
Comment #38
alexpottAs per #37 I'm going to close this issue. If someone has a compelling use-case on why it needs re-opening please do.