Closed (duplicate)
Project:
Views Bonus Pack
Version:
5.x-1.x-dev
Component:
Views Export
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Sep 2007 at 19:31 UTC
Updated:
3 Jun 2008 at 17:04 UTC
Jump to comment: Most recent file
Comments
Comment #1
buddaI'd like to know how to make the export work with the exposed filters i've just set. I think it's probably just down to the CSV icon url?
Comment #2
buddaHere's the fix, it's an additional 1 line that needs to be added to the function
views_bonus_export_views_file_argument()Weirdly, the existing function had a variable defined for just the missing filter arguments, so my fix is to populate that missing variable.
$url_filter = str_replace(base_path() . views_get_url($view, array()) . '?', '', $_SERVER[REQUEST_URI]);I'm not 100% sure if $_SERVER[REQUEST_URI] works on IIS too? I couldn't see any other way of getting the exposed filters arguments in a usable way for building the URL easily.
The function in full for copy n paste testers:
Comment #3
buddaA small update, when no exposed filters have been clicked on (first page load) the CSV output breaks. Small change in the 1 liner to this:-
$url_filter = str_replace(base_path() . views_get_url($view, array()), '', $_SERVER[REQUEST_URI]);Small side effect is two ?? in the url as Drupal l() function adds one too.
Comment #4
robloachYou mind posting a patch?
Comment #5
dan3h commentedAnother small enhancement to this patch...
I used the line that budda suggested adding above, and cleaned it up a bit more, and identified one more (minor) bug regarding this patch that someone else can fix.
Patch is attached. Here is a brief explanation of what still needs fixing.
The idea is that if you are viewing
www.yoursite.com/yourview?exposed_filter_param1=foo
we want to get a link to a CSV like this:
www.yoursite.com/yourview_url/csv?exposed_filter_param1=foo
"$url_filter" will be everything after the question mark, and is basically just the query string.
In this context, it works fine.
But the trouble is, the same view, when you are editing it and setting it up, the view is also visible via
www.yoursite.com/admin/build/views/yourview_name?exposed_filter_param1=foo
The patch as it is gets a bit confused in that context, and the CSV button doesn't work. It shouldn't be hard to fix, but I am going to pass the torch to someone else, as I have no more time to spend on this. :-\
(I too needed to have a view with exposed filters, and wanted to be able to get a CSV export of the user-custom-filtered data, not just the filters as they were set up by the admin. So thanks for starting this patch, budda!)
Comment #6
tostinni commentedPatch works for me in normal page view and respect the exposed filters.
Comment #7
alpritt commentedComment #8
alpritt commentedI couldn't reproduce the issue in comment #5.
This patch takes the exposed filter data from the view object instead of the url.
Comment #9
heydere commentedI've tested the patch in #8 with both the CSV and the DOC exports. It works well for me, and I've implemented it on our site.
Comment #10
dmitrig01 commentedCommitted.
Comment #11
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #12
fossie commentedIt seems that the latest patch added, doesn't work on my installation; no exposed filter data available when submitting the csv-icon for export.
Patch, suggested in http://drupal.org/node/175116#comment-637341 works! (#5 above)
More information: http://drupal.org/node/264529
Someone else with the same problem?
TIA,
Fossie
Comment #13
alpritt commentedfix at http://drupal.org/node/265815
marking this one as duplicate since the other issue has the patch already attached.