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

DataStore API strips site name from resource URL #3189

Closed
creg-ny-baa opened this issue Aug 5, 2016 · 2 comments

Comments

Projects
None yet
4 participants
@creg-ny-baa
Copy link

commented Aug 5, 2016

On CKAN version 2.5.2 installed from package:

When creating a DataStore resource via API, the URL of the resource does not start with the site name as given in the config. (Example below.) This results in the "Download resource" button not being available. (It gets tucked away in a div named "data-viewer-error js-hide".) Note that I do not use the DataPusher extension.

Here is a clip of the JSON dictionary passed to the datastore_create API:

{
    "resource":{
        "package_id":"qalert-historical-requests", 
        "name":"QAlert Requests for 2013"
        },
    "force": true,
    "fields": [
        {"id": "id", "type": "int"},
        {"id": "status", "type": "int"},
        {"id": "createDate", "type": "timestamp"},
        ...
        ],
    "primary_key":"id"
}

Here is the result from the API call to resource_show:

{
  "help": "http://10.10.1.97/api/3/action/help_show?name=resource_show",
  "success": true,
  "result": {
    "cache_last_updated": null,
    "package_id": "a160881f-77e5-4de0-bcc1-2e8c76eaec48",
    "webstore_last_updated": null,
    "datastore_active": true,
    "id": "df0772e9-032b-4a12-bda4-92ec1ba5b806",
    "size": null,
    "state": "active",
    "hash": "",
    "description": "",
    "format": "",
    "last_modified": null,
    "url_type": "datastore",
    "mimetype": null,
    "cache_url": null,
    "name": "QAlert Requests for 2014",
    "created": "2016-08-03T07:54:44.576971",
    "url": "/datastore/dump/df0772e9-032b-4a12-bda4-92ec1ba5b806",
    "webstore_url": null,
    "mimetype_inner": null,
    "position": 1,
    "revision_id": "ad74b8ea-7d98-465d-9444-e0158d24acf7",
    "resource_type": null
  }
}

You can see that the "url" value is missing the site name. I think we can rule out a config issue because the issue does not show up on uploaded data, or anywhere else for that matter.

@amercader amercader self-assigned this Aug 9, 2016

@amercader

This comment has been minimized.

Copy link
Member

commented Nov 17, 2016

@smotornyuk this one should be easy to track as well

smotornyuk added a commit to smotornyuk/ckan that referenced this issue Nov 29, 2016

\ckan#3189 Datastore doesn't add site_url to resource created via API
Small change in datastore plugin, that generates
fully-qualified url during datastore creation

amercader added a commit that referenced this issue Nov 29, 2016

Merge pull request #3338 from smotornyuk/3189-datastore-api-strips-si…
…te-name-from-resource

#3189 Datastore doesn't add site_url to resource created via API

amercader added a commit that referenced this issue Feb 14, 2017

\#3189 Datastore doesn't add site_url to resource created via API
Small change in datastore plugin, that generates
fully-qualified url during datastore creation

amercader added a commit that referenced this issue Feb 14, 2017

\#3189 Datastore doesn't add site_url to resource created via API
Small change in datastore plugin, that generates
fully-qualified url during datastore creation

amercader added a commit that referenced this issue Feb 14, 2017

\#3189 Datastore doesn't add site_url to resource created via API
Small change in datastore plugin, that generates
fully-qualified url during datastore creation
@davidread

This comment has been minimized.

Copy link
Contributor

commented Apr 4, 2017

According to the changelog, @smotornyuk 's fix went out in ckan patch releases in February: v2.6.1, v2.5.4, v2.4.5.

@davidread davidread closed this Apr 4, 2017

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.