Object of class Drupal\facets\Entity\Facet could not be converted to string in Drupal\views\Plugin\views\filter\FilterPluginBase->prepareFilterSelectOptions()

Created on 26 August 2024, 5 months ago

Problem/Motivation

Using 3.0.x-dev because using Facets 3 successfully on another project, Facets 2 did not work like i expected, the beta had a deprecated function warning ("Deprecated function: Creation of dynamic property Drupal\Core\Form\FormState::$facets_not_built") that i wanted to check if it was in dev before reporting, plus there has not been a beta release for two years and i wanted to be in a position of contributing, on the margins, to the development of this module.

Steps to reproduce

  1. Create a facet based on a text list with the widget Searchable list of checkboxes
  2. Check off List item label
  3. Add to View under Filter criteria the Index Content: Facets with "Expose this filter to visitors, to allow them to change it"

There are no complaints from any of the configuring side, but when going to visit the view page:

Object of class Drupal\facets\Entity\Facet could not be converted to string in Drupal\views\Plugin\views\filter\FilterPluginBase->prepareFilterSelectOptions() (line 1334 of core/modules/views/src/Plugin/views/filter/FilterPluginBase.php).

Proposed resolution

I was also surprised that the option was now select Facet (singular) with a radio button; was expected as i added more they could be grouped together, plus having to give the Filter identifier which i thought was set adequately on the individual facets. All of which is to say that what might really be needed right now is documentation for testing the 3.x version. Thanks for any help!

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mlncn Minneapolis, MN, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @mlncn
  • πŸ‡ΊπŸ‡ΈUnited States mlncn Minneapolis, MN, USA

    This happens with list of links or checkboxes without filtering, without List item label, … seems 3.0.x-dev may be broken generally? Or i am misconfiguring.

Production build 0.71.5 2024