Skip to content

Commit

Permalink
EZP-31086: Redirect based on router, not url alias (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
damianz5 authored Sep 14, 2020
1 parent c95f4dc commit e5756b0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 116 deletions.
4 changes: 0 additions & 4 deletions bundle/Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,6 @@ services:
tags:
- { name: kernel.event_subscriber }

EzSystems\RepositoryForms\Form\Processor\SystemUrlRedirectProcessor:
autowire: true
autoconfigure: true

# Controllers
ezrepoforms.controller.content_edit:
class: "%ezrepoforms.controller.content_edit.class%"
Expand Down
7 changes: 3 additions & 4 deletions lib/Form/Processor/ContentFormProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class ContentFormProcessor implements EventSubscriberInterface
* @param \eZ\Publish\API\Repository\ContentService $contentService
* @param \eZ\Publish\API\Repository\LocationService $locationService
* @param \Symfony\Component\Routing\RouterInterface $router
* @param \eZ\Publish\API\Repository\URLAliasService $urlAliasService
*/
public function __construct(
ContentService $contentService,
Expand Down Expand Up @@ -125,7 +124,7 @@ public function processPublish(FormActionEvent $event)
$event->setPayload('is_new', $draft->contentInfo->isDraft());

$redirectUrl = $form['redirectUrlAfterPublish']->getData() ?: $this->router->generate(
'_ezpublishLocation', [
'ez_urlalias', [
'locationId' => $content->contentInfo->mainLocationId,
]
);
Expand All @@ -146,7 +145,7 @@ public function processCancel(FormActionEvent $event)

if ($data->isNew()) {
$response = new RedirectResponse($this->router->generate(
'_ezpublishLocation',
'ez_urlalias',
['locationId' => $data->getLocationStructs()[0]->parentLocationId]
));
$event->setResponse($response);
Expand All @@ -171,7 +170,7 @@ public function processCancel(FormActionEvent $event)
}

$url = $this->router->generate(
'_ezpublishLocation',
'ez_urlalias',
['locationId' => $redirectionLocationId],
UrlGeneratorInterface::ABSOLUTE_URL
);
Expand Down
108 changes: 0 additions & 108 deletions lib/Form/Processor/SystemUrlRedirectProcessor.php

This file was deleted.

0 comments on commit e5756b0

Please # to comment.