Adiciona campo field_user_mathscinetid ao módulo

Inclui config/install com langcode en, update hook 10008 para sites
já instalados e tradução pt-br do label e descrição do campo.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 08:06:24 -03:00
parent 3597de7220
commit d3c1282e47
6 changed files with 93 additions and 2 deletions

View File

@@ -508,6 +508,46 @@ function site_users_update_10007() {
return t('field_user_id_lattes alterado para BIGINT para suportar IDs Lattes de 16 dígitos.');
}
/**
* Adds the field_user_mathscinetid field for researcher MathSciNet ID.
*/
function site_users_update_10008() {
// Create field storage if it does not exist.
if (!FieldStorageConfig::loadByName('user', 'field_user_mathscinetid')) {
FieldStorageConfig::create([
'field_name' => 'field_user_mathscinetid',
'entity_type' => 'user',
'type' => 'integer',
'settings' => [
'unsigned' => FALSE,
'size' => 'normal',
],
'cardinality' => 1,
'translatable' => TRUE,
])->save();
}
// Create field instance if it does not exist.
if (!FieldConfig::loadByName('user', 'user', 'field_user_mathscinetid')) {
FieldConfig::create([
'field_name' => 'field_user_mathscinetid',
'entity_type' => 'user',
'bundle' => 'user',
'label' => 'MathSciNet ID',
'description' => 'MathSciNet identifier of the researcher.',
'required' => FALSE,
'settings' => [
'min' => NULL,
'max' => NULL,
'prefix' => '',
'suffix' => '',
],
])->save();
}
return t('MathSciNet ID field created successfully.');
}
/**
* Corrige mapeamentos LDAP com campos de string nulos na config ativa.
*/