Cockpit-HQ / Cockpit

Cockpit Core - Content Platform
https://getcockpit.com
Other
388 stars 47 forks source link

Multi-word "name" results in 404 #137

Closed faisalnjs closed 1 year ago

faisalnjs commented 1 year ago

Hi! I've been playing around with Cockpit for a few days and I've spotted this issue that should be fixed. When going to create a Collection (/content/models/create) we have the option to enter a "name" that contains an underscore ("_"), for example "multi_word_name". Creation of the collection is successful, and we are able to add our fields and everything as usual. However, once you close out of the collection and try to enter back into it, it results in a 404 error. Updating or trying to delete the collection results in a 404 alert. The CMS does register the collection, as it appears in /storage/content/ as multiwordname.model.php. This may be because the page that renders the collection and allows for adding items does not accept collections with underscores in the name. By name I mean "name", not "title". This is an issue with all types, not just collections. We are not notified that this would happen, and we have to redo the whole singleton/collection/tree. As I am migrating from my old CMS which supported names like "multi_word_name", it would be nice to have them. If it's not possible, it should alert us and stop the creation of it. Thanks!

faisalnjs commented 1 year ago

Using Opera, I see "Please match the requested format." when entering "Multi Word Name" which requires me to remove the spaces. It should be easy to implement a restriction on underscores.