Open iFlameing opened 2 years ago
I am new to Volto @iFlameing can you please specify the issue
@harshit-dugar Try to give a page Title contributors you will be not able to solve the page.
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.
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
@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
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.
This is related to https://github.com/plone/plone.restapi/issues/1613
If I name the page contributors then I am unable to save.