Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Fields set as being excluded from display in the views interface are not set as headers but are printed in the data rows when exporting table views to either csv or doc files. We have not tested the issue with other output formats so cannot say that it does not occur there.
Comment | File | Size | Author |
---|---|---|---|
#5 | respect_export.patch | 558 bytes | andreiashu |
Comments
Comment #1
_paul_meta CreditAttribution: _paul_meta commentedFurther to this, as a useful feature for this module - it would perhaps be ideal if each field can be selectively used in the csv export.
For example: I have a list of nodes with specific cck fields being displayed in the view which i want to have exported in the csv file. For usability/workflow, i provide a node edit and node delete link as fields in the view also. I wish to have these visible in the page view, but not in the csv export. currently there is no way to do this.
Thanks for a great module!
Comment #2
asak CreditAttribution: asak commentedThis bug is a little bit more tricky, but it surly exists.
I have managed to get 1 view to output a CSV file, respecting excluded fields, and nicely outputting more complex custom php field and tokens as well - great stuff!
Now - i had many problems getting it to work, and i'm now struggling with another view which i can't figure out what's stopping it from working. I can't point my finger at a specific issue - and can't find any logic - but can't get it work... tried it all...
Comment #3
asak CreditAttribution: asak commentedI'm using the same fields settings for the page view and the feed view - the page displays correctly, the CSV (and views preview) are not correct.I think it's not that tricky after all - it simply doesn't work.
Comment #4
DarrellDuane CreditAttribution: DarrellDuane commentedsubscribing, I have this problem.
Comment #5
andreiashu CreditAttribution: andreiashu commentedHi,
This patch should fix the problem.
Cheers
Comment #6
neclimdulLooks like this is a follow up to #422438: Date fields terminate CSV export on some versions of PHP. Committed. Thanks.
Comment #8
DarrellDuane CreditAttribution: DarrellDuane commentedI am still having this problem. The reports Header shows up correctly (values are hidden) but I still see actual data showing up when it is supposed to be hidden. This means that my report ends up with an extra column (or more) and that the data is offset at the point where the hidden column is listed.
I'm using hidden columns 'cos I need the data for php. I will try to set up my view without a hidden column.
Comment #9
kruser CreditAttribution: kruser commentedsubscribe - I have this problem too.
Comment #10
adr75 CreditAttribution: adr75 commentedI am having this problem as well. Made a View based on 4 CCK text fields. First 3 fields are excluded from display, and the output of the 4th one is rewritten to generate the row output. Attaching a feed display to a Page works fine but all export options generate the Views content incorrectly. The export results appears to have duplication of the very first row and an incorrect rewrite of field 4.
Toggling the excluded fields back to visible renders correct output (including correctly rewritten fields).
Comment #11
adr75 CreditAttribution: adr75 commentedAlthough I would prefer the Bonus module to take care of this, a work-a-around would be:
-Don't use "Exclude from display" for fields.
-Only use "Rewrite the output of this field" to modify that particular field only and don't use other field replacement patterns
-Use the Semantic Views module to define the row style. Set the Row style as "Semantic Views : Fields". In "Row style options" remove any elements information, to combine all fields into a single text element.
Comment #12
erikjohansson CreditAttribution: erikjohansson commentedJust chiming in to say that I have the same issue with the CSV export option. The default view which is a table works fine, but the CSV doesn't. It's like the excluded fields of the first row gets cached and then reused for the same excluded fields in the rest of the rows.
Thing is, I didn't always have this problem, it just suddenly popped up after some fields were edited.
Comment #13
DarrellDuane CreditAttribution: DarrellDuane commentedI'm still seeing this problem, I've now upgraded to Views-6.x-3.x and it is still happening. Any ideas?
I attempted to fix it by changing
to
in views_bonus_export.module since
$fields[$id]->options['exclude']
was equal to 1 for excluded columns, but it didn't fix anything.Comment #14
neclimdul