[ckan-changes] [ckan/ckan] f2bb08: Add quotes to package ID and name in Solr queries ...

GitHub noreply at github.com
Fri Aug 1 15:54:59 UTC 2014


  Branch: refs/heads/release-v2.1.3
  Home:   https://github.com/ckan/ckan
  Commit: f2bb082350e62b30251058ea0f0769254ee22acd
      https://github.com/ckan/ckan/commit/f2bb082350e62b30251058ea0f0769254ee22acd
  Author: Mikko Koho <mikko.koho at csc.fi>
  Date:   2014-08-01 (Fri, 01 Aug 2014)

  Changed paths:
    M ckan/lib/search/query.py
    M ckan/logic/action/update.py

  Log Message:
  -----------
  Add quotes to package ID and name in Solr queries to prevent Solr errors with custom dataset identifiers.


  Commit: 579342339b05da69db0337ec41c2ad9e3e54d1ec
      https://github.com/ckan/ckan/commit/579342339b05da69db0337ec41c2ad9e3e54d1ec
  Author: Vitor Baptista <vitor at vitorbaptista.com>
  Date:   2014-08-01 (Fri, 01 Aug 2014)

  Changed paths:
    M ckanext/datastore/db.py
    M ckanext/datastore/tests/test_upsert.py

  Log Message:
  -----------
  [#1776] Fix bug when upserting [] on JSON column in the datastore

We were testing that the new value wasn't `None` using `if value`. As `[]` is a
falsy value, we never went through that `if` and ended up trying to run an
invalid SQL query.

This commit fixes that by explictly testing `if value is not None`.

This was first discovered in
http://stackoverflow.com/questions/24207065/inserting-empty-arrays-in-json-type-fields-in-datastore


Compare: https://github.com/ckan/ckan/compare/144251a6af9f...579342339b05


More information about the ckan-changes mailing list