Skip to content
Snippets Groups Projects
Commit 7c9ab8eb authored by Bernd Oliver Suenderhauf's avatar Bernd Oliver Suenderhauf
Browse files

Issue #3046427 by Pancho, wizonesolutions: Redirect to '<front>' rather than to '/'

parent 63d82404
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace Drupal\fillpdf\Controller; namespace Drupal\fillpdf\Controller;
use Drupal\Core\Url;
use Drupal\Core\Controller\ControllerBase; use Drupal\Core\Controller\ControllerBase;
use Drupal\file\Entity\File; use Drupal\file\Entity\File;
use Drupal\file\FileInterface; use Drupal\file\FileInterface;
...@@ -126,7 +127,7 @@ class HandlePdfController extends ControllerBase { ...@@ -126,7 +127,7 @@ class HandlePdfController extends ControllerBase {
$fillpdf_form = FillPdfForm::load($context['fid']); $fillpdf_form = FillPdfForm::load($context['fid']);
if (!$fillpdf_form) { if (!$fillpdf_form) {
$this->messenger->addError($this->t('FillPDF Form (fid) not found in the system. Please check the value in your FillPDF Link.')); $this->messenger->addError($this->t('FillPDF Form (fid) not found in the system. Please check the value in your FillPDF Link.'));
return new RedirectResponse('/'); return new RedirectResponse(Url::fromRoute('<front>')->toString());
} }
$fields = $fillpdf_form->getFormFields(); $fields = $fillpdf_form->getFormFields();
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace Drupal\fillpdf\Plugin\FillPdfActionPlugin; namespace Drupal\fillpdf\Plugin\FillPdfActionPlugin;
use Drupal\Core\Url;
use Drupal\fillpdf\OutputHandler; use Drupal\fillpdf\OutputHandler;
use Drupal\fillpdf\Plugin\FillPdfActionPluginBase; use Drupal\fillpdf\Plugin\FillPdfActionPluginBase;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
...@@ -68,7 +69,7 @@ class FillPdfSaveAction extends FillPdfActionPluginBase { ...@@ -68,7 +69,7 @@ class FillPdfSaveAction extends FillPdfActionPluginBase {
$this->savePdf(); $this->savePdf();
// @todo: Fix based on value of post_save_redirect, once I add that // @todo: Fix based on value of post_save_redirect, once I add that
$response = new RedirectResponse('/'); $response = new RedirectResponse(Url::fromRoute('<front>')->toString());
return $response; return $response;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment