I know that this module uses Views Data Exports to handle the CSV download feature, but I suspect that we are perhaps going beyond what that module expects is reasonable to handle.
I have an entityform type with 7000 submissions. This doesn't seem that huge to me -- on a D6 site with webform, I have a number of webforms with roughly the same number of submissions.
The problem though is that while 7k+ is a normal amount of submissions to expect for a web/entityform, 7k rows is far too much for Views to handle.
As a comparison, I just tried downloading the 7k submissions on my D6 webform site, and it gave me a 1.4MB file in just a few seconds.
We perhaps have to consider using something other for the CSV export which scales better.
Comments
Comment #1
tedbowI am all for using something else or having something else as an option.
But I think it would be better as entity type agnostic module. I could see other use case where you might need a export of other entity types to CSV file.
Do you still get the out of memory if you use the Batch option on Views Data Export?
Comment #2
joachim commentedHuh! I didn't know about the batched option on VDE!
I've enabled that and it's working fine (20MB file -- took a good 5-10 minutes to build).
Thanks for the super quick feedback!
Comment #3
ksemihin commentedHi all, I can propose an alternative way for export submissions to csv file.
This module in sandbox, but I think this module will be useful to you Entityform Submission export
Comment #4
tedbow@semihin_kirill, thanks for the link and an interesting module. I am sure many will find it useful if they don't want to deal with Views Data Export.
I think Views Data Export is working well in most cases.
Comment #5
imclean commentedThis may not be joachim's original problem but there is still a problem with batching. The symptoms include slow batching, out of memory errors and duplicate fields in output when using views_data_export and the autofields function.
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.
A quick and dirty method to get around this is to surround
$view->add_item()with an if statement:A nicer approach might be better integration with Drupal's batching system.
Comment #6
joachim commented> A nicer approach might be better integration with Drupal's batching system.
Can you explain more about what you mean by that?
> The problem occurs because entityform_views_pre_view() is executed each batch segment rather than once per export.
I'm not familiar with the code, but this sounds like the correct approach to me. Items to be worked on should be retrieved inside each iteration of callback_batch_process(). I've often seen the mistaken approach of getting the complete list of items and passing that as a massive array parameter to callback_batch_process() in the batch_set() call.
Comment #7
tedbowIf you see in the 7.x-2.dev version I have added a hook so that others modules can change the fields that will be auto added. I also but some settings in the display object to flag that "autofields" were added via Entityform: http://cgit.drupalcode.org/entityform/tree/entityform.module?h=7.x-2.x&i...
I haven't tested the batch yet but if this is being re-run every time then I could potentially just check for this flag in entityform_views_pre_view
@imclean I have also thought about adding your "quick and dirty" code but for another reason. In the "autofields" logic I added all the fields for the view mode. But if they View they are using already has a particular field it would be added twice. I could see a case where you want most fields auto added but want to add 1 or 2 field your self because you want a specific setting in the field in Views(like re-write).
Comment #8
tedbowRe-closing this issue and created another issue to handle duplicate fields #2340989: Fields added multiple times when using Views Data Export batch mode
There is a patch there that needs review.
Comment #9
imclean commentedThe view doesn't need updating each iteration, it appears to be cached. This has taken me a little while to track down and I haven't really thought about the specifics of making entityform "batch aware".
The view can be retrieved each iteration but the extra fields don't need to be added each time.
Looking at views_data_export.module it does appear to cache the view in the table "views_data_export_object_cache". This would make sense as it shouldn't need to generate the view each iteration.
This could be a good approach. I'll review the new issue.