CKAN version
2.9.5, probably others
Describe the bug
Updating an uploaded resource file through API does not update the resource's size field
Steps to reproduce
Steps to reproduce the behavior:
- Create a dataset and a file upload resource
- Observe the resource's
size field value
- Change the file through the UI
- Observe the resource's
size field value changes as it should
- Use the action API to upload a new file with
resource_patch (or resource_update, I assume)
- Observe the resource's
size field value stays the same
Expected behavior
The file size should reflect the uploaded file regardless of the method used to upload it
Additional details
I assume this is because the resource already has a size field when resource_update calls package_update, which assumes it is already set to the correct value. In resource_create the size is set, but resource_update just keeps the same value as before. Thus the new file size is not set.
CKAN version
2.9.5, probably others
Describe the bug
Updating an uploaded resource file through API does not update the resource's
sizefieldSteps to reproduce
Steps to reproduce the behavior:
sizefield valuesizefield value changes as it shouldresource_patch(orresource_update, I assume)sizefield value stays the sameExpected behavior
The file size should reflect the uploaded file regardless of the method used to upload it
Additional details
I assume this is because the resource already has a
sizefield whenresource_updatecallspackage_update, which assumes it is already set to the correct value. Inresource_createthe size is set, butresource_updatejust keeps the same value as before. Thus the new file size is not set.