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

Extension does not respect custom uploader implementations #16

Open
amercader opened this issue Dec 17, 2015 · 5 comments
Open

Extension does not respect custom uploader implementations #16

amercader opened this issue Dec 17, 2015 · 5 comments

Comments

@amercader
Copy link
Member

ckanext--s3filestore implements a custom uploader and downloader, overriding the core download endpoint. ckanext-googleanalytics does the same, to register the download and calls the core download action from the package controller afterwards.

So if you load the googleanalytics before the s3filestore one, your downloads return 404, because the core filesystem filestore is being called:

ckan.plugins = ... googleanalytics s3filestore        # Does not work

Loading googleanalytics last works:

ckan.plugins = ... s3filestore googleanalytics        # Works
@amercader
Copy link
Member Author

cc @brew in case you ever bump into this

gleb-rudenko pushed a commit to gleb-rudenko/ckanext-googleanalytics that referenced this issue Feb 13, 2017
gleb-rudenko pushed a commit to gleb-rudenko/ckanext-googleanalytics that referenced this issue Feb 14, 2017
@gleb-rudenko
Copy link

So what I did here is basically getting route's controller and overriding it's method by wrapping it into decorator.
Previous behavior was - just to run default resource_download from PackageController in all of our cases. So by reordering our extensions (custom uploader or GA) in the .ini file one of them will not work.

@smotornyuk
Copy link
Member

#28 merged into master.

@ctrepka
Copy link

ctrepka commented Jul 6, 2022

Is there any more recent activity on this? Not sure if its something on my end or not, but downloads to s3filestore are not working properly on my instance with CKAN 2.9.5 and s3filestore and googleanalytics extensions. I've tried flipping the order of the plugins and the downloads return an error both times. Uninstalling ckanext-googleanalytics resolves the issue.

@smotornyuk
Copy link
Member

I think, there was a config option, which should handle the problem.
so, you have to:

  1. Put googleanalytics before s3filestore in the plugins list. i.e:
    ckan.plugins = ... googleanalytics s3filestore ...
    
  2. Add a new config option which tells ga-plugin, which "custom" implementation to use:
    googleanalytics.download_handler = ckanext.s3filestore.views:resource_download
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants