FillPdfFormConfirmFormBase.php in FillPDF 8.4
File
src/Form/FillPdfFormConfirmFormBase.php
View source
<?php
namespace Drupal\fillpdf\Form;
use Drupal\Core\Entity\ContentEntityConfirmFormBase;
use Drupal\Core\Form\FormStateInterface;
abstract class FillPdfFormConfirmFormBase extends ContentEntityConfirmFormBase {
protected function actions(array $form, FormStateInterface $form_state) {
$request = $this
->getRequest();
$destination = $request->query
->get('destination');
if ($destination) {
$update_destination = preg_replace('/^' . preg_quote(base_path(), '/') . '/', '/', $destination);
$request->query
->set('destination', $update_destination);
$actions = parent::actions($form, $form_state);
$request->query
->set('destination', $destination);
return $actions;
}
else {
return parent::actions($form, $form_state);
}
}
}