Updated code for this plugin to work with CKAN 2.2