diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 7c7c7ed..deb1ff4 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -1025,7 +1025,7 @@ function comment_view_multiple($comments, $view_mode = 'full', $langcode = NULL) function comment_form_field_ui_field_instance_edit_form_alter(&$form, $form_state) { if ($form['#field']['type'] == 'comment') { // Collect translation settings. - if (module_exists('translation_entity')) { + if (module_exists('content_translation')) { array_unshift($form['#submit'], 'comment_translation_configuration_element_submit'); } @@ -2029,12 +2029,12 @@ function _comment_field_instance_settings_form_process($element, $form_state) { array_pop($parents); $element['#parents'] = $parents; // Add translation entity handlers. - if (Drupal::moduleHandler()->moduleExists('translation_entity')) { + if (Drupal::moduleHandler()->moduleExists('content_translation')) { $comment_form = $element; - $comment_form_state['translation_entity']['key'] = 'language_configuration'; - $element += translation_entity_enable_widget('comment', $element['#field_name'], $comment_form, $comment_form_state); - $element['translation_entity']['#parents'] = $element['translation_entity']['#array_parents'] = array( - 'translation_entity' + $comment_form_state['content_translation']['key'] = 'language_configuration'; + $element += content_translation_enable_widget('comment', $element['#field_name'], $comment_form, $comment_form_state); + $element['content_translation']['#parents'] = $element['content_translation']['#array_parents'] = array( + 'content_translation' ); } return $element; diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/field/field_type/CommentItem.php b/core/modules/comment/lib/Drupal/comment/Plugin/field/field_type/CommentItem.php index 4a21bba..611c480 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/field/field_type/CommentItem.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/field/field_type/CommentItem.php @@ -148,7 +148,9 @@ public function instanceSettingsForm(array $form, array &$form_state) { * {@inheritdoc} */ public function applyDefaultValue($notify = TRUE) { - $this->setValue($this->getInstance()->default_value, $notify); + // Retrieve the configured default value for the instance. The configured + $defaults = $this->getInstance()->default_value; + $this->setValue(reset($defaults), $notify); return $this; } diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentTranslationUITest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentTranslationUITest.php index 7789b49..6c952de 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentTranslationUITest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentTranslationUITest.php @@ -54,7 +54,7 @@ function setupBundle() { // Add another comment field with new bundle to page content type. comment_add_default_comment_field('node', 'page'); // Mark this bundle as translatable. - translation_entity_set_config('comment', 'comment_article', 'enabled', TRUE); + content_translation_set_config('comment', 'comment_article', 'enabled', TRUE); // Refresh entity info. entity_info_cache_clear(); // Flush the permissions after adding the translatable comment bundle.