Skip to content

Commit

Permalink
Merge pull request ezsystems#143 from ezsystems/ezp27762_content_edit…
Browse files Browse the repository at this point in the history
…_routing_conflict_legacy

EZP-27762 content/edit routing conflict with legacy
  • Loading branch information
lserwatka committed Sep 20, 2017
2 parents 4c01cad + e045a48 commit 8113ee3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bundle/Resources/config/routing.yml
Expand Up @@ -3,8 +3,8 @@ ez_content_create_no_draft:
defaults:
_controller: ez_content_edit:createWithoutDraftAction

ez_content_edit:
path: /content/edit/{contentId}/{versionNo}/{language}
ez_content_draft_edit:
path: /content/edit/draft/{contentId}/{versionNo}/{language}
defaults:
_controller: ez_content_edit:editContentDraftAction
language: null
Expand Down
2 changes: 1 addition & 1 deletion doc/specifications/content_edit.md
Expand Up @@ -34,7 +34,7 @@ The actual creation of the draft is delegated to the FormProcessor API, by firin
### Editing a draft
> A route that displays a content editing form, with options to discard, save or publish.
- path: `/content/edit/{contentId}/{versionNo}/{language}`
- path: `/content/edit/draft/{contentId}/{versionNo}/{language}`
- controller action: `ContentEditController::editContentDraftAction`

`language` is optional.
Expand Down
4 changes: 2 additions & 2 deletions lib/Form/Processor/ContentFormProcessor.php
Expand Up @@ -59,7 +59,7 @@ public function processSaveDraft(FormActionEvent $event)
$languageCode = $formConfig->getOption('languageCode');
$draft = $this->saveDraft($data, $languageCode);

$defaultUrl = $this->router->generate('ez_content_edit', [
$defaultUrl = $this->router->generate('ez_content_draft_edit', [
'contentId' => $draft->id,
'versionNo' => $draft->getVersionInfo()->versionNo,
'language' => $languageCode,
Expand Down Expand Up @@ -113,7 +113,7 @@ public function processCreateDraft(FormActionEvent $event)
$versionInfo = $this->contentService->loadVersionInfo($contentInfo, $createContentDraft->fromVersionNo);
$contentDraft = $this->contentService->createContentDraft($contentInfo, $versionInfo);

$contentEditUrl = $this->router->generate('ez_content_edit', [
$contentEditUrl = $this->router->generate('ez_content_draft_edit', [
'contentId' => $contentDraft->id,
'versionNo' => $contentDraft->getVersionInfo()->versionNo,
'language' => $contentDraft->contentInfo->mainLanguageCode,
Expand Down

0 comments on commit 8113ee3

Please sign in to comment.