consuldemocracy icon indicating copy to clipboard operation
consuldemocracy copied to clipboard

Custom pages problem on edit slug

Open alerodrom opened this issue 5 years ago • 2 comments

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

  1. Login as Administrator
  2. Go to /admin/site_customization/pages
  3. Edit the slug of a page /privacy, /conditions and /accessibility.
  4. Then go to the footer section in /.
  5. 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

alerodrom avatar May 02 '19 10:05 alerodrom

Someone could help me?

alerodrom avatar May 15 '19 06:05 alerodrom

@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.

javierm avatar Oct 22 '19 17:10 javierm