Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If you choose the node: body as filter you can choose "is empty/is not empty" for grouped filter operators.
Sadly the filter require you to input a value even for that.
As the actual filtering happens without the value you can input anything but this is a quite huge UX fail.
Comment | File | Size | Author |
---|---|---|---|
#17 | 1785318-17.patch | 4.25 KB | damiankloip |
#17 | interdiff.txt | 1.17 KB | damiankloip |
#15 | drupal-1785318-15.patch | 4.1 KB | dawehner |
#12 | drupal-1785318-12.patch | 4.1 KB | dawehner |
#11 | drupal-1785318-11.patch | 4.07 KB | dagmar |
Comments
Comment #1
dagmarTagging, I'll will try to provide patches for all the issues tagged with 'Hybrid Filters Follow-ups' as soon as possible (probably during September). Please help me tagging those issues.
Comment #2
peterpoe CreditAttribution: peterpoe commentedHere is a patch for 8.x. I don't see any way to recognize operators that don't require a value, so I just added a check for "empty" and "not empty". There may be a better way to do this.
But maybe requiring that the field is filled is not even necessary?
Comment #3
peterpoe CreditAttribution: peterpoe commentedHere is the same patch for 7.x.
Comment #4
dawehner@peterpoe
If you look at the operators() method you see something like
which tells you which operators need what amount of values ... I guess you could use this information?
Comment #5
peterpoe CreditAttribution: peterpoe commented#4 Right. New patches.
Comment #6
dawehnerLet's also write a test for test, just to be sure it will not happen anymore in the future.
Comment #7
dawehnerTo be write tests, some additional lines in ExposedFormTest.php would help.
Comment #8
xjmComment #9
dawehnerHere is a test and the actual fix from above.
Comment #10
mikeker CreditAttribution: mikeker commentedJust FYI, that the 7.x version of this patch is in the Views issue queue.
Comment #11
dagmarRe-rolled.
Comment #12
dawehnerThat one just needed a small adaption.
Comment #13
dawehner#12: drupal-1785318-12.patch queued for re-testing.
Comment #15
dawehnerComment #17
damiankloip CreditAttribution: damiankloip commentedThe new test assertion was not asserting the correct path, I think we need to append '/default' to it. I also added another assertion to make sure we don't have the validation error text - might come in useful at some point for debugging, you never know!
Comment #18
dawehnerNice!
Comment #19
xjm#17: 1785318-17.patch queued for re-testing.
Comment #20
xjmComment #21
catchCommitted/pushed to 8.x, thanks!