When using Views Data Export with non-scalar exposed filters (for example, a date field with between operator or a taxonomy select box), a warning is generated during export. The warning occurs even when not using the %exposed-token in a filename, and when using the token, the actual data for those complex filters is missing.

Warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain() (line 1521 of /home/ivangeer/workspace/zebweb/includes/bootstrap.inc).

Attached is a patch that attempts to resolve this by flattening arrays (seems that this is the only other type besides scalar data).

Files: 
CommentFileSizeAuthor
#4 views_data_export-complex-filter-token-warning-1298814-6870664.patch1.18 KBintervalle
PASSED: [[SimpleTest]]: [MySQL] 80 pass(es).
[ View ]
#1 views-data-export-complex-filter-token-warning-d6.patch1012 bytesbrad.bulger
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch views-data-export-complex-filter-token-warning-d6.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
views-data-export-complex-filter-token-warning.patch1.05 KBmr.baileys
PASSED: [[SimpleTest]]: [MySQL] 78 pass(es).
[ View ]

Comments

brad.bulger’s picture

StatusFileSize
new1012 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch views-data-export-complex-filter-token-warning-d6.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

i was seeing this in 6.x as well.

Steven Jones’s picture

Status:Needs review» Needs work
Issue tags:+Needs tests
intervalle’s picture

The patch "views-data-export-complex-filter-token-warning.patch" doesn't work for me for a "between" (min/max) date exposed-filter

intervalle’s picture

StatusFileSize
new1.18 KB
PASSED: [[SimpleTest]]: [MySQL] 80 pass(es).
[ View ]

Here's the patch with the modification which works for me with the between-date-exposed-filter

gabrielmachadosantos’s picture

Works fine here indeed. Thanks.

Foo’s picture

Status:Needs work» Needs review

Patch in #4 worked for an exposed filter, which was an multi-select entity reference. It's definitely an issue with the non-scalar (multiselect, range, etc.) exposed variable.

Steven Jones’s picture

Status:Needs review» Closed (duplicate)