Skip to content
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

Cannot create a page with short name "contributors" #3441

Open
iFlameing opened this issue Jun 17, 2022 · 8 comments
Open

Cannot create a page with short name "contributors" #3441

iFlameing opened this issue Jun 17, 2022 · 8 comments

Comments

@iFlameing
Copy link
Member

If I name the page contributors then I am unable to save.

@harshit-dugar
Copy link

I am new to Volto @iFlameing can you please specify the issue

@iFlameing
Copy link
Member Author

@harshit-dugar Try to give a page Title contributors you will be not able to solve the page.

@tiberiuichim tiberiuichim added this to To do in Polished Volto Oct 16, 2022
@tisto
Copy link
Sponsor Member

tisto commented Oct 26, 2023

We need to create a static list in Volto with reserved words (e.g. "contributors", "search") and make sure the Volto UI tells editors when they want to add or edit an ID that matches our reserved words list.

@robgietema @sneridagh if I am not mistaken we worked on something like this in one of our client projects.

@erral
Copy link
Sponsor Member

erral commented Oct 26, 2023

We need to create a static list in Volto with reserved words (e.g. "contributors", "search") and make sure the Volto UI tells editors when they want to add or edit an ID that matches our reserved words list.

I think this should be done on the backend level and emit a proper error through the REST API when creating a content with such URLs

@sneridagh
Copy link
Member

sneridagh commented Oct 26, 2023

@tisto we already do it in the widget ID in core (see below), but in the use case of "add" form, the main check happens on the backend, on POST. As @erral hinted the RESTAPI response should be more explicit in the case of clash. Could be that the error provided in Dexterity won't be enough descriptive even... so it might require more changes than fixing only RESTAPI.

/cc @davisagli @jaroel

Using a static list of reserved words, in the config:

https://github.com/plone/volto/blob/main/src/components/manage/Widgets/IdWidget.jsx#L101

Checking the current list of indexes:

https://github.com/plone/volto/blob/main/src/components/manage/Widgets/IdWidget.jsx#L147-L149

And checking for special characters:

https://github.com/plone/volto/blob/main/src/components/manage/Widgets/IdWidget.jsx#L142-L145C6

@erral
Copy link
Sponsor Member

erral commented Oct 26, 2023

As @erral hinted the RESTAPI response should be more explicit in the case of clash. Could be that the error provided in Dexterity won't be enough descriptive even... so it might require more changes than fixing only RESTAPI.

/cc @davisagli @jaroel

I think we don't even have such a list in the backend... I tried once to track down how was this controlled on Plone or Zope level (because a client added a page named layout in Plone 3 and when we migrated it to Plone 5 it crashed) and I wasn¡t able to track it down.

@davisagli
Copy link
Sponsor Member

This is related to plone/plone.restapi#1613

@davisagli
Copy link
Sponsor Member

Also related to #3716 and #4686 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

6 participants