public function ViewsRevisionsEditForm::cancel in Config Entity Revisions 8
Same name and namespace in other branches
- 1.x modules/views_revisions/src/ViewsRevisionsEditForm.php \Drupal\views_revisions\ViewsRevisionsEditForm::cancel()
Form submission handler for the 'cancel' action.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides ViewEditForm::cancel
File
- modules/
views_revisions/ src/ ViewsRevisionsEditForm.php, line 33
Class
Namespace
Drupal\views_revisionsCode
public function cancel(array $form, FormStateInterface $form_state) {
// Remove this view from cache so edits will be lost.
parent::cancel($form, $form_state);
$entity = $this
->getEntity();
$revId = $entity
->get('storage')
->get('loadedRevisionId');
$cacheId = $revId ? $entity
->id() . '-' . $revId : $entity
->id();
$this->tempStore
->delete($cacheId);
}