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
Other issues have established standards for configuration files and filenames.
Can find by searching for issues and change records.
But should be all in one place.
Proposed resolution
Document already decided things in a coding standard page.
https://www.drupal.org/node/2315769
Remaining tasks
See #6
find the related issues and change records and link to them here and/or when updating the doc page in the revision log.
Related issues and change records and other things to aggregate
- [#2120003
- #1479492: [policy] Define standards for naming and granularity of config files
- #2220749: Limit $extension.$(config_prefix/entity_id) combo value to 83 characters (82 plus a '.') as part of a 250 character limit on config entity file names
- #2220713: Limit config entity type IDs to 50 characters
- #2220757: Limit length of Config::$id to something <= 166 characters
- #1709960: declare a maximum length for entity and bundle machine names
- change record Entity type and bundle machine names have a maximum length of 32 characters
- change record Name length limits: extensions, ids and configuration file names
- Docs page Configuration Storage in Drupal 8
- Docs page Defining and using your own configuration in Drupal 8
User interface changes
No.
API changes
No.
Comments
Comment #1
YesCT CreditAttribution: YesCT commentedI think there are some more things about 2 space indents and how that is semantic for yml
and maybe some more issues, but this should be enough for a start.
https://www.drupal.org/node/2315769
aka
https://www.drupal.org/coding-standards/config
Comment #2
YesCT CreditAttribution: YesCT commentedlinking to the new standard page in the summary
Comment #3
YesCT CreditAttribution: YesCT commentedComment #4
YesCT CreditAttribution: YesCT commentedComment #5
YesCT CreditAttribution: YesCT commentedshould probably sort the related issues into a set that is obselete and the still valid ones.
Comment #6
jhodgdonI'm really not sure how much we need to document on that page.
I mean, people should really not be writing out config files in their editor, should they, at least for the final config they check into their git repo or put in a patch? That should be written out by Drupal.
There is already docs about the config file syntax in the Config API pages that I linked to in that page header.
The standards for name lengths and file names I put in there are also important.
But I think we can probably get rid of the rest, or maybe replace it with something like:
To write initial configuration for your module, entity, etc., here's a link to the docs page on the YAML structure, and you also need to make a schema file, so here's a link for that. But when you make your config file to go into the install directory of your module, you should export it using the Config Export screen.
Thoughts? [not suggesting this wording obviously!]
Comment #16
quietone CreditAttribution: quietone at PreviousNext commentedI triaged this issue and updated the IS.
I read the remaining items to aggregate and they are all complete. That suggests that there is nothing further to do here. However, #6 suggests that https://www.drupal.org/coding-standards/config can be greatly simplified.
Any thoughts?
Comment #17
bbralaI wouldn't really remove the documentation on that page in favor of linking to the config api. Having some basic information to read in regards to config seems like its usefull.
I do think though the links to Drupal 8 should be removed. Especially the version should be removed from the link to just serve the current config API using https://api.drupal.org/api/drupal/core%21core.api.php/group/config_api
Comment #19
quietone CreditAttribution: quietone at PreviousNext commentedOK. I have updated YAML Configuration files. The major thing is that I removed the 'Background and notes' section because it was duplicating information and providing code examples that were not examples of the standard. I hope a dev would look somewhere else for how to use the Configuration system to get a config or config entity.
I updated the references to Drupal 8 in the pages listed in the IS;
I don't see anything else to do here.
Comment #20
bbralaThanks quiettone for putting in the time to clean those pages up. They are way more consise like this.