Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ContentTranslationHooks.php

function ContentTranslationHooks::languageContentSettingsUpdate

Implements hook_ENTITY_TYPE_update().

Installs Content Translation's field storage definitions for the target entity type, if required.

Also clears the bundle information cache so that the bundle's translatability will be changed properly.

See also

content_translation_entity_bundle_info_alter()

\Drupal\content_translation\ContentTranslationManager::isEnabled()

File

core/modules/content_translation/src/Hook/ContentTranslationHooks.php, line 207

Class

ContentTranslationHooks
Hook implementations for content_translation.

Namespace

Drupal\content_translation\Hook

Code

public function languageContentSettingsUpdate(ContentLanguageSettingsInterface $settings) {
    $original_settings = $settings->original;
    if ($settings->getThirdPartySetting('content_translation', 'enabled', FALSE) && !$original_settings->getThirdPartySetting('content_translation', 'enabled', FALSE)) {
        _content_translation_install_field_storage_definitions($settings->getTargetEntityTypeId());
    }
    \Drupal::service('entity_type.bundle.info')->clearCachedBundles();
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal