TransWikia.com

Best Practice: Remove UUID or default_config_hash from Custom Content Type definitions?

Drupal Answers Asked on October 26, 2021

When I’m exporting the custom content type definitions using the UI, many of the resulting YML files hold a uuid and default_config_hash, like:

uuid: b69d8e54-076c-4a15-a396-19f49369fa68
...
_core:
  default_config_hash: 3aSvUp4PtrivflrkaLdNRL1USkZLsS7NdQroSiRX9mA
...

Now, when I’m using this as a basis for my custom module, is it recommended to remove those lines?

One Answer

Yes, it is best practice to remove both.

Drupal Console provides these options:

drupal config:export:single 
  --name=config.settings.name 
  --remove-uuid 
  --remove-config-hash

Or export an entire set of YAML files of a content type directly to the modules install folder:

drupal config:export:content:type page 
  --module="demo" 
  --optional-config 
  --remove-uuid 
  --remove-config-hash

See https://drupalconsole.com/docs/en/commands/config-export-content-type

Answered by 4k4 on October 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP