diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php index 4956b1c..2784ea8 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php @@ -42,13 +42,15 @@ class ConfigEntityStorage extends EntityStorageBase implements ConfigEntityStora /** * Length limit of the configuration entity ID. * - * Most file systems limit a file name's length to 255 characters. In - * order to leave sufficient characters to construct a configuration prefix, - * the configuration entity ID is limited to 166 characters which - * leaves 83 characters for the configuration prefix. 5 characters are - * reserved for the file extension. + * Most file systems limit a file name's length to 255 characters, so + * ConfigBase::MAX_NAME_LENGTH restricts the full configuration object name + * to 250 characters (leaving 5 for the file extension). The config prefix + * is limited by ConfigEntityType::PREFIX_LENGTH to 83 characters, so this + * leaves 166 remaining characters for the configuration entity ID and the + * joining dot. * * @see \Drupal\Core\Config\ConfigBase::MAX_NAME_LENGTH + * @see \Drupal\Core\Config\Entity\ConfigEntityType::PREFIX_LENGTH */ const MAX_ID_LENGTH = 166; diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php index f82af84..1dfb43c 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php @@ -19,13 +19,31 @@ class ConfigEntityType extends EntityType { /** * Length limit of the configuration entity prefix. * - * Most file systems limit a file name's length to 255 characters. In + * Configuration entity names are composed of two parts: + * 1. The config prefix, which is returned by getConfigPrefix and is + * composed of: + * a. The provider module name (limited to 50 characters by + DRUPAL_EXTENSION_NAME_MAX_LENGTH). + * b. The module-specific namespace identifier, which defaults to the + * configuration entity type ID. Entity type IDs are limited to 32 + * characters. + * 2. The configuration entity ID. + * So, a typical configuration entity filename will look something like: + * provider_module_name.namespace_identifier.config_entity_id.yaml + * + * Most file systems limit a file name's length to 255 characters, so + * ConfigBase::MAX_NAME_LENGTH restricts the full configuration object name + * to 250 characters (leaving 5 for the file extension). Therefore, in * order to leave sufficient characters to construct a configuration ID, - * the configuration entity prefix is limited to 83 characters which - * leaves 166 characters for the configuration ID. 5 characters are - * reserved for the file extension. + * the configuration entity prefix is limited to 83 characters: up to 50 + * characters for the module name, 1 for the dot, and 32 for the namespace + * identifier. This also allows modules with shorter names to define longer + * config prefixes if desired. * * @see \Drupal\Core\Config\ConfigBase::MAX_NAME_LENGTH + * @see \Drupal\Core\Config\Entity\ConfigEntityTypeInterface::getConfigPrefix() + * @see \DRUPAL_EXTENSION_NAME_MAX_LENGTH + * @see \Drupal\Core\Config\Entity\ConfigEntityStorage::MAX_ID_LENGTH */ const PREFIX_LENGTH = 83;