Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By andypost on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Introduced in version:
8.0
Issue links:
Description:
The comment entity subject field uses the "string" widget by default now.
Its visibility and input size are now controlled via widget settings (previously it was exposed as an extra field).
Now the comment field instance settings do not have the "subject" key anymore.
Also the migration of comments has been changed, there are 2 comment types:
comment
- used for comments with subject input allowed.comment_no_subject
-used for comments without subject field.
To get the visibility of a particular comment type:
Before:
$field = FieldConfig::loadByName('node', 'article', 'comment');
$subject_mode = $field->getSetting('subject');
After:
entity_get_form_display('comment', 'comment', 'default')->getComponent('subject');
Impacts:
Site builders, administrators, editors
Module developers
Themers