Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Data API" button disappears on resource page after empty update #3012

Closed
NicolaiMogensen opened this issue May 11, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@NicolaiMogensen
Copy link

commented May 11, 2016

ckan_version: 2.5.2

Please describe the expected behaviour

When updating a resource without changing any fields, url or description, the green "Data API" button should still be there, because the data is still in the datastore (And API calls of this type confirms that it still is). Not sure if it is expected of the datapusher to trigger its update or not.

Please describe the actual behaviour

The green "Data API" button disappears, as if data is now removed from the datastore for the particular resource. It would seem like CKAN thinks this triggers the datapusher hook, even though it does not (logs confirm it nothing happens).

What steps can be taken to reproduce the issue?

Push .CSV file to the datastore using the web interface, then update the resource using either the resource_update API call or the web interface, without changing anything.

I'm curious to see if i'm the only one with this issue, i can reproduce over several CKAN installations running 2.5.2. If i need to post this in the datapusher github issue tracker instead, close this and i will post it there instead.

@amercader

This comment has been minimized.

Copy link
Member

commented May 13, 2016

@NicolaiMogensen this is indeed a bug.

The "Data API" button relies on the datastore_active resource extra being present and True. When editing via the frontend (or the API) this field is not passed and so it's dropped from the db. We need to persist the value when updating if the resource already has it and it's not provided.

PR incoming

amercader added a commit that referenced this issue May 13, 2016

[#3012] Persist datastore_active on resource updates
As datastore_active is stored as an extra, if it's not provided in the
incoming data_dict on resource_update it will get dropped. This happens
most noticeably when udpating via the frontend, causing the green Data
API button to disappear.
@amercader

This comment has been minimized.

Copy link
Member

commented May 13, 2016

Fix in #3020

@NicolaiMogensen

This comment has been minimized.

Copy link
Author

commented May 13, 2016

@amercader That was fast! Thanks for correcting this, as it broke the buttons on all resources when doing resource_update through some automated jobs.

@wardi wardi closed this in #3020 May 17, 2016

wardi added a commit that referenced this issue May 17, 2016

Merge pull request #3020 from ckan/3012-fix-datastore_active-getting-…
…lost

[#3012] Persist datastore_active on resource updates

k-nut pushed a commit to k-nut/ckan that referenced this issue May 18, 2016

[ckan#3012] Persist datastore_active on resource updates
As datastore_active is stored as an extra, if it's not provided in the
incoming data_dict on resource_update it will get dropped. This happens
most noticeably when udpating via the frontend, causing the green Data
API button to disappear.

amercader added a commit that referenced this issue Aug 26, 2016

[#3012] Persist datastore_active on resource updates
As datastore_active is stored as an extra, if it's not provided in the
incoming data_dict on resource_update it will get dropped. This happens
most noticeably when udpating via the frontend, causing the green Data
API button to disappear.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.