1.20.x user.install user_update_1006()

Moves user picture settings from variable to config.

Related topics

File

modules/user/user.install, line 354
Install, update and uninstall functions for the user module.

Code

function user_update_1006() {
  // Migrate variables if any.
  $config = config('system.core');
  $config->set('user_pictures', update_variable_get('user_pictures', 0));
  $config->set('user_picture_path', update_variable_get('user_picture_path', 'pictures'));
  $config->set('user_picture_default', update_variable_get('user_picture_default', ''));
  $config->set('user_picture_style', update_variable_get('user_picture_style', ''));
  $config->set('user_picture_dimensions', update_variable_get('user_picture_dimensions', '85x85'));
  $config->set('user_picture_file_size', update_variable_get('user_picture_file_size', 30));
  $config->set('user_picture_guidelines', update_variable_get('user_picture_guidelines', ''));
  $config->save();
  // Delete variables.
  update_variable_del('user_pictures');
  update_variable_del('user_picture_path');
  update_variable_del('user_picture_default');
  update_variable_del('user_picture_style');
  update_variable_del('user_picture_dimensions');
  update_variable_del('user_picture_file_size');
  update_variable_del('user_picture_guidelines');
}