PiranhaCMS / piranha.core.docs

Official documentation for Piranha CMS
MIT License
12 stars 51 forks source link

Renaming content type route 404 error #88

Open hrvoje-grabusic opened 3 years ago

hrvoje-grabusic commented 3 years ago

Hi,

When renaming a ContentTypeRoute all pages that were created with that page type return 404. The only way to fix it seems to be to delete the pages and recreate them.

I was confused by why i was getting empty pages after renaming the route. I didn't expect the route to be saved in the database.

That should probably be documented.

Also maybe the the route should be updated when the page is saved or maybe an update all routes button in the settings.

tidyui commented 3 years ago

As page & post types can have multiple routes available the selected route is always stored in the database, even if there’s only one available.

I’ll move this issue to the docs repo as it’s not a software issue.

Regards

matthewyarlett commented 2 years ago

Hi,

When renaming a ContentTypeRoute all pages that were created with that page type return 404. The only way to fix it seems to be to delete the pages and recreate them.

I was confused by why i was getting empty pages after renaming the route. I didn't expect the route to be saved in the database.

That should probably be documented.

Also maybe the the route should be updated when the page is saved or maybe an update all routes button in the settings.

I had this issue the other day. I'm sure there is a more elegant/recommended approach to fixing it, however I found updating the routes in the Piranha pages table fixed the problem.

UPDATE [dbo].[Piranha_Pages]
SET Route = '/new-route'
WHERE ROUTE = '/old-route'