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.
For CCK fields that use allowed values, you can specify key/value pairs, like
1|Apple
2|Banana
The key (e.g. "2") is what gets indexed, however there is no map callback provided for the facet, so the facet list ends up looking like
Fruit
1 (5)
2 (13)
whereas you would really want
Fruit
Apple (5)
Banana (13)
Comment | File | Size | Author |
---|---|---|---|
#4 | cck-facet-map-callback-1994840-4.patch | 1.49 KB | kevin.dutra |
#2 | cck-facet-map-callback-1994840-2.patch | 1.47 KB | kevin.dutra |
#1 | cck-facet-map-callback-1994840.patch | 1.46 KB | kevin.dutra |
Comments
Comment #1
kevin.dutra CreditAttribution: kevin.dutra commentedComment #2
kevin.dutra CreditAttribution: kevin.dutra commentedWhoops, incorrect callback name.
Comment #3
pwolanin CreditAttribution: pwolanin commentedis filter_xss() the right filtering here? Are some HTML tags allowed in allowed vallues? If so, you need to set the $map['#value'] to the content, and $map['#html'] to TRUE.
by default, check_plain() is applied, and in this case content will be double filtered.
Comment #4
kevin.dutra CreditAttribution: kevin.dutra at Workday, Inc. commentedWhoops, I guess I missed your reply. Yes, you are correct. I guess I never read the description on the allowed values field that closely. At any rate, a revised patch is attached (re-rolled so that it applies to HEAD).