social_auth_extra.install in Open Social 8.7
Same filename and directory in other branches
- 8.9 modules/custom/social_auth_extra/social_auth_extra.install
- 8 modules/custom/social_auth_extra/social_auth_extra.install
- 8.2 modules/custom/social_auth_extra/social_auth_extra.install
- 8.3 modules/custom/social_auth_extra/social_auth_extra.install
- 8.4 modules/custom/social_auth_extra/social_auth_extra.install
- 8.5 modules/custom/social_auth_extra/social_auth_extra.install
- 8.6 modules/custom/social_auth_extra/social_auth_extra.install
- 8.8 modules/custom/social_auth_extra/social_auth_extra.install
Contains social_auth_extra.instal.
File
modules/custom/social_auth_extra/social_auth_extra.installView source
<?php
/**
 * @file
 * Contains social_auth_extra.instal.
 */
/**
 * Change 'edit account' to 'settings' in registration mail.
 */
function social_auth_extra_update_8001(&$sandbox) {
  // Get config.
  $config = \Drupal::service('config.factory')
    ->getEditable('social_auth_extra.mail');
  // Fetch the body field.
  $body = $config
    ->get('email_social_login.body');
  // Replace 'edit account' with 'settings'.
  $new_body = str_replace('edit account', 'settings', $body);
  // And save it.
  $config
    ->set('email_social_login.body', $new_body)
    ->save();
}
/**
 * Create the default configuration for the social_auth_extra help texts.
 */
function social_auth_extra_update_8002() {
  $config = [
    "langcode" => "en",
    "social_signup_help" => "If you connect using a social account, the email address and name associated with that account will be suggested for you but you can feel free to change them.",
    "social_login_help" => "",
  ];
  \Drupal::configFactory()
    ->getEditable('social_auth_extra.settings')
    ->setData($config)
    ->save();
}Functions
| Name   | Description | 
|---|---|
| social_auth_extra_update_8001 | Change 'edit account' to 'settings' in registration mail. | 
| social_auth_extra_update_8002 | Create the default configuration for the social_auth_extra help texts. | 
