Comments

dawehner’s picture

Project: Views (for Drupal 7) » Content Construction Kit (CCK)
Version: 6.x-2.5 » 6.x-2.x-dev
Component: Code » Views Integration

But the Views Integration of CCK ist not part of Views

junedkazi’s picture

Title: CCK field is not empty filter doesn't work when exposed » CCK field is empty/not empty filter doesn't work when exposed

I have also noticed this problem.

When the field is not exposed as a filter and the field operator
is set to IS EMPTY/ IS NOT EMPTY it works perfectly fine
but when we expose the same filter and search based on
IS EMPTY/ IS NOT EMPTY operator there is no change in results.

I am using Drupal 6.12
cck - 6.x-2.3
views - 6.x-2.6

Any help is appreciated.

Thanks

Juned Kazi

j0k3z’s picture

+1

junedkazi’s picture

Priority: Normal » Critical

Just changing it to critical to bring it to notice.

junedkazi’s picture

can anyone of the maintainers pls look into this issue.
If u need anymore info pls let me know I will try and
provide as much info as I can to get this problem
solved.

Flying Drupalist’s picture

Priority: Critical » Normal
michellekim’s picture

subscribed

markus_petrux’s picture

Status: Active » Postponed (maintainer needs more info)

I've been unable to reproduce this issue. Please, try with latest development version of CCK to see if that makes a difference.

If the problem persists, then please provide steps to reproduce. First try with a simple view using text or number fields provided by CCK itself. If that works, then try with noderef. If that works, then try with any other field.

If the problem is related to a field that is not provided by CCK itself, then this issue needs to be transferred to the proper queue.

Please, describe how the field you wanted to filter by is defined, the field type, if it accepts multiple values, the SQL statement generated when using the EMPTY/NOT EMPTY operator -vs- any other operator, etc.

markus_petrux’s picture

Status: Postponed (maintainer needs more info) » Fixed

Actually, I think this was really fixed in Views itself. See #323049: Add 'allow empty' support to views_handler_filter_in_operator

Status: Fixed » Closed (fixed)

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

aren cambre’s picture

Project: Views (for Drupal 7) » Content Construction Kit (CCK)
Version: 6.x-2.6 » 6.x-2.x-dev
Component: exposed filters » Views Integration

This is not fixed. I can reproduce, and I have the latest 6.x releases of core, CCK, and Views, and Views 6.x-2.6's release notes show that #323049: Add 'allow empty' support to views_handler_filter_in_operator was included.

I tested the Is empty (NULL)and Is not empty (NULL) filters on a Text field type. When, non-exposed, the filters work as expected. When exposed, they stop working.

Note that all I did was expose the filter. I did not select any other options. This just shows the filter description and an Apply button on the view.

markus_petrux’s picture

Project: Content Construction Kit (CCK) » Views (for Drupal 7)
Version: 6.x-2.x-dev » 6.x-2.6
Component: Views Integration » exposed filters
Status: Closed (fixed) » Active

This feature in CCK is inherited from Views handlers, so the correct layer where needs to be fixed is Views (see views_handler_filter_string, views_handler_filter_numeric, views_handler_filter_in_operator, ...). Transferring to he proper issues queue.

aren cambre’s picture

Project: Content Construction Kit (CCK) » Views (for Drupal 7)
Version: 6.x-2.x-dev » 6.x-2.6
Component: Views Integration » exposed filters
Status: Active » Closed (duplicate)

I just realized this duplicates #573298: Cannot set exposed binary filters without "Unlock operator". The problem is that the Views UI does not show an operator to turn on/off empty/not empty filters.

giorgio79’s picture

Status: Closed (duplicate) » Active

I am not sure if this is only a UI issue. Setting it back to active. It is one thing the UI does not make sense, but the query simply does not work, if I try to filter for fields that are "EMPTY" fields...Even text fields.

Also, as I understand EMPTY is meant to represent the SQL term, because in that case instead of
Is empty (NULL)and Is not empty (NULL)
it should be
Is empty (NULL)and Is not empty (NOT NULL)

Is NOT EMPTY works fine for me.

erkan_o’s picture

I have the same problem here, nothing fancy, just an exposed filter on a TEXT field. When I search for "Is null", nothing happens. But it works if the CCK field is not a TEXT field.

BUT, if I do a search and selects "Begins with..", type a letter and get a result, from then on if I select "Is null" then I get result. But that is simply not possible to release to clients.

Anyone got a quickfix?

heylookalive’s picture

As a quick fix, I just added the same field again in addition with 'is not equal to' then the value blank, just not exposed.

Btw:
Drupal 6.14
CCK 6.x-2.6
Views 6.x-2.7

erkan_o’s picture

So lets find out if I understand you right.

-You have one field with an exposed filter, it does not work when you search for "Is null, empty"
-So you add the field again, so you have two fields of the same fieldname, one exposed and one not exposed, the one not exposed you assigned it to "is not equal to" and left value empty?
-And the above scenario is fully working?

Am I correct?

I just tried the above and confirm not working.

Views 6.x-2.8
CCK 6.x-2.6
Drupal 6.15

I invested 5 weeks into this application where it is vital for the client to be able to search data and filter results on empty data in order to know on what result data needs to be filled in. I should off course have tested that it should be possible to search for empty fields with an exposed filter at the first time but I asumed it should have been working.

So does anyone know if searching data with exposed filters works in Drupal 5 or 4, I need to have this app working on tuesday or the clients will bust my ass. Please heeeeeelp!

----

Slight update.
Ok, I got it "somewhat" working. This is how I did it.

If I want to search all customers who have not registered a webadress:

-I go to the exposed filter field "Webadress",
-Then I chose the first option in the drop down ("is the same as"), then I put one space (empty character) in the text field.
-Then without clicking the search button I chose option "Is empty" and click on the search button and then it works!

So now I need to find out how to put an empty character in the text field when I have chosen to search for empty data in fields.

erkan_o’s picture

Hi,

Just wanted to let people know how I solved it for future reference.

I created a custom module with hook_form_alter(), then I added "onChange=searchFix("field-somethingxyz-value-op") to every form field that I needed to search on. With drupal_add_js() I could add the relevant JS to put an empty space in the field so that I could search on fields that where empty in an exposed filter.

Ok, below follows my incredible lame code, laugh all you will but it saved my ass from being busted tomorrow :-)

Have fun!

function customsite_form_alter(&$form, $form_state, $form_id) {
  drupal_add_js("
  function search_fix(field_name) {
    var field_name
	field_name2 = field_name.replace('-op', '')
    if (document.getElementById('edit-' + field_name + '').value == 'empty') {
		document.getElementById('edit-' + field_name2 + '').value = ' '
	} else if (document.getElementById('edit-' + field_name + '').value == 'not empty') {
		document.getElementById('edit-' + field_name2 + '').value = ' '
	} else {
		document.getElementById('edit-' + field_name2 + '').value = ''
	}
  }
  ", "inline");
  

  if ($form['#id'] == 'views-exposed-form-lista-foretag-sok-page-1') {

	$form['field_telefonnummer_value_op']['#attributes']['onChange'] = 'search_fix("field-telefonnummer-value-op")';
	$form['field_epostadress_value_op']['#attributes']['onChange'] = 'search_fix("field-epostadress-value-op")';
/* I just added all form fields here, in this example I only have two */
  }
}
smzur22’s picture

subscribing..

demeritcowboy’s picture

The problem seems to be that views is expecting an xxx_value parameter in the query string even when the xxx_op=empty, and does nothing if it's not there.

So the first time through if you select Is Empty, it doesn't set an xxx_value in the query string, but then if you select Is One Of and then submit and then choose Is Empty, it "remembers" the xxx_value parameter and includes it in the query string and so it works.

So either it needs to somehow set something for the xxx_value right when the form is first displayed, or better, it needs to understand that if the xxx_op=empty then it doesn't need the xxx_value.

Does anybody know where in the code it's doing this?

aren cambre’s picture

Version: 6.x-2.6 » 6.x-2.8
demeritcowboy’s picture

StatusFileSize
new629 bytes

See attached patch for handlers/views_handler_filter.inc.

Encarte’s picture

subscribing

fatstar415’s picture

StatusFileSize
new1.4 KB

Patch for this issue

Please note that this patch is not made relative to the module's root directory.

Please apply patch under the folder handlers/ in your views root directory.

fatstar415’s picture

Status: Active » Fixed
giorgio79’s picture

Status: Fixed » Needs review
dawehner’s picture

Status: Needs review » Needs work
+++ views_handler_filter.inc	2010-07-02 15:13:47.684877837 +0800
@@ -507,10 +507,32 @@
+      	// Code added by Stephen Leung
+      	// The following code is a fix of http://drupal.org/node/477984
+      	//	combinding patch
+      	//	http://drupal.org/files/issues/views_handler_filter.inc_.patch
+      	//	shared by demeritcowboy

we don't do this.

+++ views_handler_filter.inc	2010-07-02 15:13:47.684877837 +0800
@@ -507,10 +507,32 @@
+      	if ($this->operator == 'empty' && $value === '')
+      	{
+      		$value = ' ';
+      	}
+      	
+      	if ($this->operator == 'not empty' && $value === '')
+      	{
+      		$value = ' ';
+      	}

A better codestyle would be cool.

+++ views_handler_filter.inc	2010-07-02 15:13:47.684877837 +0800
@@ -507,10 +507,32 @@
+		///////////////////////////////////////////////////////////////
+      	// Code end
+      	///////////////////////////////////////////////////////////////

huh?

Powered by Dreditor.

fatstar415’s picture

StatusFileSize
new878 bytes

Something that I do in a company. Forgot to take that out.

Encarte’s picture

Status: Needs work » Needs review
Flying Drupalist’s picture

You gotta follow the drupal coding standards.

http://drupal.org/coding-standards

dawehner’s picture

Status: Needs review » Needs work

so needs work.

A inline commit perhaps would be cool, why we do this here.

Mike Dodd’s picture

Status: Needs work » Needs review
StatusFileSize
new824 bytes

I have just cleaned this patch up a bit.

dawehner’s picture

Status: Needs review » Needs work
+++ views_handler_filter.inc    5 Jul 2010 13:53:36 -0000
@@ -503,9 +503,16 @@
-        }
+               ¶
+        if (($this->operator == 'empty' || $this->operator == 'not empty') && $value === ''){
+          $value = ' ';
+        }
+               ¶

Could we use spaces and ''){ should be '') {

+++ views_handler_filter.inc    5 Jul 2010 13:53:36 -0000
@@ -503,9 +503,16 @@
+        if ($this->operator != 'empty' && $this->operator != 'not empty') {
+          if ($value == 'All' || $value === array()) {
+            return FALSE;
+          }

a inline comment would be cool!

Powered by Dreditor.

homoludens’s picture

subscribe

rburgundy’s picture

subscribe

dagmar’s picture

Version: 6.x-2.8 » 6.x-3.x-dev
Status: Needs work » Needs review
StatusFileSize
new844 bytes

Rellolled against DRUPAL--3 branch. Fixed coding standards.

bojanz’s picture

Status: Needs review » Reviewed & tested by the community

Nice work. Let's get this to Earl.

merlinofchaos’s picture

Status: Reviewed & tested by the community » Fixed

Committed to all branches.

Status: Fixed » Closed (fixed)

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

Encarte’s picture

Version: 6.x-3.x-dev » 6.x-2.12
Status: Closed (fixed) » Active

I still get this same problem in Views 6.x-2.12 (Chaos tool suite 6.x-1.8 and CCK 6.x-2.9)

giorgio79’s picture

I only get it with Text types, with Integer fields it works fine now.

Encarte’s picture

I get it even with taxonomy term id filter (even not exposed)...

dawehner’s picture


I still get this same problem in Views 6.x-2.12 (Chaos tool suite 6.x-1.8 and CCK 6.x-2.9)

Please try out the views 2.x dev version. As earl said he commited it already.

Encarte’s picture

Sorry, but, since he commited in 2010-Nov-18 and 6.x-2.12 was released in 2010-Dec-15, I thought that 6.x-2.12 would have the fix. I'll try out the dev, then. Thanks.

Update: But... there's no views 2.x dev version in the project page. Where do I get it?

giorgio79’s picture

Need to try the 6.3 version
As Earl said in #38:

Rellolled against DRUPAL--3 branch. Fixed coding standards.
dawehner’s picture


Committed to all branches.

and the link because you didn't searched on google: http://drupal.org/node/95897

bojanz’s picture

2.12 was just a security release, that's why it doesn't include the fix.
2.x dev (or 3.x dev) is what you need.

Encarte’s picture

Status: Active » Fixed

Seems to be fixed in last dev. Thank you.

Status: Fixed » Closed (fixed)

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

giorgio79’s picture

Yes works great! Much appreciated.

Encarte’s picture

Version: 6.x-2.12 » 6.x-2.x-dev
Status: Closed (fixed) » Active

This problem is active once more in the July 9, 2011 - 01:47 Views 6.x-2.x-dev.

Encarte’s picture

Status: Active » Fixed

Tried the September 1 dev and it seems to be fixed. Thank you Dereine.

Status: Fixed » Closed (fixed)

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

chronosinteractive’s picture

Version: 6.x-2.x-dev » 7.x-3.0-rc1
Status: Closed (fixed) » Active

I believe this issue still exists in Views 7.x-3.0-rc1. Creating a filter for NULL/NOT-NULL works fine, until it is exposed in which it then no longer works.

clemens.tolboom’s picture

I'm querying the system table on status == 'All' but when in file views_handler_filter_boolean_operator.inc with $value == 'All'


function query() {
    $this->ensure_my_table();
    $field = "$this->table_alias.$this->real_field";

    if (empty($this->value)) {
      if ($this->accept_null) {
        $or = db_or()
          ->condition($field, 0, '=')
          ->condition($field, NULL, 'IS NULL');
        $this->query->add_where($this->options['group'], $or);
      }
      else {
        $this->query->add_where($this->options['group'], $field, 0, '=');
      }
    }
    else {
      if (!empty($this->definition['use equal'])) {
        $this->query->add_where($this->options['group'], $field, 1, '=');
      }
      else {
        $this->query->add_where($this->options['group'], $field, 0, '<>');
      }
    }
  }

the code falls down to the last add_where ... it should not add any where.

trudog’s picture

that's correct! exposed filter doesn't work for null/ not null. i get the following error:

Notice: Undefined index: field_cl_nid in views_handler_filter->accept_exposed_input() (line 506 of /Users/.../sites/all/modules/views/handlers/views_handler_filter.inc).

field_cl_nid is a cck node reference type.

jamix’s picture

I'm also experiencing this issue in Views 7.x-3.1. When exposing an "Is empty" filter for a node reference field, I get the same error as pisicosu in #56. When exposing an "Is empty" filter for a text field, I get a text field in the filter instead of an (expected) Empty/Not empty select box. Hopefully this will get fixed soon.

jvieille’s picture

Version: 7.x-3.0-rc1 » 6.x-2.16

Still there in 6x-2.16 from 12/12//2011

deciphered’s picture

Version: 6.x-2.16 » 7.x-3.x-dev
Status: Active » Needs review
StatusFileSize
new726 bytes

While I agree that the widget being used for the EMPTY/NOT EMPTY operator shouldn't be a textfield, that's probably better left to Better Exposed Filters.

As for the issue itself, only having skimmed the content of this issue but having delved into the code it is evident that there is an issue with the code itself (at least in D7):

        if (($this->operator == 'empty' || $this->operator == 'not empty') && $value === '') {
          $value = ' ';
        }

The main issue is that from my testing $value will always be an array() with a key of value, so this code does nothing. My proposed and tested fix is attached as a patch, and it will return TRUE or FALSE toggling the exposed filter on and off if the value provided is empty or not empty.

deciphered’s picture

StatusFileSize
new1.94 KB

Patch round 2, this time I've chosen to change the form element to a Select field with the values ALL, Yes and No, and depending on the choice the operator will either be ignored (Show all), used as is (Yes) or toggled to the opposing operator (No).

dawehner’s picture

Status: Needs review » Needs work
+++ b/handlers/views_handler_filter.incundefined
@@ -455,7 +455,18 @@ class views_handler_filter extends views_handler {
+      if ($this->operator == 'empty' || $this->operator == 'not empty') {
+        $this->value = 'All';
+        $this->value_value = '';
+        $this->value_options = array(
+          1 => t('Yes'),
+          0 => t('No')
+        );
+        views_handler_filter_boolean_operator::value_form($form, $form_state);
+      }
+      else {

These kind of code should be part of views_handler_filter_boolean_operator then. To be able to extend functionality is the great advantage of OOP.

qasimzee’s picture

any update on this?

dchatry’s picture

Subscribing

ahmad.khalid’s picture

hi i used your patch in all version of drupal 7 but using that patches is empty/not empty filter doesn't work when exposed please help me.how that work
thanks

ahmad.khalid’s picture

thank you very much of all for help me to resolve that problem.if anyone want to help me then contact me

mikeker’s picture

@dawehner said in #61:

These kind of code should be part of views_handler_filter_boolean_operator then. To be able to extend functionality is the great advantage of OOP.

True, but we would have to add another filter type, such as "Content: empty/not empty" because the "Content: " is an instance of views_handler_filter_string not views_handler_filter_boolean_operator. Or the boolean-specific stuff would have to be moved from views_handler_filter_boolean_operator to views_handler_filter which kinda ruins the encapsulation.

Or am I misunderstanding the Views class hierarchy?

klucid’s picture

The patch in #60 works great. Thank you! I'm surprised it hasn't been committed as of 7.x-3.7.

I may have to open another issue, but is there a reason I cannot use Better Exposed Filters (http://drupal.org/project/better_exposed_filters) to change the drop down menu to a radio button?

mikeker’s picture

Status: Needs work » Needs review

Bumping to needs review in hopes of getting some feedback on #66...

Shevchuk’s picture

Confirm patch in #60 works perfectly. As it solves the problem, I think it might be a good idea to commit it, and then refactor (see #61), so everyone gets happy =)

P.S. Thanks, Deciphered =)

Shevchuk’s picture

StatusFileSize
new1.97 KB

One tiny issue, though: empty value and 'All' value are not handled properly because of $value = $value['value'] — this means $value (being a string, not array) becomes 'A' instead of 'All'. So, if ($value == 'All' [...] return FALSE; never fires.

Quick fix is to add is_array() check so that $value doesn't get wrongly overwritten. Fixed patch attached.

Sinan Erdem’s picture

After applying the patch to 7.x-3.7 version, I am receiving some warnings like that:

Strict warning: Non-static method views_handler_filter_boolean_operator::value_form() should not be called statically, assuming $this from incompatible context in views_handler_filter->exposed_form() (line 777 of /mysite/sites/all/modules/views/handlers/views_handler_filter.inc).

For each "not empty" exposed filter, it prints one of those warnings.

clemens.tolboom’s picture

+++ b/handlers/views_handler_filter.inc
@@ -455,7 +455,18 @@ class views_handler_filter extends views_handler {
+        views_handler_filter_boolean_operator::value_form($form, $form_state);
+      }

Why is this static call used? This was introduced in #60.

clemens.tolboom’s picture

Status: Needs review » Needs work

The use of the static call needs some documentation I guess or converted to a non static call.

Thithi32’s picture

I'm having the Strict Warning issue but I don't know how to solve it.
Anyone has a correction available?

bruceci’s picture

#60 patch to views7.37 do not work ,operator dispear as before。

amir simantov’s picture

Neither #70 work for 3.37

seanr’s picture

I just got bitten by this as well (Strict warning: Non-static method views_handler_filter_boolean_operator::value_form() should not be called statically, assuming $this from incompatible context in views_handler_filter->exposed_form() (line 777 of /.../views_handler_filter.inc).). Does anyone have any suggestions for fixing this?

altcom_alan’s picture

Issue summary: View changes
StatusFileSize
new2.04 KB

I've rerolled patch in #70 against 7.x-3.7 and also changed the static call to creating a new views_handler_filter_boolean_operator() object, setting the values for it as well as $this and then calling value_form() on the object like so:

        $boolean = new views_handler_filter_boolean_operator();
        $boolean->value = $this->value = 'All';
        $boolean->value_value = $this->value_value = '';
        $boolean->value_options = $this->value_options = array(
          1 => t('Yes'),
          0 => t('No')
        );
        $boolean->value_form($form, $form_state);

I've tested it works for me and I've even used hook_form_alter to change the select list into a check box so I have a view that exposes IS NULL or IS NOT NULL filters as a simple on / off checkbox (rather than an on / off / opposite choice provided by the select list)

josebc’s picture

Thank you
patch applied and working correctly, hover it doesn't apply if views in another location than sites/all/modules/views
can you just re-generate that patch so it works for all locations .

jfrederick’s picture

Status: Needs work » Needs review
StatusFileSize
new2.04 KB

Re-rolled #78 against 7.x-dev, patch also applies cleanly to 7.x-3.8, and incorporates suggestion from #79.

W.M.’s picture

Patch at #80 works perfectly and solves the issue. I think it should be committed in next stable release.

1mundus’s picture

I have this problem with Views 3.10 and Drupal 7.31. Before the last upgrade (3.8 to 3.10) if I selected "Is empty (NULL)" as exposed filter, that field would disappear from filter list, but it worked well.

Now it doesn't disappear anymore (and that's great), but it doesn't work either. If I use the same filter from Views UI and avoid using it as exposed filter, it works properly.

This behavior occurs only with taxonomy fields. Text fields work well, but their filter still disappears when "is empty" filter is applied.

mbnsorg’s picture

Using Views 3.10 and Core 7.35, when using Exposed Filter, when either Is empty (NULL) or Is not empty (NOT NULL) are selected, the filter itself completely disappears. Hitting Apply at that point (for no intuitive reason) results in an incorrect query (the query uses a different and unrelated field).

I tried the above patch in #80, adjusted for 3.10, and the issues remain.

Has anyone resolved issues with Is empty/not empty? This seems so obvious, I am not sure what I am missing.

I looked through Views code and see references to $this->definition["allow empty"], which seems related to this somehow, but I do not have bandwidth at the moment to fix Views code.

If there is no fix to this, is there a hook I could use to just remove those options entirely from the Exposed Filter operators?

Thanks for any help.

Edit: This seems more related https://www.drupal.org/node/1249684

ciss’s picture

@mbnsorg: https://www.drupal.org/node/1087348#comment-9834587 might be related to your issue.

jbrandl07’s picture

I recently ran into this issue as well when trying to expose a filter to show nodes with body fields that are empty or not empty. I added a grouped filter with a select widget type. I then added to options to the select. One I called "Body Field is Empty" with an operator of "Length is shorter than" and a value of "1". The other was called "Body Field is Not Empty" with an operator of "Length is longer than" and a value of "1". This suited my needs for what I was trying to accomplish and got around this null/not null issue. I hope this helps.

Cheers,

sagacity’s picture

#85 really helped, thanks @jbrandl07

sbilde’s picture

#85 Help me as well, along with this patch: https://www.drupal.org/files/issues/views-1818176-12.patch .. Thanks.

djcj’s picture

My exposed date filter would not work for NULL or NOT NULL. (Drupal 7)

My work-around was to comment out the following lines from this file:
/modules/views/handlers/views_handler_filter_date.inc (around line 135)

 /*   // Don't filter if value(s) are empty.
    $operators = $this->operators();
    if (!empty($this->options['expose']['use_operator']) && !empty($this->options['expose']['operator_id'])) {
      $operator = $input[$this->options['expose']['operator_id']];
    }
    else {
      $operator = $this->operator;
    }

    if ($operators[$operator]['values'] == 1) {
      if ($this->value['value'] == '') {
        return FALSE;
      }
    }
    else {
      if ($this->value['min'] == '' || $this->value['max'] == '') {
        return FALSE;
      }
    }*/

Now it works correctly.

portulaca’s picture

I was able to work around this for Content: File field by using Grouped filters option. I'm copying my answer from http://drupal.stackexchange.com/questions/64730/exposed-filter-for-file-...

I added Content File:fid filter and exposed it.

Then I selected Grouped filters option (instead of the Single filter).

In the table that appears where you can set your options, the first one is Any (default), in the second one I added

Label YES
Operator Is greater than
Value 0

and I removed the third table row as I didn't need it.

This filter works! It shows the filter with 2 options: Any and YES. Any is default and shows all results. If I select YES it only shows results that have a file attached :)

I also added Content: file among Fields so it's easy to test the filter.

proweb.ua’s picture

Patch at #80 works

dunebl’s picture

I have tried to group all the patches/issues about this problem into one issue: https://www.drupal.org/node/2704699

saurabh.dhariwal’s picture

Status: Needs review » Reviewed & tested by the community

Latest patch is working fine! Thanks for contribution Guys!!

The last submitted patch, 78: exposed_EMPTY_NOT_EMPTY-477984-78.patch, failed testing.

djpable’s picture

I'm not able to apply this patch to the current version 7.x-3.15.
It seems already applied but after update my NOT NULL filters are broken again.

damienmckenna’s picture

StatusFileSize
new2.06 KB

Reroll.

kiwibytes’s picture

I have the same problem in Views 7.x-3.16. I have applied an exposed filter in a view that is set to IS NOT EMPTY for an image field in profiles. The filter is visible as a checkbox but the value is applied regardless of state of checkbox and results are shown for profiles whose image field is not empty.
Is there a released version of views that has this patch? I'm asking as I don't know how to apply the patch.

dzy’s picture

StatusFileSize
new2.07 KB

Reroll for 7.x-3.20 copy from #95.

stred’s picture

confirm that #97 is working

damienmckenna’s picture

Status: Reviewed & tested by the community » Needs work

The patch needs to be updated to use long array syntax so we don't break PHP 5.3 again :)

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new572 bytes
new2.07 KB

Fixed array syntax.

damienmckenna’s picture

  • DamienMcKenna committed 50fe583 on 7.x-3.x
    Issue #477984 by DamienMcKenna, fatstar415, Deciphered, Shevchuk,...
damienmckenna’s picture

Status: Needs review » Fixed

@kiwibytes: Just so you understand it, when there's an open issue, i.e. one with a status that doesn't say "fixed" or "closed", that means the change has not been committed.

Committed.

Status: Fixed » Closed (fixed)

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

troybthompson’s picture

I just found this thread and it isn't helping in my situation. I have a List (text) field and when I select Null in the exposed filter, it doesn't work and nothing shows up in the query string to show it's being taken into account. BUT, if I first do a search for something in particular in the list first, then change it back to Null, it does get taken into account and works fine.

When you select "Is Empty NULL" the form-item-field-***-value select gets hidden. If Any / All is selected before it gets hidden, the whole thing including the null is ignored. If it's set to one of the options before it's hidden, that value triggers the null to be taken into account and it works. The value itself is ignored in the query (as it should).

So through testing multiple times it may have worked, but starting with a clean slate (in my case at least) it doesn't. Hope this helps.

Azor Ahai’s picture

Can confirm, the patch committed doesn't resolve the issue.

guypaddock’s picture

Please see if #3067681: Exposed Filters that Expose the "is empty" and "is not empty" Operators are Not Handled Properly initially, which I've just filed, captures the issues you guys are seeing.