dkan
dkan copied to clipboard
Dereferenced json data is saved to the database when a dataset is being published
Problem:
When a dataset is being loaded from the database its JSON metadata is getting dereferenced - https://github.com/GetDKAN/dkan/blob/af8efcf22aa1814f1b91828335ce2d102d82ec46/modules/metastore/src/LifeCycle/Data.php#L64 and the new value is assigned to the field_json_metadata
field. When saving this dataset (that is what the publish method does), this dereferenced data gets stored in the field_json_metadata
field in the database which is wrong.
Proposed solution: We need to decouple the metadata storage and store referenced and dereferenced data separately. We need to return dereferenced data for the API calls but we need to make sure we store only referenced data in the database.
AC:
- the data stored in the
field_json_metadata
field after the dataset is published is referenced