function NodeRevisionRevertTranslationForm::prepareRevertedRevision
Same name in other branches
- 8.9.x core/modules/node/src/Form/NodeRevisionRevertTranslationForm.php \Drupal\node\Form\NodeRevisionRevertTranslationForm::prepareRevertedRevision()
- 10 core/modules/node/src/Form/NodeRevisionRevertTranslationForm.php \Drupal\node\Form\NodeRevisionRevertTranslationForm::prepareRevertedRevision()
- 11.x core/modules/node/src/Form/NodeRevisionRevertTranslationForm.php \Drupal\node\Form\NodeRevisionRevertTranslationForm::prepareRevertedRevision()
Overrides NodeRevisionRevertForm::prepareRevertedRevision
File
-
core/
modules/ node/ src/ Form/ NodeRevisionRevertTranslationForm.php, line 108
Class
- NodeRevisionRevertTranslationForm
- Provides a form for reverting a node revision for a single translation.
Namespace
Drupal\node\FormCode
protected function prepareRevertedRevision(NodeInterface $revision, FormStateInterface $form_state) {
$revert_untranslated_fields = (bool) $form_state->getValue('revert_untranslated_fields');
$translation = $revision->getTranslation($this->langcode);
return $this->nodeStorage
->createRevision($translation, TRUE, $revert_untranslated_fields);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.