You are here

protected function FillPdfFormForm::actions in FillPDF 8.4

Same name and namespace in other branches
  1. 5.0.x src/Form/FillPdfFormForm.php \Drupal\fillpdf\Form\FillPdfFormForm::actions()

@todo Remove this (imperfect) workaround once the Core issue is fixed. See https://www.drupal.org/project/fillpdf/issues/3046178.

Overrides EntityForm::actions

File

src/Form/FillPdfFormForm.php, line 494

Class

FillPdfFormForm
Form controller for the FillPDFForm edit form.

Namespace

Drupal\fillpdf\Form

Code

protected function actions(array $form, FormStateInterface $form_state) {
  $actions = parent::actions($form, $form_state);

  // Replace inherited '?destination' query parameter with current URL.

  /** @var \Drupal\Core\Url $route_info */
  $route_info = $actions['delete']['#url'];
  $route_info
    ->setOption('query', []);
  $actions['delete']['#url'] = $route_info;
  return $actions;
}