Download & Extend

PHP warning when exposed filters contain non-scalar data.

Project:Views data export
Version:7.x-3.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Issue tags:Needs tests

Issue Summary

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).

AttachmentSizeStatusTest resultOperations
views-data-export-complex-filter-token-warning.patch1.05 KBIdlePASSED: [[SimpleTest]]: [MySQL] 78 pass(es).View details | Re-test

Comments

#1

i was seeing this in 6.x as well.

AttachmentSizeStatusTest resultOperations
views-data-export-complex-filter-token-warning-d6.patch1012 bytesIdleFAILED: [[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 details | Re-test

#2

Status:needs review» needs work

#3

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

#4

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

AttachmentSizeStatusTest resultOperations
views_data_export-complex-filter-token-warning-1298814-6870664.patch1.18 KBIdlePASSED: [[SimpleTest]]: [MySQL] 80 pass(es).View details | Re-test

#5

Works fine here indeed. Thanks.

#6

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.

nobody click here