I am trying to use this module with a large views dataset in Drupal 6. However, I noticed that the query was never paginating correctly which would cause the query to timeout and and error would occur. I traced the cause of this to a relatively easy fix. I notice that in order to paginate correctly it checks to see if the weight_field_alias is set in the query method. However, this never gets set if the query is not defined within initialize_index. What was causing the query to not get set was because in the latest version of Views, the query is not set within build_info but rather within the actual query object.

So, you need to change all references to $this->view->build_info['query'] to this $this->view->query->query and now it works.

Patch to follow.

CommentFileSizeAuthor
#1 fix-query-build-info-2037441-2-D6.patch1.11 KBtravist

Comments

travist’s picture

StatusFileSize
new1.11 KB

Here is the patch.

travist’s picture

Status: Active » Needs review
dbassendine’s picture

+1 - I encountered the same issue in Views 3.0, 6.x-2.0-beta6. Large CSV exports failed on 0% with "Export has encountered an error", but the problem didn't occur when the number of view results was restricted to a small number.

Applying this patch solved the issue, with the batch export running through batches correctly again. However, I haven't tested this with Views 2.x

Thanks for the patch!

Azol’s picture

Tested with Views 3.x and it solved the problem!
Also, it also seems to solve another issue - #1440186: Feed display produces entirely different content than the default display

d.olaresko’s picture

Issue summary: View changes

Works for me too. thank you

damienmckenna’s picture

Status: Needs review » Reviewed & tested by the community

I guess it's RTBC then.

damienmckenna’s picture

BTW might it be better to do isset() around it, rather than just assume $view->query->query exists and is not equal to NULL, or even !empty(view->query->query)?

greggadsdon’s picture

Status: Reviewed & tested by the community » Closed (won't fix)

As Drupal 6 nears the end of its life and support period, the 6.x version of Views Data Export will not be supported either. To that end, this issue has been closed, and will not be resolved in the 6.x branch of Views Data Export.

If this issue is still relevant to 7.x branch of Views Data Export, then please re-open and move to a relevant 7.x version.