You are here

public function Update360::enableUserPictures in Lightning Core 8.4

Same name and namespace in other branches
  1. 8.5 src/Update/Update360.php \Drupal\lightning_core\Update\Update360::enableUserPictures()
  2. 8.3 src/Update/Update360.php \Drupal\lightning_core\Update\Update360::enableUserPictures()

Enables avatars for user accounts.

@update

@ask Do you want to enable pictures for user accounts?

File

src/Update/Update360.php, line 48

Class

Update360
Contains optional configuration updates targeting Lightning Core 3.6.0.

Namespace

Drupal\lightning_core\Update

Code

public function enableUserPictures() {
  $this->moduleInstaller
    ->install([
    'image',
  ]);
  $config = Config::forModule('lightning_core')
    ->optional();
  $config
    ->getEntity('field_storage_config', 'user.user_picture')
    ->save();
  $config
    ->getEntity('field_config', 'user.user.user_picture')
    ->save();
  $config
    ->getEntity('entity_view_display', 'user.user.compact')
    ->save();
}