mirror of
https://gitlab.unicamp.br/infimecc_drupal11_modules/site_users.git
synced 2026-03-10 10:17:41 -03:00
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:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user