ckan / ckan

CKAN is an open-source DMS (data management system) for powering data hubs and data portals. CKAN makes it easy to publish, share and use data. It powers catalog.data.gov, open.canada.ca/data, data.humdata.org among many other sites.
https://ckan.org/
Other
4.43k stars 1.98k forks source link

Data API window shows the `datastore_search_sql` endpoint even when switched off #7289

Open amercader opened 1 year ago

amercader commented 1 year ago

CKAN version 2.9 / 2.10

Describe the bug The Data API window shows the datastore_search_sql endpoint even when switched off (which is the default)

Screenshot 2022-12-20 at 15-30-25 Test csv numeric - test csv - CKAN

The snippet should use config.get("ckan.datastore.sqlsearch.enabled") to show the row only when enabled.

Also looks like you need to click two times to open the window, probably a little bug in the js module. (Why do we need an AJAX call to get the content of the modal in the first place?)

svetozarstojkovicdatopian commented 1 year ago

@amercader PR #7382 for this issue is created. Please review and ping if necessary.

Upon investigating the code I had a discussion with older colleague and the reason is that this content is displayed in popup form and it is executing asynchronously.

amercader commented 1 year ago

@svetozarstojkovicdatopian thanks, I meant why we need to load the contents of the popup asynchronously and not render it directly in Jinja like the rest of the template.

svetozarstojkovicdatopian commented 1 year ago

@amercader I have been talking to some developers with more experience about this issue and what they are saying is that the popup is being rendered using Jinja but the ajax calls triggers that render.