diff --git a/core/modules/comment/src/CommentStorage.php b/core/modules/comment/src/CommentStorage.php index 3346e0e..1f808eb 100644 --- a/core/modules/comment/src/CommentStorage.php +++ b/core/modules/comment/src/CommentStorage.php @@ -148,7 +148,7 @@ public function getSchema() { 'comment__num_new' => array( 'entity_id', array('entity_type', 32), - array('comment_type', 32), + array('comment_type', EntityTypeInterface::BUNDLE_MAX_LENGTH), 'status', 'created', 'cid', @@ -157,7 +157,7 @@ public function getSchema() { 'comment__entity_langcode' => array( 'entity_id', array('entity_type', 32), - array('comment_type', 32), + array('comment_type', EntityTypeInterface::BUNDLE_MAX_LENGTH), 'langcode', ), 'comment__created' => array('created'), diff --git a/core/modules/comment/src/Entity/Comment.php b/core/modules/comment/src/Entity/Comment.php index f9198c4..0c42ca0 100644 --- a/core/modules/comment/src/Entity/Comment.php +++ b/core/modules/comment/src/Entity/Comment.php @@ -287,12 +287,13 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { $fields['comment_type'] = FieldDefinition::create('string') ->setLabel(t('Comment Type')) - ->setDescription(t('The comment type.')); + ->setDescription(t('The comment type.')) + ->setSetting('max_length', EntityTypeInterface::BUNDLE_MAX_LENGTH); $fields['field_name'] = FieldDefinition::create('string') ->setLabel(t('Comment field name')) ->setDescription(t('The field name through which this comment was added.')) - ->setComputed(TRUE); + ->setSetting('max_length', EntityTypeInterface::BUNDLE_MAX_LENGTH); return $fields; }