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.
I have a view of commerce orders where the admin can limit by min and max dates. That view is using the export as csv display and I'm getting the following error during export.
Notice: Array to string conversion in views_data_export_plugin_style_export->generate_filename() (line 348 of /Users/jonathanhenson/Sites/NO1 Sites/NO1003 - Meadow Creature/sites/sites/all/modules/views_data_export/plugins/views_data_export_plugin_style_export.inc). Backtrace:
implode('--', Array) views_data_export_plugin_style_export.inc:348
I did a little digging and it looks like its due to the fact that the date range exposed filter is an array of arrays not strings. So I added a loop that flattens those first, then passes them along to get flattened again.
Comment | File | Size | Author |
---|---|---|---|
#1 | arraytostringerrorwithdates-2332489-1.patch | 1.36 KB | jlockhart |
Debug_and_views_data_export_plugin_style_export_inc.png | 201.88 KB | jlockhart | |
Order_Report_Export.png | 282.01 KB | jlockhart |
Comments
Comment #1
jlockhartComment #2
czigor CreditAttribution: czigor commentedPatch works for me, thanks!
Comment #3
sepehr.sadatifar CreditAttribution: sepehr.sadatifar commentedpatch works for me too.
the end result of '%exposed' token value is some thing like 'date_filter_09/01/2014--09/11/2014' which I think is what we expect.
tnx
Comment #4
sch2 CreditAttribution: sch2 commentedPatch worked for me, thanks alot.
Comment #5
mooru CreditAttribution: mooru commentedPatch didn't work for me. Still can't export files when i use exposed filters with date values
Comment #6
keopxPatch applied correctly.
Works for me.
Comment #7
plopescWorks for me too
Comment #8
joelpittetRTBC++
Comment #9
Steven Jones CreditAttribution: Steven Jones at ComputerMinds commentedFixed, thanks!
Comment #12
gabrielZ CreditAttribution: gabrielZ commentedThanks for sharing. Worked for me.