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.
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.
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.
Comment | File | Size | Author |
---|---|---|---|
#8 | views_data_export_pager-2478463-7.patch | 545 bytes | acbramley |
| |||
#3 | views_data_export-pager_export_issue-2478463.patch | 513 bytes | TanvirAhmad |
#1 | user-export-data.png | 78.09 KB | TanvirAhmad |
#1 | user-export-page.png | 67.32 KB | TanvirAhmad |
user-export-page-view.png | 19.57 KB | TanvirAhmad |
Comments
Comment #1
TanvirAhmad CreditAttribution: TanvirAhmad commentedComment #2
TanvirAhmad CreditAttribution: TanvirAhmad commentedComment #3
TanvirAhmad CreditAttribution: TanvirAhmad commentedHere is quick fix. I am not sure it will pass or not. But for me, it is working.
Comment #4
TanvirAhmad CreditAttribution: TanvirAhmad commentedComment #5
Sutharsan CreditAttribution: Sutharsan as a volunteer commentedIt 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.
Comment #6
melonangie CreditAttribution: melonangie commentedI was expericieng timeouts, found this post helpful http://ist.mit.edu/node/1948
Comment #7
acbramley CreditAttribution: acbramley commentedThis is still an issue in the Drupal 8 version.
Comment #8
acbramley CreditAttribution: acbramley commentedComment #9
casperone CreditAttribution: casperone commentedHi 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!
Comment #10
jhedstromI 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.
Comment #11
knyshuk.vova CreditAttribution: knyshuk.vova at Internetdevels, Drupal Ukraine Community commentedReviewed and installed the patch.
Now the paging works correctly.
+1 to RTBC.
Comment #12
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedBefore 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:
Created a CR here https://www.drupal.org/node/3039082
Comment #14
jhedstromCommitted #8. Thanks all!
Comment #15
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedThanks! Published the CR.