// Discard is not dependent on form input.
'#limit_validation_errors' =>
[],
];
// @todo This button should be conditionally displayed, see
// https://www.drupal.org/node/2917777.
$actions['revert'
] =
[ '#type' => 'submit',
'#value' =>
$this->
t('Revert to defaults'
),
'#submit' =>
['::redirectOnSubmit'
],
'#redirect' => 'revert',
];
$actions['preview_toggle'
] =
$this->
buildContentPreviewToggle();
return $actions;
} /**
* Form submission handler.
*/
public function redirectOnSubmit(array
$form, FormStateInterface
$form_state) { $form_state->
setRedirectUrl($this->sectionStorage->
getLayoutBuilderUrl($form_state->
getTriggeringElement()['#redirect'
]));
} /**
* Retrieves the section storage object.
*
* @return \Drupal\layout_builder\SectionStorageInterface
* The section storage for the current form.
*/