You are here

function lightbox2_update_2 in Lightbox2 8

Same name and namespace in other branches
  1. 5.2 lightbox2.install \lightbox2_update_2()
  2. 6 lightbox2.install \lightbox2_update_2()
  3. 7.2 lightbox2.install \lightbox2_update_2()
  4. 7 lightbox2.install \lightbox2_update_2()

'lightbox2_image_group' variable has been removed and others need to be updated accordingly.

Should have been created with lightbox2_update_600x() naming convention, but too late now.

File

./lightbox2.install, line 126
Installation functions for Lightbox2.

Code

function lightbox2_update_2() {
  $image_group = \Drupal::config('lightbox2.settings')
    ->get('lightbox2_image_group');
  $image_node = \Drupal::config('lightbox2.settings')
    ->get('lightbox2_image_node');
  $flickr = \Drupal::config('lightbox2.settings')
    ->get('lightbox2_flickr');
  $gallery2 = \Drupal::config('lightbox2.settings')
    ->get('lightbox2_gallery2_blocks');
  $inline = \Drupal::config('lightbox2.settings')
    ->get('lightbox2_inline');
  $image_assist = \Drupal::config('lightbox2.settings')
    ->get('lightbox2_image_assist_custom');
  if ($image_group) {
    if ($image_node) {
      \Drupal::configFactory()
        ->getEditable('lightbox2.settings')
        ->set('lightbox2_image_node', 2)
        ->save();
    }
    if ($flickr) {
      \Drupal::configFactory()
        ->getEditable('lightbox2.settings')
        ->set('lightbox2_flickr', 2)
        ->save();
    }
    if ($gallery2) {
      \Drupal::configFactory()
        ->getEditable('lightbox2.settings')
        ->set('lightbox2_gallery2_blocks', 2)
        ->save();
    }
    if ($inline) {
      \Drupal::configFactory()
        ->getEditable('lightbox2.settings')
        ->set('lightbox2_inline', 2)
        ->save();
    }
    if ($image_assist) {
      \Drupal::configFactory()
        ->getEditable('lightbox2.settings')
        ->set('lightbox2_image_assist_custom', 2)
        ->save();
    }
  }
  \Drupal::config('lightbox2.settings')
    ->clear('lightbox2_image_group')
    ->save();
  return array();
}