- Issue created by @StryKaizer
- π§πͺBelgium StryKaizer Belgium
Still todo
- ui for facet processor weight sort (commented out for now)
- upgrade path for existing exposed filter implementations (for users using current *dev, as this was not released yet). - π§πͺBelgium StryKaizer Belgium
Related to this issue
π Support views default display Active had a MR which enables search api to use the default display too. - πΊπΈUnited States smustgrave
So did some initial testing and ran into a bef fatal error that will address here π BEF php 8.1.2 / TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given Needs work
So added a facet for content types. The facet appears fine and settings appear to work. But the actual filter doesn't appear to work
"The submitted value article in the type element is not allowed."
- πΊπΈUnited States smustgrave
Scratch that I needed to apply fix for π Argument #1 ($value) must be of type Countable|array, null given in count() (line 57 of core/lib/Drupal/Core/Render/Element/Radios.php). Needs work
- π¨πSwitzerland berdir Switzerland
I think the error there happens when there are no facets, and it's still converted into a checkboxes or similar element without any options.
- πΊπΈUnited States smustgrave
Yea I have a fix for bef I can push that helps until itβs fixed in core.
So this feature is working as expected. Like the simplicity of integrating with views and rendering control by bef
- Status changed to RTBC
5 months ago 1:57pm 24 September 2024 -
strykaizer β
committed c2f70843 on 3.0.x
Issue #3446781 by strykaizer: Rewrite facets exposed filters to be...
-
strykaizer β
committed c2f70843 on 3.0.x
- π§πͺBelgium bernardopaulino Brussels
Not sure if this is the right issue to leave this remark but, when I enable the option to expose the form in a block my facets are not rendered. Before this improvement the facets were properly rendered.
Should we open a new issue or can this problem still be reviewed and fixed here? - π§πͺBelgium StryKaizer Belgium
Hi Bernardo,
Thanks for reporting. I can see why this happens.
Before this patch, the search query fired twice, because Views renders its exposed filters before it fires the actual query, so the facet options are not yet available the first time.
Thats why in this patch we re-render the exposed filters once the view is executed, which fills in the facet options.Let's see if we can trigger a re-render of the blocks too somehow, so it will also work on them.
-
strykaizer β
committed 515e65ce on 3.0.x
Issue #3446781 by strykaizer: Rewrite facets exposed filters to be...
-
strykaizer β
committed 515e65ce on 3.0.x
- π§πͺBelgium StryKaizer Belgium
@bernardo: fix committed for exposed filters in blocks.
-
strykaizer β
committed eb22a9a2 on 3.0.x
Issue #3446781 by strykaizer: Rewrite facets exposed filters to be...
-
strykaizer β
committed eb22a9a2 on 3.0.x
- π¬π§United Kingdom AaronMcHale Edinburgh, Scotland
Using the 3.0.x dev branch and the recent commits from this issue seem to have broken existing exposed filters that were added to Views.
Obviously I'm aware that following the dev branch things will change and break.
What I have noted though after re-adding a Facet exposed filter results in a PHP error when trying to access the Settings screen in Views:
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "views_exposed_filters" plugin does not exist. Valid plugin IDs for Drupal\facets\UrlProcessor\UrlProcessorPluginManager are: query_string in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of /var/www/html/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).
- π§πͺBelgium StryKaizer Belgium
Hi Aaron,
That plugin got removed indeed.
Did you happen to run the update script? It should remove all occurrences of the plugin. - π³πΏNew Zealand djroshi
Hi, exposed filters in blocks don't seem to work anymore when using layout builder. The facet filters don't seem to render at all.
- π§πͺBelgium StryKaizer Belgium
@djroshi not sure why that is relevant to this issue. Please create a new ticket and describe how you are placing blocks, and your search items, using layout builder.
- π³πΏNew Zealand djroshi
Hi, sorry I posted here because this was working fine and stopped working 3 weeks ago with #c2f70843a5764450659bb8a2d4f82ea287d50313: Issue #3446781 by strykaizer: Rewrite facets exposed filters to be native views filters
I suspect it might be connected what was reported in #17.
I spent some time trying to track down the issue. Exposed facet filters seem to work unless they are placed in a block using layout builder, in which case they aren't rendered at all. Specifically, the render array for the filter looks like it hasn't got any options in it, it's just a generic empty filter array. Which sounds a lot like what you talk about in #18. Other non-facet filters in the same blocks are rendered fine.
- π§πͺBelgium StryKaizer Belgium
@djroshi
I can not reproduce this using latest
I created a view with display type block
I added facets as exposed filters (+ enabled ajax on the view, else exposed filters are not visible on block views)I added this view on a page using layout builder override.
Everything worked as expected.
PS: if you are using search_api_db, you need this patch for now:
"drupal/search_api": {
"search_api_db_facets_exposed_filters": "https://git.drupalcode.org/project/search_api/-/merge_requests/170.diff"
}, Automatically closed - issue fixed for 2 weeks with no activity.