Open dkelsey opened 6 years ago
PR #479 fixes the issue and gives a validator error when missing. However, there's no validation of the value itself. Meaning that value can be anything and not match the list of edc_vocabs that an editor would see in the webui.
@dkelsey one issue that may arise in testing for validating the actual value is validating the schema on update. Eg. is when an editor edits an old resource that uses a storage location from the old list, what would you like to happen?
~One option is to validate the old value with the current list and throw an error when an editor save, making them update the resource_storage_location.~
~The other option is to validate the incoming value for new resources only. This would prevent those potential errors in the first option due to the resource may still need to specify their old value.~
@dkelsey i've just been doing analysis on option 2 in my last comment, it looks like this option isn't possible due to the way ckan saves datasets & resources. When ckan saves a new resource, it goes through the update schema path, rather than create schema path.
~So, right now the first option i suggested is the only way to validate the resource storage location, I will have to see what happens when resources have old values for the storage location.~
@dkelsey more problems, looks like with option one, it fails silently with both the webui and api on datasets with invalid resource_storage_location.
So, the only option before applying the validation on the resource_storage_location field (and any other fields that are dependent on vocabs) is to migrate existing values to valid values. A strategy will be needed for this.
Existing dataset records are occassionally missing this information. Create solution to populate all existing resource metadata with a default = field entry has no meaning OR create an error to guide user to complete the field correctly OR automate where possible (e.g. BCGW).
@dkelsey over to you mate.
@dkelsey please investigate this ticket.
ENV
CAD
&CAT
This relates to #395
TESTCASE
EXPECTED
ACTUAL