Issue #3364773 by roshnichordiya, Chris Matthews, thakurnishant_06, quietone, xjm, yoroy: Make help text consistent on entity bundle forms (Content/Comment/Media/Block)

merge-requests/4680/merge
xjm 2023-09-29 19:11:18 -05:00
parent d0cfc6d004
commit c57ea2f9d5
No known key found for this signature in database
GPG Key ID: 206B0B8743BDF4C2
4 changed files with 13 additions and 10 deletions

View File

@ -35,7 +35,7 @@ class BlockContentTypeForm extends BundleEntityFormBase {
'#title' => $this->t('Label'),
'#maxlength' => 255,
'#default_value' => $block_type->label(),
'#description' => $this->t("Provide a label for this block type to help identify it in the administration pages."),
'#description' => $this->t("The human-readable name for this block type, displayed on the <em>Block types</em> page."),
'#required' => TRUE,
];
$form['id'] = [
@ -44,13 +44,14 @@ class BlockContentTypeForm extends BundleEntityFormBase {
'#machine_name' => [
'exists' => '\Drupal\block_content\Entity\BlockContentType::load',
],
'#description' => $this->t("Unique machine-readable name: lowercase letters, numbers, and underscores only."),
'#maxlength' => EntityTypeInterface::BUNDLE_MAX_LENGTH,
];
$form['description'] = [
'#type' => 'textarea',
'#default_value' => $block_type->getDescription(),
'#description' => $this->t('Enter a description for this block type.'),
'#description' => $this->t('Displays on the <em>Block types</em> page.'),
'#title' => $this->t('Description'),
];

View File

@ -3,8 +3,8 @@
namespace Drupal\comment;
use Drupal\Core\Entity\EntityForm;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Entity\FieldableEntityInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\language\Entity\ContentLanguageSettings;
@ -83,6 +83,7 @@ class CommentTypeForm extends EntityForm {
'#title' => $this->t('Label'),
'#maxlength' => 255,
'#default_value' => $comment_type->label(),
'#description' => $this->t('The human-readable name for this comment type, displayed on the <em>Comment types</em> page.'),
'#required' => TRUE,
];
$form['id'] = [
@ -91,6 +92,7 @@ class CommentTypeForm extends EntityForm {
'#machine_name' => [
'exists' => '\Drupal\comment\Entity\CommentType::load',
],
'#description' => $this->t('Unique machine-readable name: lowercase letters, numbers, and underscores only.'),
'#maxlength' => EntityTypeInterface::BUNDLE_MAX_LENGTH,
'#disabled' => !$comment_type->isNew(),
];
@ -98,7 +100,7 @@ class CommentTypeForm extends EntityForm {
$form['description'] = [
'#type' => 'textarea',
'#default_value' => $comment_type->getDescription(),
'#description' => $this->t('Describe this comment type. The text will be displayed on the <em>Comment types</em> administration overview page.'),
'#description' => $this->t('Displays on the <em>Comment types</em> page.'),
'#title' => $this->t('Description'),
];

View File

@ -97,7 +97,7 @@ class MediaTypeForm extends EntityForm {
'#title' => $this->t('Name'),
'#type' => 'textfield',
'#default_value' => $this->entity->label(),
'#description' => $this->t('The human-readable name of this media type.'),
'#description' => $this->t('The human-readable name for this media type, displayed on the <em>Media types</em> page.'),
'#required' => TRUE,
'#size' => 30,
];
@ -110,14 +110,14 @@ class MediaTypeForm extends EntityForm {
'#machine_name' => [
'exists' => [MediaType::class, 'load'],
],
'#description' => $this->t('A unique machine-readable name for this media type.'),
'#description' => $this->t('Unique machine-readable name: lowercase letters, numbers, and underscores only.'),
];
$form['description'] = [
'#title' => $this->t('Description'),
'#type' => 'textarea',
'#default_value' => $this->entity->getDescription(),
'#description' => $this->t('Describe this media type. The text will be displayed on the <em>Add new media</em> page.'),
'#description' => $this->t('Displays on the <em>Media types</em> page.'),
];
$plugins = $this->sourceManager->getDefinitions();

View File

@ -69,7 +69,7 @@ class NodeTypeForm extends BundleEntityFormBase {
'#title' => $this->t('Name'),
'#type' => 'textfield',
'#default_value' => $type->label(),
'#description' => $this->t('The human-readable name of this content type. This text will be displayed as part of the list on the <em>Add content</em> page. This name must be unique.'),
'#description' => $this->t('The human-readable name for this content type, displayed on the <em>Content types</em> page.'),
'#required' => TRUE,
'#size' => 30,
];
@ -83,7 +83,7 @@ class NodeTypeForm extends BundleEntityFormBase {
'exists' => ['Drupal\node\Entity\NodeType', 'load'],
'source' => ['name'],
],
'#description' => $this->t('A unique machine-readable name for this content type. It must only contain lowercase letters, numbers, and underscores. This name will be used for constructing the URL of the %node-add page.', [
'#description' => $this->t('Unique machine-readable name: lowercase letters, numbers, and underscores only.', [
'%node-add' => $this->t('Add content'),
]),
];
@ -92,7 +92,7 @@ class NodeTypeForm extends BundleEntityFormBase {
'#title' => $this->t('Description'),
'#type' => 'textarea',
'#default_value' => $type->getDescription(),
'#description' => $this->t('This text will be displayed on the <em>Add new content</em> page.'),
'#description' => $this->t('Displays on the <em>Content types</em> page.'),
];
$form['additional_settings'] = [