GetDKAN / dkan

DKAN Open Data Portal
https://dkan.readthedocs.io/en/latest/index.html
GNU General Public License v2.0
374 stars 172 forks source link

PATCH API calls to modify datasets ignores published state #4337

Open paul-m opened 2 weeks ago

paul-m commented 2 weeks ago

Ref: 21731

Current Behavior

Sending a PATCH to a dataset, even if it doesn't trigger a reimport, will cause the data node to ignore the workflow state, and become published.

In specific, patching a 'Published (hidden)' dataset causes it to become 'Published.'

This is bad because changing the publish state back to hidden triggers a datastore reimport.

Expected Behavior

PATCH API calls should not modify existing published status.

Steps To Reproduce

In a dev environment, create a dataset. Set the dataset to be published (hidden). PATCH the dataset through the API. Note that the workflow status is Published, and not hidden.

Relevant log output (optional)

No response

Anything else?

This happens here: https://github.com/GetDKAN/dkan/blob/2.x/modules/metastore/src/Storage/Data.php#L360