protected function NodeRevisionRevertDefaultForm::prepareRevertedRevision in Thunder 8.4
Same name and namespace in other branches
- 8.5 modules/thunder_article/src/Form/NodeRevisionRevertDefaultForm.php \Drupal\thunder_article\Form\NodeRevisionRevertDefaultForm::prepareRevertedRevision()
- 8.2 modules/thunder_article/src/Form/NodeRevisionRevertDefaultForm.php \Drupal\thunder_article\Form\NodeRevisionRevertDefaultForm::prepareRevertedRevision()
- 8.3 modules/thunder_article/src/Form/NodeRevisionRevertDefaultForm.php \Drupal\thunder_article\Form\NodeRevisionRevertDefaultForm::prepareRevertedRevision()
- 6.2.x modules/thunder_article/src/Form/NodeRevisionRevertDefaultForm.php \Drupal\thunder_article\Form\NodeRevisionRevertDefaultForm::prepareRevertedRevision()
- 6.0.x modules/thunder_article/src/Form/NodeRevisionRevertDefaultForm.php \Drupal\thunder_article\Form\NodeRevisionRevertDefaultForm::prepareRevertedRevision()
- 6.1.x modules/thunder_article/src/Form/NodeRevisionRevertDefaultForm.php \Drupal\thunder_article\Form\NodeRevisionRevertDefaultForm::prepareRevertedRevision()
Prepares a revision to be reverted.
Parameters
\Drupal\node\NodeInterface $revision: The revision to be reverted.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
\Drupal\node\NodeInterface The prepared revision ready to be stored.
Overrides NodeRevisionRevertForm::prepareRevertedRevision
1 call to NodeRevisionRevertDefaultForm::prepareRevertedRevision()
- NodeRevisionRevertDefaultForm::submitForm in modules/
thunder_article/ src/ Form/ NodeRevisionRevertDefaultForm.php - Form submission handler.
File
- modules/
thunder_article/ src/ Form/ NodeRevisionRevertDefaultForm.php, line 83
Class
- NodeRevisionRevertDefaultForm
- Provides a form for reverting a node revision.
Namespace
Drupal\thunder_article\FormCode
protected function prepareRevertedRevision(NodeInterface $revision, FormStateInterface $form_state) {
$revision
->setNewRevision();
$revision
->isDefaultRevision(TRUE);
$revision
->setRevisionTranslationAffected(TRUE);
return $revision;
}