Quantcast
Viewing all articles
Browse latest Browse all 294794

[META-1] Create sensible limits for the maximum length of configuration object filename components

Updated: Comment #1

Problem/Motivation

#1701014: Validate config object names limits the maximum file name length of a configuration object name to 250 characters.

Now we need to prevent situations where the individual parts of the configuration object filename (plus the periods that separate them) do exceed 250 characters.

The name of a file that contains the details for a configuration entity is composed of 3 parts.

$extension.$identifier.$machine_name

The $machine_name may itself be comprised of components; this complexity is determined by the config entity class that produces the machine name.

Here is the fully-expanded set of possibilities.

                        |------> Machine name - defined by config entity type
{extension}.{identifier}.{target entity type}.{target entity bundle}.{instance name}

In Core, we find these combinations:

{extension}.{identifier}.{target entity type}.{instance name}
{extension}.{identifier}.{target entity type}.{target entity bundle}.{instance name}
{extension}.{identifier}.{target entity type}.{target entity bundle}
{extension}.{identifier}.{instance name}

In order to maintain file names that are less than 255 characters, we need to limit the length of the components of the file name, so given the template

$extension.$identifier.$machine_name

we need to establish the following char length limits on each part:

50.32.128

Listed below is a complete set of examples for each config entity entity in core.

EntityViewMode, EntityFormMode and FieldConfig File Name Components

Config Entity Typeapi providerentity type IDtarget entity type--instance name
view_modeentity.view_mode.node--.search_result
form_modeentity.form_mode.user--.register
field_configfield.field.node--.body

EntityViewDisplay, EntityFormDisplay and FieldInstanceConfig File Name Components

Config Entity Typeapi providerentity type IDtarget entity typetarget entity bundleinstance name
entity_view_displayentity.view_display.node.article.teaser
entity_form_displayentity.form_display.node.article.default
field_instance_configfield.instance.node.article.body

RdfMapping File Name Components

Config Entity Typeapi providerconfig_prefixtarget entity typetarget entity bundle--
rdf_mapping rdf.mapping.comment.node__comment--

All other Configuration entities File Name Components

Config Entity Type api providerconfig_prefix----machine_name
node_typenode.type----.article
custom_block_typecustom_block.type----.basic
search_pagesearch.page----.node_search
user_roleuser.role----.anonymous
blockblock.block----.bartik_content
filter_formatfilter.format----.full_html
image_styleimage.style----.large
contact_categorycontact.category----.feedback
editoreditor.editor----.basic_html
breakpointbreakpoint.breakpoint----.theme.bartik.mobile
breakpoint_groupbreakpoint.breakpoint_group----.theme.bartik.bartik
language_entitylanguage.entity----.en
responsive_image_mappingresponsive_image.mappings----.someName
shortcut_setshortcut.set----.default
actionsystem.action----.node_unpublish_action
date_formatsystem.date_format----.html_date
menusystem.menu----.main
taxonomy_vocabularytaxonomy.vocabulary----.tags
tourtour.tour----.views_ui
viewviews.view----.frontpage

The combination of these parts cannot exceed 250 characters. If they did, a site could break during upgrade, when a module is enabled, when configuration is imported, and various other scenarios.

Note: original discussion related to this problem occurred in #1186034: Length of configuration object name can be too small

The longest configuration name (found so far) in core is:

entity.view_display.node.12345678901234567890123456789012.1234567890123456789012345678901234567890123456789012345678901234

It's 122 characters long. This consists of provider ("node"), entity type ID ("view_display"), target entity type ("node"), target entity type bundle ("12345678901234567890123456789012") and display mode machine name ("1234567890123456789012345678901234567890123456789012345678901234").

In addition, language-specific configuration prefixes information to the existing configuration object file name, potentially making it too long. That issue is tracked here #2201437: [META-1] Config overrides and language.

Remaining tasks

Each part of a configuration object file name will get its own issue. Some parts are already length-limited.

PartIssue
api provider#1852454: Restrict module and theme name lengths to 50 characters
entity type ID/config_prefix#1862600: Entity type names/IDs are not properly namespaced by owner (e.g., taxonomy.term vs. taxonomy_term)
entity type/entity bundle#1709960: declare a maximum length for entity and bundle machine names
config entity machine name#2220757: Limit length of Config::$id to something <= 166 characters
composed config file name#1701014: Validate config object names

Additionally, we must determine how to migrate Drupal 7 data that exceeds these limits.

User interface changes

Certain admin UIs should indicated a maximum character limit. (Needs issues.)

API changes

Potentially


Viewing all articles
Browse latest Browse all 294794

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>