You are here

function lazy_update_8303 in Lazy-load 8.3

Update lazy module configuration for the new "preferNative" option.

File

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

Code

function lazy_update_8303() {
  $config = \Drupal::configFactory()
    ->getEditable('lazy.settings');
  $preferNative = (bool) ($config
    ->get('preferNative') !== NULL ? $config
    ->get('preferNative') : TRUE);
  $config
    ->set('preferNative', $preferNative)
    ->save(TRUE);
  return t('The new "preferNative" option is added, and set to %status.', [
    '%status' => $preferNative ? 'enabled' : 'disabled',
  ]);
}