Problem/Motivation
The facet block should use the facet label as the title instead of using the facet source and facet name to create a title.
Steps to reproduce
This only happens after updating the facet module to 2.0.6 and block facet to 1.5.0
Proposed resolution
Update the face title in the block to use the label of the facets.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | facets_block-use_facets_label_instead_of_source_title-3338909-9.patch | 449 bytes | yorder.be |
Comments
Comment #2
ashrafomar commentedComment #3
ashrafomar commentedComment #4
pianomansam commentedThis fixed the issue for me on 2.0.0-beta1. I'm bumping this issue to 2.x-dev because that's the latest version. However, it can be backported at the current time as well.
Comment #5
gnikolovskiUsing translations like this is not recommended:
$this->t($block_plugin->label())Only string literals should be passed to t().
We need to change this.
Comment #6
mrinalini9 commentedAdded patch by addressing #5, please review it.
Comment #7
alexp999 commentedIt's been caused by 3255460
For some reason the facet title had the source added, really unnecessary and broken front end UI
Comment #8
nord102Re-rolled the previous patches to use the
$block_plugin->label()and translate it properly.Comment #9
b_sharpe commentedPatch in #6 is correct, Patch #8 is unnecessarily translating a variable that should already handle it's own translation, there is no reason to pass this through t() unless there was some prefix/suffix text here.
Comment #10
jonathan_hunt commentedPatch #6 is working for me, thanks.
Comment #11
yorder.be commentedThis doesn't seem to work with translations.
This seems to work.
Comment #12
aelfendir commentedPatch #11 worked perfectly in our project (D10.1.4) to fix an issue with translations. Thanks!
Comment #13
gnikolovskiComment #15
gnikolovskiFixed.
Patch #11 applied, since it works with translations as well (I just tested it).
Comment #16
jonathan_hunt commentedUnfortunately the change in patch #11 as released in 2.0.0-beta3 fails in the case of
drupal/facets_range_dropdownssince$build['0']['#facet']is not set. For now, I am usingComment #17
gnikolovskiFixed the issue in #16 and released 2.0.0-beta4.
Comment #18
jonathan_hunt commentedThanks for that, working for me via 2.0.0-beta4.