You are here

dropdown_language.install in Dropdown Language 8.2

Same filename and directory in other branches
  1. 3.0.x dropdown_language.install

Install, update, and uninstall functions for dropdown_language.

File

dropdown_language.install
View source
<?php

/**
 * @file
 * Install, update, and uninstall functions for dropdown_language.
 *
 * @ingroup dropdown_language
 */

/**
 * Update labels block schema.
 */
function dropdown_language_update_8201() {

  /** @var \Drupal\block\Entity\Block[] $blocks */
  $blocks = \Drupal::entityTypeManager()
    ->getStorage('block')
    ->loadByProperties([
    'plugin' => 'dropdown_language:language_interface',
  ]);
  foreach ($blocks as $block) {
    $settings = $block
      ->get('settings');
    if ($settings['labels'] === NULL) {
      $settings['labels'] = [];
      $block
        ->set('settings', $settings);
      $block
        ->save();
    }
  }
}

Functions

Namesort descending Description
dropdown_language_update_8201 Update labels block schema.