Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port Drupal Console config:export:single so I can export config individually, instead of via the UI. #5621

Closed
trackleft opened this issue Jun 5, 2023 · 4 comments

Comments

@trackleft
Copy link

Is your feature request related to a problem? Please describe.
As a distribution or test module maintainer, when I add new config to the install folder, I have to strip out site UUID and core version hash for each config file that I export in order to be installed on sites other than the one it was created in.
config:export currently only "Export Drupal configuration to a directory." which exports the entire site's configuration to a directory.

With Drupal Console I am able to use config:export:single

Describe the solution you'd like
I would love it if Drush had similar to Drupal Console for this task.
Drupal Console, config:export:single help
image

https://github.com/hechoendrupal/drupal-console/blob/7027117c82cd8b9d9f3fb89558a088e0575434d3/src/Command/Config/ExportSingleCommand.php#L96

Describe alternatives you've considered
Fork Drupal Console in order to keep this functionality when upgrading to Drupal 10.

@trackleft trackleft changed the title Port Drupal Console config:export:single so I can export config individually, instead of via the UI. Port Drupal Console config:export:single so I can export config individually, instead of via the UI. Jun 5, 2023
@weitzman
Copy link
Member

weitzman commented Jun 6, 2023

Done in #5146 and #5543

@weitzman weitzman closed this as completed Jun 6, 2023
@joeparsons
Copy link

@weitzman Is exporting a single config item covered in #5543? I only saw docs about config import there.

@weitzman weitzman reopened this Jun 6, 2023
@weitzman
Copy link
Member

weitzman commented Jun 7, 2023

I'm inclined to skip this in favor of drush cget system.site > tmp.yml. Feel free to submit a Usage example in config:get help.

@weitzman weitzman closed this as completed Jun 7, 2023
@trackleft
Copy link
Author

trackleft commented Jun 14, 2023

The key missing feature of cget is that you can not optionally remove the uuid or the _core: default_config_hash: which would allow including config exported by drush in test modules for automated testing, or distributions that install and manage configuration over the lifetime of the site.

These two missing options make this a manual process for anyone submitting a pull request that includes configuration, unless I'm missing something.

Even the default install profiles within drupal core do not have uuid or _core: default_config_hash: https://git.drupalcode.org/project/drupal/-/blob/11.x/core/profiles/standard/config/install/block_content.type.basic.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants