musin_core.module

PHOTO EMBED

Sun Dec 26 2021 17:17:51 GMT+0000 (Coordinated Universal Time)

Saved by @igor #drupal #php

/**
 * Implements hook_entity_presave.
 */
function musin_core_entity_presave(EntityInterface $entity) {
  if ($entity instanceof \Drupal\user\UserInterface) {
    $completeness = \Drupal\musin_core\Service\UserHelperService::getProfileCompleteness($entity);
    $entity->set('field_completeness', $completeness);
    $entity->save();
  }
}
content_copyCOPY

Ovo dodaj na kraju ovog modul fajla.