Commit 2c7dc8fd authored by xjm's avatar xjm
Browse files

Issue #2527406 by Gábor Hojtsy, Berdir: CommentForm::init() and...

Issue #2527406 by Gábor Hojtsy, Berdir: CommentForm::init() and MessageForm::init() are useless/broken
parent 2bf671a2
......@@ -67,22 +67,6 @@ public function __construct(EntityManagerInterface $entity_manager, AccountInter
$this->renderer = $renderer;
}
/**
* {@inheritdoc}
*/
protected function init(FormStateInterface $form_state) {
$comment = $this->entity;
// Make the comment inherit the current content language unless specifically
// set.
if ($comment->isNew()) {
$language_content = \Drupal::languageManager()->getCurrentLanguage(LanguageInterface::TYPE_CONTENT);
$comment->langcode->value = $language_content->getId();
}
parent::init($form_state);
}
/**
* Overrides Drupal\Core\Entity\EntityForm::form().
*/
......
......@@ -231,20 +231,4 @@ public function save(array $form, FormStateInterface $form_state) {
$message->save();
}
/**
* {@inheritdoc}
*/
protected function init(FormStateInterface $form_state) {
$message = $this->entity;
// Make the message inherit the current content language unless specifically
// set.
if ($message->isNew() && !$message->langcode->value) {
$language_content = $this->languageManager->getCurrentLanguage(LanguageInterface::TYPE_CONTENT);
$message->langcode->value = $language_content->getId();
}
parent::init($form_state);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment