Skip to content

Commit

Permalink
IBX-947: Refactored processCancel method
Browse files Browse the repository at this point in the history
  • Loading branch information
barw4 authored Sep 9, 2021
1 parent f9ccc3f commit 71182ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Form/Processor/ContentFormProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,12 @@ public function processCancel(FormActionEvent $event)
if (1 === count($this->contentService->loadVersions($contentInfo))) {
$parentLocation = $this->locationService->loadParentLocationsForDraftContent($versionInfo)[0];
$redirectionLocationId = $parentLocation->id;
$this->contentService->deleteContent($contentInfo);
} else {
$redirectionLocationId = $contentInfo->mainLocationId;
$this->contentService->deleteVersion($versionInfo);
}

$this->contentService->deleteVersion($versionInfo);

$url = $this->router->generate(
'_ezpublishLocation',
['locationId' => $redirectionLocationId],
Expand Down

0 comments on commit 71182ae

Please sign in to comment.