diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 9470bd7..6888e4c 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -2147,13 +2147,17 @@ function comment_add_default_comment_field($entity_type, $bundle, $field_name = 'bundle' => $bundle, 'required' => 1, 'default_value' => array(array('status' => $default_value)), - 'widget' => array( - 'type' => 'comment_default', - 'weight' => '50', - ), )); $instance->save(); + // Assign widget settings for the 'default' form mode. + entity_get_form_display($entity_type, $bundle, 'default') + ->setComponent($field_name, array( + 'type' => 'comment_default', + 'weight' => 50, + )) + ->save(); + // Set default to display comment list. entity_get_display($entity_type, $bundle, 'default') ->setComponent($field_name, array( diff --git a/core/modules/comment/comment.install b/core/modules/comment/comment.install index 3a6201a..fdf6592 100644 --- a/core/modules/comment/comment.install +++ b/core/modules/comment/comment.install @@ -612,13 +612,6 @@ function comment_update_8006(&$sandbox) { 'label' => 'Comment settings', 'required' => 1, 'settings' => $instance_settings, - 'widget' => array( - 'active' => 0, - 'module' => 'comment', - 'settings' => array(), - 'type' => 'comment_default', - 'weight' => '50', - ), ); _update_7000_field_create_instance($field, $instance); } @@ -644,6 +637,17 @@ function comment_update_8006(&$sandbox) { ->save(); update_config_manifest_add('entity.display', array($display->get('id'))); + // Assign widget settings for the 'default' form mode. + $display_options_default = array( + 'type' => 'comment_default', + 'settings' => array(), + 'weight' => 1, + ); + $display = _update_8000_entity_get_form_display('node', $node_type, 'default'); + $display->set('content.' . $field['field_name'], $display_options_default) + ->save(); + update_config_manifest_add('entity.form_display', array($display->get('id'))); + // Clean up old variables. variable_del('comment_' . $node_type); variable_del('comment_default_mode_' . $node_type);