You are here

collapsiblock.install in Collapsiblock 3.x

Install, update and uninstall functions for the Collapsiblock module.

File

collapsiblock.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the Collapsiblock module.
 */

/**
 * Upgrade to Collapsiblock 8.x-2.x.
 */
function collapsiblock_update_8201(&$sandbox) {
  $settings = \Drupal::configFactory()
    ->getEditable('collapsiblock.settings');
  $action = $settings
    ->get('default_state');
  $action = empty($action) ? '1' : $action;
  $settings
    ->set('default_action', $action)
    ->clear('default_state')
    ->clear('title')
    ->clear('block')
    ->clear('content')
    ->save();
}

Functions

Namesort descending Description
collapsiblock_update_8201 Upgrade to Collapsiblock 8.x-2.x.