ckan / ckanext-dcat

CKAN ♥ DCAT
https://docs.ckan.org/projects/ckanext-dcat
165 stars 145 forks source link

Update function to get catalog URI #187

Open huynguyen-95 opened 3 years ago

huynguyen-95 commented 3 years ago

Dear dcat project, I'm working with CKAN and using DCAT extension. The problem here is happened when CKAN is deployed as non-root (e.g.: http://myhost.com/ckan)

The URI for getting the relevant entities is generated based on ckanext.dcat.base_uri or ckan.site_url. I did not use the first option ckanext.dcat.base_uri because I want to centralize everything based on ckan.site_url but DCAT plugin generate the wrong URI (e.g.: http://myhost.com) because my CKAN is deployed as non-root

And I checked code, in ultils.py, we should add ckan.root_path at line 162 https://github.com/ckan/ckanext-dcat/blob/6b7ec505f303fb18e0eebcebf67130d36b3dca82/ckanext/dcat/utils.py#L162

It should be:

uri = config.get('ckan.site_url') + config.get('ckan.root_path')

About ckan.root_path, you could check here: ckan.root_path

Thanks, Huy