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.

Support from Acquia helps fund testing for Drupal Acquia logo

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

@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

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

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

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.

zalak.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! :)

othermachines’s picture

I also came across this bug. #37 fixes it - thanks!

ikeigenwijs’s picture

.patch #37 applied cleanly on latest stable 7.x-3.18 - thanks!

Chris Charlton’s picture

Folks are liking patch in #37! :)

luke.stewart’s picture

Just tried patch #37 on 7.x-3.17 and works as advertised.

SKAUGHT’s picture

Priority: Major » Critical

seeking attention.

Chris Charlton’s picture

Bump (for additional attention). :)

othermachines’s picture

Status: Reviewed & tested by the community » Needs work
othermachines’s picture

Status: Needs work » Needs review

Not sure why testbot is complaining.

Status: Needs review » Needs work
ikeigenwijs’s picture

Status: Needs work » Needs review
FileSize
934 bytes

reuploaded to trigger testbot, all tests are passed.

Chris Charlton’s picture

Sweet! Back to RTBC? Or good to get in?

xlin’s picture

I'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.

xlin’s picture

ikeigenwijs’s picture

DamienMcKenna’s picture

Issue tags: -views
Neo13’s picture

I can confirm that #58 fixes the issue.

skylord’s picture

Confirm #58 working fine.

Chris Charlton’s picture

Cool! Anyone else try this out with success? Is two enough for RTBC? :)

ikeigenwijs’s picture

Still good on our end.

  • DamienMcKenna committed 5ed4178 on 7.x-3.x authored by xlin
    Issue #1818176 by deetergp, xlin, OnkelTem, ikeigenwijs, mikeker,...
DamienMcKenna’s picture

Status: Reviewed & tested by the community » Fixed
Parent issue: » #2960871: Plan for Views 7.x-3.23 release

Committed. Thank you.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.