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.
I have taxonomy term names as an exposed filter and under Display "tid" exposed filter as I selected links however any is being displayed. I can understand the use case for any but this is completely pointless when filtering by links.
I tried to use but I guess that was being a little cheeky. Is their anyway to hide the -any-.
Comment | File | Size | Author |
---|---|---|---|
#5 | Events.png | 76.9 KB | corbacho |
#2 | bef-any.png | 22.45 KB | interdruper |
Comments
Comment #2
interdruper CreditAttribution: interdruper at Interdruper commentedYou have just to rewrite the filter options, leaving blank the rewrite:
Comment #3
corbacho CreditAttribution: corbacho as a volunteer commentedI have the same problem. I tried all these solutions, one by one, and still it shows up.
-Any-|
- Any -|
- Any -|
(with an extra space after |)Comment #4
corbacho CreditAttribution: corbacho as a volunteer commentedI'm using 8.x-3.0-alpha1, I wouldn't like to hijack this issue, though and re-assign from 7.x
Comment #5
corbacho CreditAttribution: corbacho as a volunteer commentedThe problem is that "- Any -" doesn't match the "All" , in the logic of rewriting , file BetterExposedFilters.php
I'm using this form_alter in the meanwhile (based on https://www.drupal.org/node/1537074 (comment 3))
Comment #6
mikeker CreditAttribution: mikeker as a volunteer commentedCan someone try the patch in #2756693: Cannot rewrite filter options with non-alphanumeric characters and let me know if it solves your problem?
(Also, you can make the filter required to remove the "any" option.)
Comment #7
mikeker CreditAttribution: mikeker as a volunteer commentedre: @corbacho in #5:
I think you're using an older version of BEF. That should have been fixed in this commit from Aug 2016. However, there is still an outstanding issue: #2666540: Rewrites do not work for taxonomy filters (D8-only).
I should also point out that removing the any/all option may give you the dreaded "illegal choice" error. It might be good to special case that situation in BEF.
Comment #8
corbacho CreditAttribution: corbacho as a volunteer commentedThanks Mike. Problem solved after updating the module to alpha-2. The only issue is an annoying PHP warning but I fixed it with patch #4 from #2822916: Set selected variable before rewriting filter option 'Undefined variable: selected'
Comment #9
mikeker CreditAttribution: mikeker as a volunteer commentedIssue queue cleanup. Based on #8 it sounds like this has been resolved.