Skip to content

Conversation

@godismyjudge95
Copy link
Contributor

This PR comes as result of a client who wanted to prefilter form submissions before exporting them. Since Statamic already has a very robust filtering system, all that was needed was to allow the filters to be parsed by the exporters.

It also reworks how the export is actually performed to be less memory intensive by using lazy loading on the query and writing to the file during the loop rather than at the end.

I will note it is not ideal the code from the two query() methods is duplicated from:
https://github.com/statamic/cms/blob/5.x/src/Query/Scopes/Filters/Concerns/QueriesFilters.php
and
https://github.com/statamic/cms/blob/5.x/src/Http/Controllers/CP/Forms/FormSubmissionsController.php#L15-L63

It may be better to extract that filtering/ordering code into somewhere more central like the SubmissionQueryBuilder or SubmissionRepository.

I also did not see any tests in regards to the exports; let me know if I should create some.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant