public function ConfigEntityRevisionsRevertFormBase::prepareToPublishCurrentRevision in Config Entity Revisions 8
Same name and namespace in other branches
- 8.2 src/ConfigEntityRevisionsRevertFormBase.php \Drupal\config_entity_revisions\ConfigEntityRevisionsRevertFormBase::prepareToPublishCurrentRevision()
- 1.x src/ConfigEntityRevisionsRevertFormBase.php \Drupal\config_entity_revisions\ConfigEntityRevisionsRevertFormBase::prepareToPublishCurrentRevision()
Modify the revision's fields so that it becomes published.
Parameters
ConfigEntityRevisionsEntityInterface $revision: The revision to be published.
Return value
ConfigEntityRevisionsEntityInterface The resulting revision record, ready to be saved.
1 call to ConfigEntityRevisionsRevertFormBase::prepareToPublishCurrentRevision()
- ConfigEntityRevisionsRevertFormBase::applyRevisionChange in src/
ConfigEntityRevisionsRevertFormBase.php - Apply the revision insert/update.
1 method overrides ConfigEntityRevisionsRevertFormBase::prepareToPublishCurrentRevision()
- ConfigEntityRevisionsRevertFormTest2::prepareToPublishCurrentRevision in tests/
src/ Unit/ ConfigEntityRevisionsRevertFormBaseTest.php - Override prepareToPublishCurrentRevision so we can be sure it is actually called.
File
- src/
ConfigEntityRevisionsRevertFormBase.php, line 223
Class
- ConfigEntityRevisionsRevertFormBase
- Provides a form for reverting / publishing a revision.
Namespace
Drupal\config_entity_revisionsCode
public function prepareToPublishCurrentRevision(ConfigEntityRevisionsEntityInterface $revision) {
$revision
->set('moderation_state', 'published');
$revision
->setPublished();
$revision
->isDefaultRevision(TRUE);
return $revision;
}