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

@@ -0,0 +1,23 @@
langcode: en
status: true
dependencies:
config:
- field.storage.user.field_user_mathscinetid
module:
- user
id: user.user.field_user_mathscinetid
field_name: field_user_mathscinetid
entity_type: user
bundle: user
label: 'MathSciNet ID'
description: 'MathSciNet identifier of the researcher.'
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings:
min: null
max: null
prefix: ''
suffix: ''
field_type: integer

View File

@@ -0,0 +1,19 @@
langcode: en
status: true
dependencies:
module:
- user
id: user.field_user_mathscinetid
field_name: field_user_mathscinetid
entity_type: user
type: integer
settings:
unsigned: false
size: normal
module: core
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false

View File

@@ -1,4 +1,3 @@
uuid: 5c4edf33-dcb7-4a09-b34b-f11a682eacae
langcode: en
status: true
dependencies:

View File

@@ -1,4 +1,3 @@
uuid: 5bc68841-a992-4744-8860-a2726d7de5b0
langcode: en
status: true
dependencies:

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.
*/

View File

@@ -171,3 +171,14 @@ msgstr "Este usuário não tornou seu perfil público."
# Template
msgid "Phone:"
msgstr "Telefone:"
# Field labels - field_user_mathscinetid
msgid "MathSciNet ID"
msgstr "ID MathSciNet"
msgid "MathSciNet identifier of the researcher."
msgstr "Identificador MathSciNet do pesquisador."
# Install/update - field_user_mathscinetid
msgid "MathSciNet ID field created successfully."
msgstr "Campo ID MathSciNet criado com sucesso."