Skip to content

Conversation

@JVickery-TBS
Copy link

This is a solution to the Resource URLs in open-data/ckanext-language-domains#1

Basically the absolute URI of a resource is not stored in the database, but the res_url is stored in SOLR with a fully qualified URI for upload types. Instead, we modify code here to not store qualified URIs in SOLR and just add the requesting hostname to upload resource types for their download URI. And just add a for_index context when indexing packages/resources so that SOLR will always have the relative paths.

I imagine this would kind of break other frameworkable parts of CKAN resource uploader...maybe. So not fitting for upstream contrib.

- Do not store qualified internal resource urls in SOLR records.
- Do not store qualified internal resource urls in SOLR records.
- Added change log file.
@JVickery-TBS
Copy link
Author

Oh also just a note about for_index context - I did this instead of using for_view or a new for_api because I was unable to handle it that way in ckanapi LocalCKAN

Copy link
Member

@wardi wardi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's reasonable to have something like this in core: always store uploaded files with relative paths. I'd be a little happier if it didn't rely on a context variable sent to package_show.

Note that this will break when we upgrade because the SynchronousSearchPlugin goes away.

@JVickery-TBS JVickery-TBS merged commit a4b7d64 into canada-v2.10 Oct 6, 2025
1 check passed
@JVickery-TBS JVickery-TBS deleted the feature/language-domain-res-urls branch October 6, 2025 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants