From e045a48b587d397b06433b88558ccfb2c265e12e Mon Sep 17 00:00:00 2001 From: Gunnstein Lye Date: Fri, 11 Aug 2017 11:18:29 +0200 Subject: [PATCH] EZP-27762 content/edit routing conflict with legacy --- bundle/Resources/config/routing.yml | 4 ++-- doc/specifications/content_edit.md | 2 +- lib/Form/Processor/ContentFormProcessor.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bundle/Resources/config/routing.yml b/bundle/Resources/config/routing.yml index dcae871b7..b13a143bd 100644 --- a/bundle/Resources/config/routing.yml +++ b/bundle/Resources/config/routing.yml @@ -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 diff --git a/doc/specifications/content_edit.md b/doc/specifications/content_edit.md index 54d3d4360..cbbc1d270 100644 --- a/doc/specifications/content_edit.md +++ b/doc/specifications/content_edit.md @@ -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. diff --git a/lib/Form/Processor/ContentFormProcessor.php b/lib/Form/Processor/ContentFormProcessor.php index b38043e45..92c25a776 100644 --- a/lib/Form/Processor/ContentFormProcessor.php +++ b/lib/Form/Processor/ContentFormProcessor.php @@ -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, @@ -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,