diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringWidget.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextfieldWidget.php similarity index 89% rename from core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringWidget.php rename to core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextfieldWidget.php index 853e661..0ed4239 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringWidget.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextfieldWidget.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\Core\Field\Plugin\Field\FieldWidget\StringWidget. + * Contains \Drupal\Core\Field\Plugin\Field\FieldWidget\StringTextfieldWidget. */ namespace Drupal\Core\Field\Plugin\Field\FieldWidget; @@ -12,17 +12,17 @@ use Drupal\Core\Form\FormStateInterface; /** - * Plugin implementation of the 'string' widget. + * Plugin implementation of the 'string_textfield' widget. * * @FieldWidget( - * id = "string", - * label = @Translation("String field"), + * id = "string_textfield", + * label = @Translation("Textfield"), * field_types = { * "string" * } * ) */ -class StringWidget extends WidgetBase { +class StringTextfieldWidget extends WidgetBase { /** * {@inheritdoc} diff --git a/core/modules/aggregator/src/Entity/Feed.php b/core/modules/aggregator/src/Entity/Feed.php index d70ec7d..a0c36ef 100644 --- a/core/modules/aggregator/src/Entity/Feed.php +++ b/core/modules/aggregator/src/Entity/Feed.php @@ -145,7 +145,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { ->setRequired(TRUE) ->setSetting('max_length', 255) ->setDisplayOptions('form', array( - 'type' => 'string', + 'type' => 'string_textfield', 'weight' => -5, )); diff --git a/core/modules/block_content/src/Entity/BlockContent.php b/core/modules/block_content/src/Entity/BlockContent.php index b004261..c870311 100644 --- a/core/modules/block_content/src/Entity/BlockContent.php +++ b/core/modules/block_content/src/Entity/BlockContent.php @@ -167,7 +167,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { ->setTranslatable(TRUE) ->setRequired(TRUE) ->setDisplayOptions('form', array( - 'type' => 'string', + 'type' => 'string_textfield', 'weight' => -5, )) ->setDisplayConfigurable('form', TRUE); diff --git a/core/modules/comment/src/Entity/Comment.php b/core/modules/comment/src/Entity/Comment.php index edde6c3..6fe7c0d 100644 --- a/core/modules/comment/src/Entity/Comment.php +++ b/core/modules/comment/src/Entity/Comment.php @@ -229,7 +229,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { ->setTranslatable(TRUE) ->setSetting('max_length', 64) ->setDisplayOptions('form', array( - 'type' => 'string', + 'type' => 'string_textfield', // Default comment body field has weight 20. 'weight' => 10, )) diff --git a/core/modules/comment/src/Tests/CommentTestBase.php b/core/modules/comment/src/Tests/CommentTestBase.php index 05f139d..b4f6eda 100644 --- a/core/modules/comment/src/Tests/CommentTestBase.php +++ b/core/modules/comment/src/Tests/CommentTestBase.php @@ -218,7 +218,7 @@ public function setCommentSubject($enabled) { $form_display = entity_get_form_display('comment', 'comment', 'default'); if ($enabled) { $form_display->setComponent('subject', array( - 'type' => 'string', + 'type' => 'string_textfield', )); } else { diff --git a/core/modules/contact/src/Entity/Message.php b/core/modules/contact/src/Entity/Message.php index 9cf50bc..1ff6624 100644 --- a/core/modules/contact/src/Entity/Message.php +++ b/core/modules/contact/src/Entity/Message.php @@ -162,7 +162,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { ->setRequired(TRUE) ->setSetting('max_length', 100) ->setDisplayOptions('form', array( - 'type' => 'string', + 'type' => 'string_textfield', 'weight' => -10, )) ->setDisplayConfigurable('form', TRUE); diff --git a/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php b/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php index 881e71a..5fadb11 100644 --- a/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php +++ b/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php @@ -190,7 +190,7 @@ protected function setupTestFields() { ))->save(); entity_get_form_display($this->entityTypeId, $this->bundle, 'default') ->setComponent($this->fieldName, array( - 'type' => 'string', + 'type' => 'string_textfield', 'weight' => 0, )) ->save(); diff --git a/core/modules/field/src/Tests/String/StringFormatterTest.php b/core/modules/field/src/Tests/String/StringFormatterTest.php index ea76e23..465b519 100644 --- a/core/modules/field/src/Tests/String/StringFormatterTest.php +++ b/core/modules/field/src/Tests/String/StringFormatterTest.php @@ -54,7 +54,7 @@ class StringFormatterTest extends KernelTestBase { /** * {@inheritdoc} */ - function setUp() { + protected function setUp() { parent::setUp(); // Configure the theme system. @@ -105,9 +105,9 @@ protected function renderEntityFields(ContentEntityInterface $entity, EntityView } /** - * Tests text_plain formatter output. + * Tests string formatter output. */ - function testPlainText() { + public function testStringFormatter() { $value = $this->randomString(); $value .= "\n\n" . $this->randomString() . ''; $value .= "\n\n" . $this->randomString(); diff --git a/core/modules/menu_link_content/src/Entity/MenuLinkContent.php b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php index 11f1d12..098c479 100644 --- a/core/modules/menu_link_content/src/Entity/MenuLinkContent.php +++ b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php @@ -287,7 +287,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { 'weight' => -5, )) ->setDisplayOptions('form', array( - 'type' => 'string', + 'type' => 'string_textfield', 'weight' => -5, )) ->setDisplayConfigurable('form', TRUE); @@ -306,7 +306,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { 'weight' => 0, )) ->setDisplayOptions('form', array( - 'type' => 'string', + 'type' => 'string_textfield', 'weight' => 0, )); diff --git a/core/modules/node/src/Entity/Node.php b/core/modules/node/src/Entity/Node.php index da0eb0b..8b254cf 100644 --- a/core/modules/node/src/Entity/Node.php +++ b/core/modules/node/src/Entity/Node.php @@ -365,7 +365,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { 'weight' => -5, )) ->setDisplayOptions('form', array( - 'type' => 'string', + 'type' => 'string_textfield', 'weight' => -5, )) ->setDisplayConfigurable('form', TRUE); diff --git a/core/modules/shortcut/src/Entity/Shortcut.php b/core/modules/shortcut/src/Entity/Shortcut.php index 706ef0a..ea15bf8 100644 --- a/core/modules/shortcut/src/Entity/Shortcut.php +++ b/core/modules/shortcut/src/Entity/Shortcut.php @@ -177,7 +177,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { ->setDefaultValue('') ->setSetting('max_length', 255) ->setDisplayOptions('form', array( - 'type' => 'string', + 'type' => 'string_textfield', 'weight' => -10, 'settings' => array( 'size' => 40, diff --git a/core/modules/taxonomy/src/Entity/Term.php b/core/modules/taxonomy/src/Entity/Term.php index 51803c1..1a13008 100644 --- a/core/modules/taxonomy/src/Entity/Term.php +++ b/core/modules/taxonomy/src/Entity/Term.php @@ -133,7 +133,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { 'weight' => -5, )) ->setDisplayOptions('form', array( - 'type' => 'string', + 'type' => 'string_textfield', 'weight' => -5, )) ->setDisplayConfigurable('form', TRUE); diff --git a/core/modules/text/src/Plugin/Field/FieldWidget/TextfieldWidget.php b/core/modules/text/src/Plugin/Field/FieldWidget/TextfieldWidget.php index 6bf39f8..ab2f19a 100644 --- a/core/modules/text/src/Plugin/Field/FieldWidget/TextfieldWidget.php +++ b/core/modules/text/src/Plugin/Field/FieldWidget/TextfieldWidget.php @@ -8,7 +8,7 @@ namespace Drupal\text\Plugin\Field\FieldWidget; use Drupal\Core\Field\FieldItemListInterface; -use Drupal\Core\Field\Plugin\Field\FieldWidget\StringWidget; +use Drupal\Core\Field\Plugin\Field\FieldWidget\StringTextfieldWidget; use Drupal\Core\Form\FormStateInterface; use Symfony\Component\Validator\ConstraintViolationInterface; @@ -19,12 +19,11 @@ * id = "text_textfield", * label = @Translation("Text field"), * field_types = { - * "text", - * "string" + * "text" * }, * ) */ -class TextfieldWidget extends StringWidget { +class TextfieldWidget extends StringTextfieldWidget { /** * {@inheritdoc} diff --git a/core/modules/text/src/Tests/Formatter/TextFormatterTest.php b/core/modules/text/src/Tests/Formatter/TextFormatterTest.php index af55bd1..538928f 100644 --- a/core/modules/text/src/Tests/Formatter/TextFormatterTest.php +++ b/core/modules/text/src/Tests/Formatter/TextFormatterTest.php @@ -54,7 +54,6 @@ protected function setUp() { ), ))->save(); - // Set up two fields: one with text processing enabled, the other disabled. entity_create('field_storage_config', array( 'name' => 'processed_text', 'entity_type' => $this->entityType,