"Display exposed filter as link" setting is not working with Client-side Hierarchical Select module

Created on 1 August 2022, over 2 years ago
Updated 12 September 2024, 3 months ago

Error: Object of class Drupal\cshs\Component\CshsOption could not be converted to string in Drupal\better_exposed_filters\BetterExposedFiltersHelper::flattenOptions() (line 131 of D:\wamp64\www\restoration\sites\all\modules\contrib\better_exposed_filters\src\BetterExposedFiltersHelper.php)

#0 D:\wamp64\www\restoration\sites\all\modules\contrib\better_exposed_filters\src\Plugin\better_exposed_filters\filter\Links.php(61): Drupal\better_exposed_filters\BetterExposedFiltersHelper::flattenOptions(Array)
#1 D:\wamp64\www\restoration\sites\all\modules\contrib\better_exposed_filters\src\Plugin\views\exposed_form\BetterExposedFilters.php(827): Drupal\better_exposed_filters\Plugin\better_exposed_filters\filter\Links->exposedFormAlter(Array, Object(Drupal\Core\Form\FormState))
#2 D:\wamp64\www\restoration\core\modules\views\src\Form\ViewsExposedForm.php(151): Drupal\better_exposed_filters\Plugin\views\exposed_form\BetterExposedFilters->exposedFormAlter(Array, Object(Drupal\Core\Form\FormState))
#3 [internal function]: Drupal\views\Form\ViewsExposedForm->buildForm(Array, Object(Drupal\Core\Form\FormState))
#4 D:\wamp64\www\restoration\core\lib\Drupal\Core\Form\FormBuilder.php(531): call_user_func_array(Array, Array)
#5 D:\wamp64\www\restoration\core\lib\Drupal\Core\Form\FormBuilder.php(278): Drupal\Core\Form\FormBuilder->retrieveForm('views_exposed_f...', Object(Drupal\Core\Form\FormState))
#6 D:\wamp64\www\restoration\core\modules\views\src\Plugin\views\exposed_form\ExposedFormPluginBase.php(134): Drupal\Core\Form\FormBuilder->buildForm('\\Drupal\\views\\F...', Object(Drupal\Core\Form\FormState))
#7 D:\wamp64\www\restoration\core\modules\views\src\ViewExecutable.php(1238): Drupal\views\Plugin\views\exposed_form\ExposedFormPluginBase->renderExposedForm()
#8 D:\wamp64\www\restoration\core\modules\views\src\ViewExecutable.php(1391): Drupal\views\ViewExecutable->build(NULL)
#9 D:\wamp64\www\restoration\core\modules\views\src\ViewExecutable.php(1454): Drupal\views\ViewExecutable->execute(NULL)
#10 D:\wamp64\www\restoration\core\modules\views\src\Plugin\views\display\DisplayPluginBase.php(2460): Drupal\views\ViewExecutable->render()
#11 D:\wamp64\www\restoration\core\modules\views\src\ViewExecutable.php(1662): Drupal\views\Plugin\views\display\DisplayPluginBase->preview()
#12 D:\wamp64\www\restoration\core\modules\views_ui\src\ViewUI.php(602): Drupal\views\ViewExecutable->preview('page_1', Array)
#13 D:\wamp64\www\restoration\core\modules\views_ui\src\ViewPreviewForm.php(62): Drupal\views_ui\ViewUI->renderPreview('page_1', Array)
#14 D:\wamp64\www\restoration\core\lib\Drupal\Core\Entity\EntityForm.php(106): Drupal\views_ui\ViewPreviewForm->form(Array, Object(Drupal\Core\Form\FormState))
#15 D:\wamp64\www\restoration\core\modules\views_ui\src\ViewFormBase.php(41): Drupal\Core\Entity\EntityForm->buildForm(Array, Object(Drupal\Core\Form\FormState))
#16 [internal function]: Drupal\views_ui\ViewFormBase->buildForm(Array, Object(Drupal\Core\Form\FormState), 'page_1')
#17 D:\wamp64\www\restoration\core\lib\Drupal\Core\Form\FormBuilder.php(531): call_user_func_array(Array, Array)
#18 D:\wamp64\www\restoration\core\lib\Drupal\Core\Form\FormBuilder.php(370): Drupal\Core\Form\FormBuilder->retrieveForm('view_preview_fo...', Object(Drupal\Core\Form\FormState))
#19 D:\wamp64\www\restoration\core\lib\Drupal\Core\Form\FormBuilder.php(628): Drupal\Core\Form\FormBuilder->rebuildForm('view_preview_fo...', Object(Drupal\Core\Form\FormState), Array)
#20 D:\wamp64\www\restoration\core\lib\Drupal\Core\Form\FormBuilder.php(320): Drupal\Core\Form\FormBuilder->processForm('view_preview_fo...', Array, Object(Drupal\Core\Form\FormState))
#21 D:\wamp64\www\restoration\core\lib\Drupal\Core\Controller\FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\views_ui\ViewPreviewForm), Object(Drupal\Core\Form\FormState))
#22 D:\wamp64\www\restoration\core\modules\layout_builder\src\Controller\LayoutBuilderHtmlEntityFormController.php(39): Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#23 [internal function]: Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#24 D:\wamp64\www\restoration\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#25 D:\wamp64\www\restoration\core\lib\Drupal\Core\Render\Renderer.php(564): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#26 D:\wamp64\www\restoration\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#27 D:\wamp64\www\restoration\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#28 D:\wamp64\www\restoration\vendor\symfony\http-kernel\HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#29 D:\wamp64\www\restoration\vendor\symfony\http-kernel\HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#30 D:\wamp64\www\restoration\core\lib\Drupal\Core\StackMiddleware\Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 D:\wamp64\www\restoration\core\lib\Drupal\Core\StackMiddleware\KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 D:\wamp64\www\restoration\core\modules\page_cache\src\StackMiddleware\PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#33 D:\wamp64\www\restoration\core\modules\page_cache\src\StackMiddleware\PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#34 D:\wamp64\www\restoration\core\lib\Drupal\Core\StackMiddleware\ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#35 D:\wamp64\www\restoration\core\lib\Drupal\Core\StackMiddleware\NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#36 D:\wamp64\www\restoration\vendor\stack\builder\src\Stack\StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#37 D:\wamp64\www\restoration\core\lib\Drupal\Core\DrupalKernel.php(709): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#38 D:\wamp64\www\restoration\index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#39 {main}

.

๐Ÿ› Bug report
Status

Postponed

Version

7.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia himangshu.dutta19

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rahul1707

    Created patch to resolve above issue. Kindly verify.

  • Status changed to Needs review 10 months ago
  • Status changed to RTBC 10 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia avinash_patil

    Patch #2 is working fine for me. Moving this to RTBC.

  • Status changed to Needs work 8 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Can you please provide steps to reproduce this issue

  • Status changed to Postponed: needs info 7 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave
  • Status changed to Active 7 months ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom rachel_norfolk UK

    Okay, Iโ€™m seeing this behaviour.

    I have a view of media entities that have a taxonomy link on them. I want to use BEF to display the normally working dropdown list of items as a set of radio buttons to select. I see a javascript error when previewing the view in views_ui and a blog error of Error: Object of class Drupal\cshs\Component\CshsOption could not be converted to string in Drupal\better_exposed_filters\BetterExposedFiltersHelper::flattenOptions() (line 131 of /var/www

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom rachel_norfolk UK

    Ah - I notice that the site is making use of the Client Side Hierarchical Select module, drupal/cshs. I also note that the module fills the $choice variable with a Drupal\cshs\Component\CshsOption object that does have a โ€œlabelโ€ property but that it is protected so this module cannot read it. It does not have a toString method as a last resort way to get some content.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rahul1707

    Re-rolling patch #2 to work with 7.x version.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Anyone test the related issue to see if that solves it?

    This issue will need a summary update: missing exact steps and proposed solutions.

  • Status changed to Postponed 3 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    This seems like a CSHS issue so focus should probably go there.

Production build 0.71.5 2024