You are here

function lazy_update_8202 in Lazy-load 8.3

Same name and namespace in other branches
  1. 8.2 lazy.install \lazy_update_8202()

Reset "image_fields" configuration to module default.

File

./lazy.install, line 79
Install, update, and uninstall functions for the Lazy-load module.

Code

function lazy_update_8202() {
  $config = \Drupal::service('config.factory')
    ->getEditable('lazy.settings');
  if ($config
    ->get('image_fields') === TRUE) {
    $config
      ->set('image_fields', FALSE);
    return t('<b>Action needed:</b> As of 8.x-2.x, image fields are now controlled individually. You need to manually update each image field to enable lazy-loading.');
  }
  return NULL;
}