CKAN version
2.12
Describe the bug
The after_resource_update plugin hook receives an updated resource that is not yet committed, so if it attempts to use resource_show, or if it calls any other APIs that do so, then the result is the old version of the resource.
Steps to reproduce
- Create a plugin that implements IResourceController with an
after_resource_update
- Within
after_resource_update, call resource_show, passing the ID from the data_dict parameter.
- Result is the pre-update resource.
Expected behavior
Calling resource_show should result in the current version of the resource, which at the point of the after update hook, should be the updated version.
Additional details
ckanext-validation encountered errors because of this. I'm currently rewriting it to pass the full resource dict to an API via the context, which is obviously undesirable.
CKAN version
2.12
Describe the bug
The
after_resource_updateplugin hook receives an updated resource that is not yet committed, so if it attempts to useresource_show, or if it calls any other APIs that do so, then the result is the old version of the resource.Steps to reproduce
after_resource_updateafter_resource_update, callresource_show, passing the ID from thedata_dictparameter.Expected behavior
Calling
resource_showshould result in the current version of the resource, which at the point of the after update hook, should be the updated version.Additional details
ckanext-validation encountered errors because of this. I'm currently rewriting it to pass the full resource dict to an API via the context, which is obviously undesirable.