mirror of
https://gitlab.unicamp.br/infimecc_drupal11_modules/site_users.git
synced 2026-03-09 18:07:40 -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:
@@ -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
|
||||
@@ -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
|
||||
@@ -1,4 +1,3 @@
|
||||
uuid: 5c4edf33-dcb7-4a09-b34b-f11a682eacae
|
||||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
uuid: 5bc68841-a992-4744-8860-a2726d7de5b0
|
||||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user