mirror of
https://gitlab.unicamp.br/infimecc_drupal11_modules/site_users.git
synced 2026-04-23 21:01:58 -03:00
feat: Remove field_user_category (gerenciado em outro módulo)
Remove os arquivos de config field.storage, field.field e translation referentes ao field_user_category, e elimina todas as referências ao campo em site_users.module, site_users.install e UserInfoBlock.php. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,19 +0,0 @@
|
|||||||
langcode: en
|
|
||||||
status: true
|
|
||||||
dependencies:
|
|
||||||
config:
|
|
||||||
- field.storage.user.field_user_category
|
|
||||||
module:
|
|
||||||
- user
|
|
||||||
id: user.user.field_user_category
|
|
||||||
field_name: field_user_category
|
|
||||||
entity_type: user
|
|
||||||
bundle: user
|
|
||||||
label: Category
|
|
||||||
description: 'User category.'
|
|
||||||
required: false
|
|
||||||
translatable: false
|
|
||||||
default_value: { }
|
|
||||||
default_value_callback: ''
|
|
||||||
settings: { }
|
|
||||||
field_type: string
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
langcode: pt-br
|
|
||||||
status: true
|
|
||||||
dependencies:
|
|
||||||
module:
|
|
||||||
- user
|
|
||||||
id: user.field_user_category
|
|
||||||
field_name: field_user_category
|
|
||||||
entity_type: user
|
|
||||||
type: string
|
|
||||||
settings:
|
|
||||||
max_length: 255
|
|
||||||
is_ascii: false
|
|
||||||
case_sensitive: false
|
|
||||||
module: core
|
|
||||||
locked: false
|
|
||||||
cardinality: 1
|
|
||||||
translatable: true
|
|
||||||
indexes: { }
|
|
||||||
persist_with_no_fields: false
|
|
||||||
custom_storage: false
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
label: Categoria
|
|
||||||
description: 'Categoria do usuário.'
|
|
||||||
@@ -42,19 +42,6 @@ function site_users_install() {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Campo Categoria.
|
|
||||||
if (!$form_display->getComponent('field_user_category')) {
|
|
||||||
$form_display->setComponent('field_user_category', [
|
|
||||||
'type' => 'string_textfield',
|
|
||||||
'weight' => 12,
|
|
||||||
'settings' => [
|
|
||||||
'size' => 60,
|
|
||||||
'placeholder' => '',
|
|
||||||
],
|
|
||||||
'region' => 'content',
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Campo Fotos - Media Library widget.
|
// Campo Fotos - Media Library widget.
|
||||||
if (!$form_display->getComponent('field_user_photos')) {
|
if (!$form_display->getComponent('field_user_photos')) {
|
||||||
$form_display->setComponent('field_user_photos', [
|
$form_display->setComponent('field_user_photos', [
|
||||||
@@ -115,19 +102,6 @@ function site_users_install() {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Campo Categoria.
|
|
||||||
if (!$view_display->getComponent('field_user_category')) {
|
|
||||||
$view_display->setComponent('field_user_category', [
|
|
||||||
'type' => 'string',
|
|
||||||
'weight' => 12,
|
|
||||||
'label' => 'above',
|
|
||||||
'settings' => [
|
|
||||||
'link_to_entity' => FALSE,
|
|
||||||
],
|
|
||||||
'region' => 'content',
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Campo Fotos.
|
// Campo Fotos.
|
||||||
if (!$view_display->getComponent('field_user_photos')) {
|
if (!$view_display->getComponent('field_user_photos')) {
|
||||||
$view_display->setComponent('field_user_photos', [
|
$view_display->setComponent('field_user_photos', [
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ function site_users_entity_field_access($operation, FieldDefinitionInterface $fi
|
|||||||
$profile_fields = [
|
$profile_fields = [
|
||||||
'field_user_name',
|
'field_user_name',
|
||||||
'field_user_phone',
|
'field_user_phone',
|
||||||
'field_user_category',
|
|
||||||
|
|
||||||
'field_user_bio',
|
'field_user_bio',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ class UserInfoBlock extends BlockBase implements ContainerFactoryPluginInterface
|
|||||||
'username' => $user->getDisplayName(),
|
'username' => $user->getDisplayName(),
|
||||||
'name' => $this->getFieldValue($user, 'field_user_name'),
|
'name' => $this->getFieldValue($user, 'field_user_name'),
|
||||||
'phone' => $this->getFieldValue($user, 'field_user_phone'),
|
'phone' => $this->getFieldValue($user, 'field_user_phone'),
|
||||||
'category' => $this->getFieldValue($user, 'field_user_category'),
|
|
||||||
|
|
||||||
'bio' => $this->getFieldValue($user, 'field_user_bio'),
|
'bio' => $this->getFieldValue($user, 'field_user_bio'),
|
||||||
'photo_url' => $default_photo_url,
|
'photo_url' => $default_photo_url,
|
||||||
|
|||||||
Reference in New Issue
Block a user