I am using View Data Export to export users in csv. I am using a page view. Fields, User Name, Email. Same fields in Data Export display type and filters.
In Data Export display, using Parent Sort Checked.

On Page Display I am showing 5 users, with full pager. On Data Export Display I am using 5 as well.

Page Setting

Data Setting

When I change page i-e goto next page(page 2) on /export-user, CSV Icon cant export users other than first 5, no matter on which page I am.

Pager
So the csv Icon shows the same link on each page.

Any idea if I am missing something.

I guess we need here 'Parent Filters' option as well.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TanvirAhmad’s picture

Issue summary: View changes
FileSize
67.32 KB
78.09 KB
TanvirAhmad’s picture

Issue summary: View changes
TanvirAhmad’s picture

Here is quick fix. I am not sure it will pass or not. But for me, it is working.

TanvirAhmad’s picture

Status: Active » Needs review
Sutharsan’s picture

It looks to me that the Data export View does exactly what it is configured for. Under 'Pager' it says to show exactly 5 items, no pager, but a fixed number. So it will download only 5 items. I guess a 'Parent filter' will follow the (exposed) filter settings of the page the download link is on, but a pager is not a (exposed) filter. In my practice I allow full downloads, and do not limit the number of downloaded records. Limiting the number shown on a page however is useful (as you are doing). For example for the user to check if the data is the expected data. Mostly in combination with one or more exposed filters. But no limit to the number of exported/downloaded records.

melonangie’s picture

I was expericieng timeouts, found this post helpful http://ist.mit.edu/node/1948

acbramley’s picture

Version: 7.x-3.0-beta8 » 8.x-1.x-dev
Priority: Critical » Normal
Issue tags: +Needs tests

This is still an issue in the Drupal 8 version.

acbramley’s picture

casperone’s picture

Hi all,

This is a great patch and my organization is eager to see it implemented into production. I applied the patch, i'm not an expert with Drupal or writing modules, so i'm sure your testing is much more thorough. It seems to have worked great though.

I wish we could put the patch into production, we must wait until the patch has been included and release with a module update.

Great Job!

jhedstrom’s picture

Status: Needs review » Needs work
Issue tags: +Needs change record

I wonder if this will break some existing sites? Most of the time a pager is used for viewing on the web, while folks would expect an export to grab all results? That could presumably be fixed by removing the pager from the views data export display, but I guess at the very least we'd want to publish a change notice.

Tests would be great too.

knyshuk.vova’s picture

Reviewed and installed the patch.
Now the paging works correctly.
+1 to RTBC.

Manuel Garcia’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs change record

Before the current pagination on the page is ignored, and the data exported was always whatever you had configured on the data export display pager configuration. This is fine if you have there set to display all items and the user would always get the full results.

However there are times where users will just want to download the current set they are looking at, and in this case, this patch does allow for that to happen. Otherwise it is impossible, setting a pager on the data export display will just get you always just the first page.

Regarding the Needs tests tag: It would be nice, but I think currently to add coverage for this would mean spending quite a bit of time to assert the results being exported. I think we should first create a base test class to make these kinds of tests possible.

I've tested this manually and it works as expected:

  • Current page gets passed to the the button url and the exported results reflect that.
  • If the data export display has pager configured to display all results, the user gets all results exported.

Created a CR here https://www.drupal.org/node/3039082

  • jhedstrom committed 1deb5a0 on 8.x-1.x authored by acbramley
    Issue #2478463 by TanvirAhmad, acbramley, Manuel Garcia: Unable to...
jhedstrom’s picture

Status: Reviewed & tested by the community » Fixed

Committed #8. Thanks all!

Manuel Garcia’s picture

Thanks! Published the CR.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.