From original issue #2173371: out of memory on large CSV exports of submissions
The problem occurs because entityform_views_pre_view() is executed each batch segment rather than once per export.
_entityform_view_add_all_fields() is then fired off for each batch and adds the fields without checking if they're already present.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | entityform-autofield_duplicates-2340989-6.patch | 3.64 KB | tedbow |
| #1 | entityform-autofield_duplicates-2340989-1.patch | 573 bytes | tedbow |
Comments
Comment #1
tedbowHere is patch that checks if fields have already been added.
Comment #2
tedbowComment #6
tedbowComment #7
imclean commentedThanks tedbow, patch applies cleanly and works well. I've successfully exported 500+ submissions with around 120 fields each in a minute with no duplicates.
Just a note that the first problem was the PHP process running out of memory.
This was circumvented by using paging (offset + specified number of items) and smaller segment sizes of 1 to 3. Only then were we able export the CSV and see the duplicate fields.
Comment #9
tedbow@imclean thanks for your help on this. Committed.