I’ve a customized type that should show a default worth from a customized person discipline. Drupal Developer discipline was created below /admin/config/individuals/accounts/fields and its machine identify is field_r_period_length_sec.
//get person $userCurrent = Drupal::currentUser(); $uid = $userCurrent->id(); $r_period = $userCurrent->field_r_period_length_sec;
Nonetheless, Drupal Development Service worth does not present and I get this error:
Discover: Undefined property: DrupalCoreSessionAccountProxy::$field_r_period_length_sec
What am I doing mistaken?