Adapt the code to match a older ckan version