Fix datatables download feature (2.9) #7147
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Affected Versions
2.9 (already fixed in 2.10 with the new
datatablesview
design)When downloading data from the
datatablesview
plugin the hidden form is never refreshed after downloading. This causes a buggy behavior in which if the user downloads a CSV file, and then tries to download in another format, it will keep downloading CSV files.Proposed fixes
Since
datatablesview
has a major upgrade in CKAN 2.10, this patch takes the fixed applied in therun_query
function and back ports it. It basically removes the input HTML element we are creating to set the format of the download. This causes the form to be reset to the orginal state after downloading.ckan/ckanext/datatablesview/public/datatablesview.js
Lines 23 to 34 in 572607a