-
(tl,dr; see summary at the bottom) My team has a CKAN 2.10.1 instance that uses - field_name: name
label: URL
preset: dataset_slug
form_placeholder: e.g., my-dataset The We are aware that if you try to view a dataset by passing in the UUID instead of name, CKAN will "get it right" and redirect you to the correct dataset, but in our ideal scenario, the name and the UUID would always align. Using the UUID for the URL instead of a user-entered After looking at the source of I think it might be feasible to implement the Any insight or pointers about this problem & our proposed approach would be greatly appreciated. Summary:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is how we set the name to be the same as the id of our datasets:
There are some cases where we had an old UUID that we wanted to map to a new id so we allow name to be set to a different value so that our site can accept both, but it still needs to be a UUID because of Looking at now this there are some old-ckan-isms we need to clean up like the use of |
Beta Was this translation helpful? Give feedback.
This is how we set the name to be the same as the id of our datasets:
https://github.com/open-data/ckanext-canada/blob/69b04b8eaf2750b3e95239783d2768248240e10e/ckanext/canada/schemas/presets.yaml#L29-L34
form_snippet: null
hides the name field on the form andif_empty_same_as(id)
copies the id value over.There are some cases where we had an old UUID that we wanted to map to a new id so we allow name to be set to a different value so that our site can accept both, but it still needs to be a UUID because of
canada_validate_generate_uuid
defined here:https://github.com/open-data/ckanext-canada/blob/69b04b8eaf2750b3e95239783d2768248240e10e/ckanext/canada/validators.py#L144-L154
Looking at n…