Upgrading to 8.x-1.0-beta6 caused the following issue (downgrading to beta5 fixed this issue).

Basically, when I would do a search, it would run the search and come up with results (and seemed to be the correct number of results), but all the results would be empty li tags. There would be no actual content in the search results, just the "1. 2. 3. 4. ...." I tried uninstalling and reinstalling Custom Search, the only thing that fixed the issue was downgrading to beta5.

I also got the following notice in my log (20+ pages of this notice). "event_category" is a taxonomy vocabulary. I have other vocabularies as well which d not seem to cause any issues, however.

Notice: Undefined index: event_category in Drupal\custom_search\Form\CustomSearchBlockForm->buildForm() (line 220 of /path/to/files/public_html/modules/custom_search/src/Form/CustomSearchBlockForm.php) #0 /path/to/files/public_html/core/includes/bootstrap.inc(552): _drupal_error_handler_real(8, 'Undefined index...', '/path/to/files/p...', 220, Array) #1 /path/to/files/public_html/modules/custom_search/src/Form/CustomSearchBlockForm.php(220): _drupal_error_handler(8, 'Undefined index...', '/path/to/files/p...', 220, Array) #2 [internal function]: Drupal\custom_search\Form\CustomSearchBlockForm->buildForm(Array, Object(Drupal\Core\Form\FormState), Array) #3 /path/to/files/public_html/core/lib/Drupal/Core/Form/FormBuilder.php(514): call_user_func_array(Array, Array) #4 /path/to/files/public_html/core/lib/Drupal/Core/Form/FormBuilder.php(271): Drupal\Core\Form\FormBuilder->retrieveForm('custom_search_b...', Object(Drupal\Core\Form\FormState)) #5 /path/to/files/public_html/core/lib/Drupal/Core/Form/FormBuilder.php(212): Drupal\Core\Form\FormBuilder->buildForm('Drupal\\custom_s...', Object(Drupal\Core\Form\FormState)) #6 /path/to/files/public_html/modules/custom_search/src/Plugin/Block/CustomSearchBlock.php(996): Drupal\Core\Form\FormBuilder->getForm('Drupal\\custom_s...', Array) #7 /path/to/files/public_html/core/modules/block/src/BlockViewBuilder.php(203): Drupal\custom_search\Plugin\Block\CustomSearchBlock->build() #8 [internal function]: Drupal\block\BlockViewBuilder::preRender(Array) #9 /path/to/files/public_html/core/lib/Drupal/Core/Render/Renderer.php(376): call_user_func('Drupal\\block\\Bl...', Array) #10 /path/to/files/public_html/core/lib/Drupal/Core/Render/Renderer.php(448): Drupal\Core\Render\Renderer->doRender(Array) #11 /path/to/files/public_html/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, false) #12 /path/to/files/public_html/core/lib/Drupal/Core/Template/TwigExtension.php(490): Drupal\Core\Render\Renderer->render(Array) #13 /path/to/files/public_html/sites/default/files/php/twig/590cdfab8e552_page.html.twig_Vs7ItMM-0MskSmI1FduVxDjvr/-IfinQZUsGE1YRp8Q52pCpmN2wgykSIe9909kNLvkVM.php(302): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true) #14 /path/to/files/public_html/vendor/twig/twig/lib/Twig/Template.php(379): __TwigTemplate_d7626bcf2c6032eef0952067329378f33724d327116cb725b55dd5d718d630bb->doDisplay(Array, Array) #15 /path/to/files/public_html/vendor/twig/twig/lib/Twig/Template.php(347): Twig_Template->displayWithErrorHandling(Array, Array) #16 /path/to/files/public_html/vendor/twig/twig/lib/Twig/Template.php(358): Twig_Template->display(Array) #17 /path/to/files/public_html/core/themes/engines/twig/twig.engine(64): Twig_Template->render(Array) #18 /path/to/files/public_html/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template('themes/miamicha...', Array) #19 /path/to/files/public_html/core/lib/Drupal/Core/Render/Renderer.php(435): Drupal\Core\Theme\ThemeManager->render('page', Array) #20 /path/to/files/public_html/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, false) #21 /path/to/files/public_html/core/lib/Drupal/Core/Template/TwigExtension.php(490): Drupal\Core\Render\Renderer->render(Array) #22 /path/to/files/public_html/sites/default/files/php/twig/590cdfab8e552_html.html.twig_kywmIsA3xyQl7OhNikMd9CjDK/yGaFWQsikeWbwgFCzAiyV4uOeyRnUAfVlSti9hyzVHw.php(169): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true) #23 /path/to/files/public_html/vendor/twig/twig/lib/Twig/Template.php(379): __TwigTemplate_8e91ef8d872d75a4373b7da4154187768538c2527e2fbf3020966a56a1ac9e13->doDisplay(Array, Array) #24 /path/to/files/public_html/vendor/twig/twig/lib/Twig/Template.php(347): Twig_Template->displayWithErrorHandling(Array, Array) #25 /path/to/files/public_html/vendor/twig/twig/lib/Twig/Template.php(358): Twig_Template->display(Array) #26 /path/to/files/public_html/core/themes/engines/twig/twig.engine(64): Twig_Template->render(Array) #27 /path/to/files/public_html/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template('themes/miamicha...', Array) #28 /path/to/files/public_html/core/lib/Drupal/Core/Render/Renderer.php(435): Drupal\Core\Theme\ThemeManager->render('html', Array) #29 /path/to/files/public_html/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, false) #30 /path/to/files/public_html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(147): Drupal\Core\Render\Renderer->render(Array) #31 /path/to/files/public_html/core/lib/Drupal/Core/Render/Renderer.php(574): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() #32 /path/to/files/public_html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(148): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #33 /path/to/files/public_html/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch)) #34 /path/to/files/public_html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher)) #35 /path/to/files/public_html/vendor/symfony/http-kernel/HttpKernel.php(149): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent)) #36 /path/to/files/public_html/vendor/symfony/http-kernel/HttpKernel.php(64): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #37 /path/to/files/public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #38 /path/to/files/public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #39 /path/to/files/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #40 /path/to/files/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #41 /path/to/files/public_html/core/modules/ban/src/BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #42 /path/to/files/public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #43 /path/to/files/public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #44 /path/to/files/public_html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #45 /path/to/files/public_html/core/lib/Drupal/Core/DrupalKernel.php(656): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #46 /path/to/files/public_html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #47 {main}.

Comments

PhoenixAvenger created an issue. See original summary.

PhoenixAvenger’s picture

Issue summary: View changes
brynj’s picture

I'm getting the same issue as the PhoenixAvenger - at least in that the search results are outputting nothing but empty li.

jwineichen’s picture

I don't know if this is related, but I was also getting undefined index errors for taxonomies, but only for taxonomies that I added after creating the custom search block. I fixed my issue by going back and editing the fields for those new taxonomies in the block's settings.

The block requires an entry in the "-Any- text" field for each taxonomy. But, if you add a taxonomy after creating the block, it doesn't put in a default value. This causes the error because that required field is empty, even if the taxonomy is disabled, for some reason. After adding in text to those fields, my errors went away.

KrypticBit’s picture

Nothing really to add except that I had the same issue and downgrading to beta 5 fixed it for me as well.

Stephen Ollman’s picture

+1 #5

mjchadwick’s picture

Thank you for #4. Fixed this for me.

Seems like that "-Any- text" field should really just have a default value to avoid this.

Stephen Ollman’s picture

#4 didn't fix the issue for me.

@mjchadwick what value did you use for the taxonomy '- Any -' text fields?

paulmckibben’s picture

#4 fixed the issue for me. Thanks @jwineichen.

Oops, no it didn't fix it after all. It eliminated the error message on the block configuration page, but I was still seeing the error wherever the custom search form block appeared.

paulmckibben’s picture

Status: Active » Fixed

It looks like @Mario Steinitz already fixed this in commit 88520d6, from 31 Aug 2017. It's in the current 8.x-1.x-dev version.

When I installed the latest dev version, it fixed the problem for me, so I'm going to take the liberty to mark this issue as fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.