I'm trying to provide a filter for a view that is exposed to allow users to toggle between nodes with no five star rating and all nodes. I'm trying to figure out how to use the group filters to provide these options. I'm getting an error that I must set the value, but I see no way to enter anything there. Am I way off base in how I'm trying to use this or is this a bug or something else?

Only local images are allowed.

Files: 
CommentFileSizeAuthor
#37 views-erroneous_empty_not_empty_filter_error-1818176-37.patch941 bytesdeetergp
#20 views-1818176-12.patch1.52 KBgcb
PASSED: [[SimpleTest]]: [MySQL] 1,664 pass(es). View
#11 views-1818176-11.patch1.52 KBOnkelTem
PASSED: [[SimpleTest]]: [MySQL] 1,658 pass(es). View
#9 views-empty-filter-error-1818176-9.patch3.5 KBmikeker
PASSED: [[SimpleTest]]: [MySQL] 1,603 pass(es). View
#3 views-1818176-3.patch1.33 KBOnkelTem
PASSED: [[SimpleTest]]: [MySQL] 1,603 pass(es). View

Comments

gthing’s picture

The image isn't displaying for some reason, but it is here: http://i.imgur.com/33shb.png

OnkelTem’s picture

Same here. If you find solution please update the issue.

OnkelTem’s picture

Version: 7.x-3.5 » 7.x-3.x-dev
Category: support » bug
Status: Active » Needs review
FileSize
1.33 KB
PASSED: [[SimpleTest]]: [MySQL] 1,603 pass(es). View

@gthing

Please try this patch.

SpikeX’s picture

Had the same problem, the patch in #3 fixed the error. Thanks!

marcelæ’s picture

I can confirm this bug for the "is empty" and "is not empty" operators when making a grouped filter. Choosing another operator, then entering some value, then returning to the "is empty" or "is not empty" operator makes the error go away.

OnkelTem’s picture

@marcelæ, consider trying the patch :)

mikeker’s picture

Status: Needs review » Needs work

This patch does not fix the issue described in #5. The workaround for empty/not empty grouped filters is to enter a (bogus) value in the value field and submit the form.

Can those that found the patch in #3 fixed their issue, please give more details about their view settings? (Exporting the view is ideal).

dagmar’s picture

Here is the issue for 8.x #1785318: Grouped filter doesn't allow you to use fields without a value Is really easy to fix, maybe somebody can provide a similar patch here.

mikeker’s picture

Status: Needs work » Needs review
FileSize
3.5 KB
PASSED: [[SimpleTest]]: [MySQL] 1,603 pass(es). View

Thanks, dagmar.

I also added some code to correct the #dependency settings (prior code assumed #dependency only for value widgets with multiple fields such as in-between). So now the value textfield disappears in the UI when empty or not empty are selected.

-Mania-’s picture

Thanks, patch #3 worked nicely. I was simply trying to have a NULL/NOT NULL filter for a field.

OnkelTem’s picture

FileSize
1.52 KB
PASSED: [[SimpleTest]]: [MySQL] 1,658 pass(es). View

This is reworked version of the #3 patch using approach used in the #9 patch.

Difference from #3 patch:
* check amount of operator's values

Difference from #9 patch:
* making code easier to read
* not using suggested changes in dependencies. mikeker, please create a follow-up.

dawehner’s picture

Can't we reuse the tests from #1785318: Grouped filter doesn't allow you to use fields without a value here?

If you don't know tests, you should learn it :)

JordanMagnuson’s picture

#11 Works for me.

adamtong’s picture

when will #11 be committed?

thanks

fehin’s picture

My work around was to select an operator that uses a value like "greater than". Gave it value of 1, apply it, then edit it again and change it to "not empty" and it didn't throw the error and let me save it.

fehin’s picture

I take it back. It doesn't work properly even though it let me save it. My error log shows : Illegal choice in field_user_image_fid element. I will try the patch.

fehin’s picture

Status: Needs review » Reviewed & tested by the community

The patch in #11 worked for me too.

philipz’s picture

#11 works for me too so I guess this should really be commited.

dawehner’s picture

@OnkelTerm

I try to figure out why dropping #dependency from the patch is actually out of scope of this issue. This issue is about the wrong assumption that you always have a value.

gcb’s picture

Issue summary: View changes
FileSize
1.52 KB
PASSED: [[SimpleTest]]: [MySQL] 1,664 pass(es). View

Re-rolled #11 against 7.x-3.8.

kopeboy’s picture

Commit please??

PlayfulWolf’s picture

I have stumbled onto this also. Manually applied #20 to 3.8 and it works.
Please commit.

PlayfulWolf’s picture

Some strange bug: when changing filter identifier - the filter is not displayed. Can anybody confirm?

kopeboy’s picture

Priority: Normal » Major

Is common to have problems with the exposed filter disappearing when selecting "is empty" or "not empty", but I don't remember the fix sorry.
Anyway, I don't think it is related to this.

Please can we have a release? It's almost 1 year since it's reviewed and 2 years & half since bug issue was created.

ikeigenwijs’s picture

Version: 7.x-3.x-dev » 7.x-3.11

a commit would be nice.
Patch still valid for 3.11

jimmynash’s picture

Confirming patch in #20 worked for me on 7.x-.3.11

JJSON’s picture

Patch #20 works for me as well. Echoing what's already been said here but it would be great to see this committed.

mikeker’s picture

Version: 7.x-3.11 » 7.x-3.x-dev
Status: Reviewed & tested by the community » Needs work

No one has addressed the question by @dawehner in #19:

I try to figure out why dropping #dependency from the patch is actually out of scope of this issue. This issue is about the wrong assumption that you always have a value.

NWOM’s picture

I get the following error after manually applying #20:

Call to undefined method SearchApiViewsHandlerFilter::operators() in /var/aegir/platforms/panopoly-7.x-1.26/profiles/panopoly/modules/contrib/views/handlers/views_handler_filter.inc on line 620

Line 620 references the following line that was added by the patch:

$operators = $this->operators();

The error appears when I am trying to save an exposed group filter which filters an indexed field. Is it possible that it doesn't yet work on Search API Indexed Views?

braindrift’s picture

any work on this?

Chris Charlton’s picture

I got stung by this just last week.

prafull.addweb’s picture

Issue tags: +views
deetergp’s picture

I got stung by this this week as well. Patch #20 does address the issue, but I don't think it's right. In truth, the only operators that should not have a value associated with it are the EMPTY and NOT EMPTY. I'm proposing patch #33 to address that. Hopefully it will have the added bonus alleviating the Search API issues NWOM was having in comment #29.

deetergp’s picture

Status: Needs work » Needs review

Changing status to "Needs Review."

Status: Needs review » Needs work
deetergp’s picture

My apologies… I rolled that last patch from the wrong folder. Patch #36 should apply without issue.

deetergp’s picture

Well, this is embarrassing… #37 should really apply this time. Pinky swear!

Edit: I just tested building my profile with this patch and it applied. Apologies for creating any confusion.

mikeker’s picture

Status: Needs work » Needs review
sjpatrick’s picture

Status: Needs review » Reviewed & tested by the community

Tested and works as advertised.

BBC’s picture

#37 looks good to me

joelpittet’s picture

RTBC++ this still works. Thanks @deetergp

AlfTheCat’s picture

#37 works brilliantly. Thanks! Big UX problem solved :)

SKAUGHT’s picture

#37 any verify

commit please!

Chris Charlton’s picture

5 yeses for RTBC! :)