Skip to content

Deprecations and legacy APIs

APIs listed here are deprecated in 8.x-1.x and removed in name:2.0.0. New code should use the replacements below. For current APIs, see API Overview and Services Overview.

Procedural wrappers (name.module)

Deprecated in name:8.x-1.3. See https://www.drupal.org/project/name/issues/3555260.

Deprecated Use instead
name_get_additional_component() name.additional_componentgetAdditionalComponent()Additional Component. The entity type manager and renderer arguments are ignored.
name_get_custom_format_options() name.format_optionsgetCustomFormatOptions()Format Options
name_get_custom_list_format_options() name.format_optionsgetCustomListFormatOptions()Format Options
name_get_format_by_machine_name() name.format_optionsgetFormatPatternByMachineName()Format Options
name_widget_layouts() name.widget_layoutsgetLayouts()Widget Layouts hook
name_user_format_name_alter_preload() name.user_realname_preloadpreload()User integration

Internal helpers (name.module)

Deprecated in name:8.x-1.3. See https://www.drupal.org/project/name/issues/3555260.

Deprecated Use instead
_name_translations() name.component_metadatagetTranslations()
_name_component_keys() Drupal\name\Utility\NameComponents::coreKeys()
_name_formatter_output_types() name.component_metadatagetFormatterOutputTypes()
_name_formatter_output_options() name.component_metadatagetFormatterOutputOptions()
_name_component_layout() Drupal\name\Utility\NameComponents::applyLayout()
_name_value_sanitize() Drupal\name\Utility\NameComponents::sanitizeValue()

Name element callbacks (name.module)

Deprecated in name:8.x-1.3. Prefer Drupal\name\Element\Name static methods or the name.element_validator service. See Element Validator.

Deprecated Use instead
name_element_expand() Name::process()
name_element_render_component() Name::renderComponent()
name_component_description_after_build_label_alter() Name::componentDescriptionAfterBuildLabelAlter()
name_element_validate() Name::validateElement() or name.element_validator
name_element_pre_render() Name::preRender() — see https://www.drupal.org/project/name/issues/3128409
name_element_validate_is_empty() Name::validateIsEmpty()

Service interface methods

Deprecated in name:8.x-1.1. See https://www.drupal.org/project/name/issues/3518599.

Deprecated (NameFormatterInterface) Use instead
getLastDelimitorTypes() getLastDelimiterTypes()Formatter service
getLastDelimitorBehaviors() getLastDelimiterBehaviors()Formatter service

Legacy class aliases (name.module)

These FQCNs are registered via class_alias() for backwards-compatible autowiring and type hints. Canonical types live under Drupal\name\Service, Drupal\name\Utility, and related namespaces. No deprecation trigger fires when using the legacy names, but new code should type-hint the canonical class.

Legacy FQCN Canonical type
Drupal\name\NameFormatterInterface Drupal\name\Service\NameFormatterInterface
Drupal\name\NameGeneratorInterface Drupal\name\Service\GeneratorInterface
Drupal\name\NameAutocomplete Drupal\name\Service\AutocompleteService
Drupal\name\NameOptionsProvider Drupal\name\Service\NameOptionService
Drupal\name\NameFormatParser Drupal\name\Service\NameFormatParserService
Drupal\name\NameFormatter Drupal\name\Service\NameFormatterService
Drupal\name\NameGenerator Drupal\name\Service\GeneratorService
Drupal\name\Controller\NameAutocompleteController Drupal\name\Controller\AutocompleteController
Drupal\name\NameUnicodeExtras Drupal\name\Utility\UnicodeExtras
Drupal\name\NameFormatAccessController Drupal\name\Access\NameFormatAccessHandler
Drupal\name\NameFormatInterface Drupal\name\Entity\NameFormatInterface
Drupal\name\NameListFormatInterface Drupal\name\Entity\NameListFormatInterface
Drupal\name\NameSettingsForm Drupal\name\Form\SettingsForm
Drupal\name\NameFormatListBuilder Drupal\name\ListBuilder\NameFormatListBuilder
Drupal\name\NameListFormatListBuilder Drupal\name\ListBuilder\NameListFormatListBuilder

Legacy configuration values

Generational autocomplete source key

Field storage setting autocomplete_source enables per-component autocomplete sources. For the generational component, older default config may store the checkbox key as generation while the field settings UI uses generational. New saves use the UI keys; existing sites may retain generation in exported config until field settings are re-saved.

See Field storage settings and Autocomplete Service for current setting keys.