[ckan-changes] [okfn/ckan] a2b6f5: [#729] Handle languages in URLs when updating page...

GitHub noreply at github.com
Wed Oct 2 12:51:21 UTC 2013


  Branch: refs/heads/release-v1.8.1-ecportal
  Home:   https://github.com/okfn/ckan
  Commit: a2b6f5badc1f6f71616a310212d92e41b1ab428d
      https://github.com/okfn/ckan/commit/a2b6f5badc1f6f71616a310212d92e41b1ab428d
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-10-02 (Wed, 02 Oct 2013)

  Changed paths:
    M ckan/lib/cli.py

  Log Message:
  -----------
  [#729] Handle languages in URLs when updating page view tracking summary

Page view tracking was failing when a language was selected:

1. Put `ckan.tracking_enabled = true` in your ini file
2. Run CKAN, visit a page with a language e.g. `/en/dataset/annakarenina`
3. Run `paster tracking update`. If you look in your db, in the
   `tracking_summary` table there'll be a row with `package_id`
   `~~not~found~~`.
4. Run `paster tracking export tracking.csv`, the exported CSV file will
   say 0 views.

If you visit the page without the language in the URL e.g.
`/dataset/annakarenina` then run the export command again, the view does
get counted.

This commit fixes the SQL used by the `paster tracking update/export`
command to handle URLs with or without languages at the start.

Fixes #729





More information about the ckan-changes mailing list