consuldemocracy
consuldemocracy copied to clipboard
Custom pages problem on edit slug
User Story
As an adminsitrator, I want to edit the content of the default customs pages for /privacy
, /conditions
and /accessibility
but not the slug
when CONSUL is in production.
Why is this Needed?
Because if I change the slug
the Consul site will have broken links.
Description
Type: Feature
Current Behavior
If I change the current slug for /privacy
, /conditions
and /accessibility
and I go to the footer section then I click in some of the URL described before I will have a 404 error code. Because the slug are defined in static HTML.
Expected Behavior
I expect to be able to see the page.
Steps to reproduce
- Login as Administrator
- Go to
/admin/site_customization/pages
- Edit the slug of a page
/privacy
,/conditions
and/accessibility
. - Then go to the footer section in
/
. - Click in the page that you edited.
Definition of Done
As a result of this error I have found another one, should I create it in another issue?
I think that this line is not necesary in config/routes.rb
Line get "help/faq", to: "pages#show", id: "faq", as: "faq"
Because this page is created with SiteCustomization::Page
Someone could help me?
@alerodrom Thanks for reporting! And sorry for the late reply :pray:.
You're right; right now changing the slug breaks the links. There doesn't seem to be an easy solution :thinking:. I guess we could add an extra field in the database where we store things like "accessibility", and we use this field in the footer to find the right slug when its slug changes :thinking:. Or change the way these links are displayed in the footer completely.
As a workaround, I'm afraid you'll have to change the code every time the slug is changed. You could also add a content block in the footer.
Regarding the other thing you mention, get "help/faq", to: "pages#show", id: "faq", as: "faq"
is still useful because we use the faq_path
method in the code, which is generated thanks to this line.