Skip to content

Migrate rest routings to default symfony routing files of PreviewBundle #7526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 10, 2025

Conversation

TheCadien
Copy link
Member

@TheCadien TheCadien commented Jul 12, 2024

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets fixes # 7434
Related issues/PRs # 7434
License MIT
Documentation PR sulu/sulu-docs#

What's in this PR?

See ticket # 7434

All Routes that are needed

  • sulu_preview.start ANY ANY ANY /admin/preview/start
  • sulu_preview.render ANY ANY ANY /admin/preview/render
  • sulu_preview.update POST ANY ANY /admin/preview/update
  • sulu_preview.update-context ANY ANY ANY /admin/preview/update-context
  • sulu_preview.stop ANY ANY ANY /admin/preview/stop
  • sulu_preview.get_preview-link GET ANY ANY /admin/api/preview-links/{resourceId}.{_format}
  • sulu_preview.post_preview-link_trigger POST ANY ANY /admin/api/preview-links/{resourceId}/triggers.{_format}
  • sulu_preview.post_preview_link_trigger POST ANY ANY /admin/api/preview-links/{resourceId}.{_format}
  • sulu_preview.public_preview ANY ANY ANY /admin/p/{token}
  • sulu_preview.public_render ANY ANY ANY /admin/p/{token}/render

@TheCadien TheCadien added the UX Affecting the end user label Jul 12, 2024
@TheCadien TheCadien added DX Affecting the end developer and removed UX Affecting the end user labels Jul 24, 2024
Copy link
Member

@alexander-schranz alexander-schranz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please register the new routes in config/routes/ directory instead of the old one:

diff --git a/config/routes/sulu_admin.yaml b/config/routes/sulu_admin.yaml
index 0b19447d89..161249cc7e 100644
--- a/config/routes/sulu_admin.yaml
+++ b/config/routes/sulu_admin.yaml
@@ -82,16 +82,16 @@ sulu_route_api:
     prefix: /admin/api

 sulu_preview:
-    resource: "@SuluPreviewBundle/Resources/config/routing.yml"
+    resource: "@SuluPreviewBundle/Resources/config/routing.yaml"
     prefix: /admin/preview

 sulu_preview_api:
     type: rest
-    resource: "@SuluPreviewBundle/Resources/config/routing_api.yml"
+    resource: "@SuluPreviewBundle/Resources/config/routing_api.yaml"
     prefix: /admin/api

 sulu_preview_public:
-    resource: "@SuluPreviewBundle/Resources/config/routing_public.yml"
+    resource: "@SuluPreviewBundle/Resources/config/routing_public.yaml"
     prefix: /admin/p

 sulu_search:

Still there seems unexpected changes / missing routes?:

Bildschirmfoto 2025-01-14 um 15 43 35

Bildschirmfoto 2025-01-14 um 15 45 52

Make sure the bin/console debug:router --format json is the same for new routing files and the rest routing files.

@alexander-schranz alexander-schranz force-pushed the migrate-rest-routings-preview branch 2 times, most recently from 797004d to 221bd8e Compare June 7, 2025 18:09
@alexander-schranz alexander-schranz enabled auto-merge (squash) June 7, 2025 18:12
@alexander-schranz alexander-schranz force-pushed the migrate-rest-routings-preview branch from 221bd8e to 9268354 Compare June 8, 2025 08:16
@alexander-schranz alexander-schranz force-pushed the migrate-rest-routings-preview branch from 9268354 to 939cdbc Compare June 10, 2025 05:24
@alexander-schranz alexander-schranz merged commit 8cf3fc1 into sulu:2.6 Jun 10, 2025
9 checks passed
@alexander-schranz alexander-schranz added the Technical Debt Impacts code quality, no or just small impact on end developers and users label Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Affecting the end developer Technical Debt Impacts code quality, no or just small impact on end developers and users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants