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?
![]()
| Comment | File | Size | Author |
|---|---|---|---|
| #58 | views-erroneous_empty_not_empty_filter_error-1818176-58.patch | 1.31 KB | xlin |
Comments
Comment #1
gthing commentedThe image isn't displaying for some reason, but it is here: http://i.imgur.com/33shb.png
Comment #2
OnkelTem commentedSame here. If you find solution please update the issue.
Comment #3
OnkelTem commented@gthing
Please try this patch.
Comment #4
SpikeX commentedHad the same problem, the patch in #3 fixed the error. Thanks!
Comment #5
marcelæ commentedI 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.
Comment #6
OnkelTem commented@marcelæ, consider trying the patch :)
Comment #7
mikeker commentedThis 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).
Comment #8
dagmarHere 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.
Comment #9
mikeker commentedThanks, 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.
Comment #10
-Mania- commentedThanks, patch #3 worked nicely. I was simply trying to have a NULL/NOT NULL filter for a field.
Comment #11
OnkelTem commentedThis 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.
Comment #12
dawehnerCan'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 :)
Comment #13
jordanmagnuson commented#11 Works for me.
Comment #14
adamtong commentedwhen will #11 be committed?
thanks
Comment #15
fehin commentedMy 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.
Comment #16
fehin commentedI 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.Comment #17
fehin commentedThe patch in #11 worked for me too.
Comment #18
philipz commented#11 works for me too so I guess this should really be commited.
Comment #19
dawehner@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.
Comment #20
gcbRe-rolled #11 against 7.x-3.8.
Comment #21
kopeboyCommit please??
Comment #22
playfulwolf commentedI have stumbled onto this also. Manually applied #20 to 3.8 and it works.
Please commit.
Comment #23
playfulwolf commentedSome strange bug: when changing filter identifier - the filter is not displayed. Can anybody confirm?
Comment #24
kopeboyIs 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.
Comment #25
ikeigenwijs commenteda commit would be nice.
Patch still valid for 3.11
Comment #26
jimmynash commentedConfirming patch in #20 worked for me on 7.x-.3.11
Comment #27
JJSON commentedPatch #20 works for me as well. Echoing what's already been said here but it would be great to see this committed.
Comment #28
mikeker commentedNo one has addressed the question by @dawehner in #19:
Comment #29
nwom commentedI 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 620Line 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?
Comment #30
braindrift commentedany work on this?
Comment #31
Chris CharltonI got stung by this just last week.
Comment #32
zalak.addweb commentedComment #33
deetergp commentedI 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.
Comment #34
deetergp commentedChanging status to "Needs Review."
Comment #36
deetergp commentedMy apologies… I rolled that last patch from the wrong folder. Patch #36 should apply without issue.
Comment #37
deetergp commentedWell, 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.
Comment #38
mikeker commentedComment #39
sjpatrick commentedTested and works as advertised.
Comment #40
bbc#37 looks good to me
Comment #41
joelpittetRTBC++ this still works. Thanks @deetergp
Comment #42
alfthecat commented#37 works brilliantly. Thanks! Big UX problem solved :)
Comment #43
skaught#37 any verify
commit please!
Comment #44
Chris Charlton5 yeses for RTBC! :)
Comment #45
othermachines commentedI also came across this bug. #37 fixes it - thanks!
Comment #46
ikeigenwijs commented.patch #37 applied cleanly on latest stable 7.x-3.18 - thanks!
Comment #47
Chris CharltonFolks are liking patch in #37! :)
Comment #48
luke.stewart commentedJust tried patch #37 on 7.x-3.17 and works as advertised.
Comment #49
skaughtseeking attention.
Comment #50
Chris CharltonBump (for additional attention). :)
Comment #51
othermachines commentedRe-rolled #37 against 7.x-3.x-dev.
Comment #53
othermachines commentedNot sure why testbot is complaining.
Comment #55
ikeigenwijs commentedreuploaded to trigger testbot, all tests are passed.
Comment #56
Chris CharltonSweet! Back to RTBC? Or good to get in?
Comment #57
xlin commentedI'm still getting this error with patch from #55, screenshot attached. I'm using views 7.x-3.20 with search_api.
Attached a similar patch to check for the 'empty' and 'not empty' operator earlier.
Comment #58
xlin commentedPlease ignore patch #57, included fix for other issues.
Comment #59
ikeigenwijs commentedBack on track
Works for 7.x-3.20
Next release?
Comment #60
damienmckennaComment #61
Neo13 commentedI can confirm that #58 fixes the issue.
Comment #62
skylord commentedConfirm #58 working fine.
Comment #63
Chris CharltonCool! Anyone else try this out with success? Is two enough for RTBC? :)
Comment #64
ikeigenwijs commentedStill good on our end.
Comment #66
damienmckennaCommitted. Thank you.