ckan / ckanext-googleanalytics

CKAN extension to integrate Google Analytics data into CKAN. Gives download stats on package pages, list of most popular packages, etc.
GNU Affero General Public License v3.0
35 stars 81 forks source link

Does not work with CKAN 1.8 #1

Closed anibalpacheco closed 11 years ago

anibalpacheco commented 12 years ago

Plugin module was installed correctly, but then following the instructions the first error is:

Command 'initdb' not known (you may need to run setup.py egg_info)

rossjones commented 11 years ago

Have you tried to run the following from the ckanext-googleanalytics folder?

python setup.py install

anibalpacheco commented 11 years ago

No I didn't. Now I run it and it works, but I don't know how to generate token.dat, any help?

rossjones commented 11 years ago

The readme has a new section labelled authorization with instructions. This is needed because google killed v2 of their api. On Oct 18, 2012 8:12 PM, "Aníbal Pacheco" notifications@github.com wrote:

No I didn't. Now I run it and it works, but I don't know how to generate token.dat, any help?

— Reply to this email directly or view it on GitHubhttps://github.com/okfn/ckanext-googleanalytics/issues/1#issuecomment-9578402.

anibalpacheco commented 11 years ago

Just pulled last CKAN v1.8 and last plugin code but:

Traceback (most recent call last):
  File "/usr/local/ckan/pyenv/bin/paster", line 8, in 
    load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')()
  File "/usr/local/ckan/pyenv/lib/python2.6/site-packages/paste/script/command.py", line 104, in run
    invoke(command, command_name, options, args[1:])
  File "/usr/local/ckan/pyenv/lib/python2.6/site-packages/paste/script/command.py", line 143, in invoke
    exit_code = runner.run(args)
  File "/usr/local/ckan/pyenv/lib/python2.6/site-packages/paste/script/command.py", line 238, in run
    result = self.command()
  File "/usr/local/ckan/pyenv/lib/python2.6/site-packages/ckanext_googleanalytics-0.1-py2.6.egg/ckanext/googleanalytics/commands.py", line 56, in command
    self._load_config()
  File "/usr/local/ckan/pyenv/src/ckan/ckan/lib/cli.py", line 82, in _load_config
    load_environment(conf.global_conf, conf.local_conf)
  File "/usr/local/ckan/pyenv/src/ckan/ckan/config/environment.py", line 314, in load_environment
    plugin.configure(config)
  File "/usr/local/ckan/pyenv/lib/python2.6/site-packages/ckanext_googleanalytics-0.1-py2.6.egg/ckanext/googleanalytics/plugin.py", line 55, in configure
    p.toolkit.add_resource('fanstatic_library', 'ckanext-googleanalytics')
  File "/usr/local/ckan/pyenv/src/ckan/ckan/plugins/toolkit.py", line 191, in __getattr__
    raise Exception('`%s` not found in plugins toolkit' % name)
Exception: `add_resource` not found in plugins toolkit
rossjones commented 11 years ago

You need a special config option for pre-2.0 versions of CKAN

To use ckanext-googleanalytics with CKAN 1.x, make sure you have ckan.legacy_templates = true in your CKAN ini file.

anibalpacheco commented 11 years ago

That setting was active, please, understand the situation: I can't even activate the plugin because of this error

rossjones commented 11 years ago

Understood.

Appears that this was in the commit 70dc8c78d42c8fb954b2a29bb1391988e6f31a02 @seanh any chance we could fix that commit as it breaks for non 2.0 users?

rossjones commented 11 years ago

I've committed a fix at 13a57cd which works for me on version 1.7.1, if you want to try again?

anibalpacheco commented 11 years ago

Thanks! it works! (I've to add legacy_templates path to my extra_template_paths setting)