Hi, I'm not sure if anybody agrees this is a bug.
Anyway, according to me, when we filter the report by using an "is empty" filter type (ftype: 7) we don't get the correct results when private fields are used are used inside the webform.

I've a case of a webform with a private field "Approve request" which is not shown to users filling the webform and therefore the value of this component is not saved in the database.

Function _webform_report_test_filters(...) in webform_report.inc checks whether the cid is in data.
In case not (data does not exist) it is not filtered except when filter type is 0.
I would amend this by changing code at line 1125 like this:

// data does not exist and not filtered
else {
if ($filter['ftype'] == 0 || // None
$filter['ftype'] == 7) { // Is empty
// pass it
$ok = TRUE;
}
}

If you agree on this I would kindly ask the maintainer of this nice module to patch the code as shown above.
Let me know what you think about it.

Best regards

Comments

TBarina’s picture

Issue summary: View changes
Vako’s picture

Thank you. I hope your code will be accepted and implemented in the next release.

jimbullington’s picture

Status: Active » Postponed (maintainer needs more info)

I'm not sure I know what you mean by private field.

TBarina’s picture

Hi, sorry for the delay in answering you.

By private field I mean a webform component flagged as Private in it's Display settings (i.e.: shown only to users with Results Access).

Thanks in advance

Bye

TBarina’s picture

Status: Postponed (maintainer needs more info) » Active