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.
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