You are here

function collapsiblock_update_8201 in Collapsiblock 8.2

Same name and namespace in other branches
  1. 4.x collapsiblock.install \collapsiblock_update_8201()
  2. 3.x collapsiblock.install \collapsiblock_update_8201()

Upgrade to Collapsiblock 8.x-2.x.

File

./collapsiblock.install, line 11
Install, update and uninstall functions for the Collapsiblock module.

Code

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();
}