After we upgraded to this module from insert view module, the search functionality (search api and search api solr) is broken with exception error :

TypeError: Argument 1 passed to Drupal\Core\Cache\CacheableMetadata::createFromRenderArray() must be of the type array, null given, called in */web/core/lib/Drupal/Core/Render/Renderer.php on line 358 in Drupal\Core\Cache\CacheableMetadata::createFromRenderArray() (line 149 of core/lib/Drupal/Core/Cache/CacheableMetadata.php).

Unfortunately the errors are not very descriptive, so we don't know exactly where it is broken, so I created the issue here to see if anyone has any idea?

CommentFileSizeAuthor
#2 null_render_array-3180525-2.patch499 bytestheterencechan

Comments

yfma created an issue. See original summary.

theterencechan’s picture

StatusFileSize
new499 bytes

In some cases arguments to the view are not resolved. In this case with search indexing or query results, node id extracted from page url by contextual filter is not available as an argument to the view and hence a null is resulted. Further down the road, the text renderer crashes and throw this error. If we could provide arguments in the tag this could be avoided but there maybe cases unknown, so an empty array would let it fail through.

a.dmitriiev’s picture

Status: Active » Fixed

Also had the same error when using the taxonomy view that renders nodes, that have the view embeded with this module. Thanks. Added to 1.x-dev and 2.0.x-dev versions.

Status: Fixed » Closed (fixed)

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

dadderley’s picture

Thanks for this module.
I was using the insert view module and encountered this error when I ran cron.
Cron choked when trying to index content for search.

I was getting these errors

[notice] Starting execution of search_cron(), execution of redirect_404_cron() took 1.63ms.
[error]  TypeError: Argument 1 passed to Drupal\Core\Cache\CacheableMetadata::createFromRenderArray() must be of the type array, null given, called in /home/customer/www/dev.mysite.ca/public_html/core/lib/Drupal/Core/Render/Renderer.php on line 358 in Drupal\Core\Cache\CacheableMetadata::createFromRenderArray() (line 149 of /home/customer/www/dev.mysite.ca/public_html/core/lib/Drupal/Core/Cache/CacheableMetadata.php) #0 /home/customer/www/dev.mysite.ca/public_html/core/lib/Drupal/Core/Render/Renderer.php(358): Drupal\Core\Cache\CacheableMetadata::createFromRenderArray(NULL)
#1 /home/customer/www/dev.mysite.ca/public_html/core/lib/Drupal/Core/Render/Renderer.php(200): Drupal\Core\Render\Renderer->doRender(Array, true)
#2 /home/customer/www/dev.mysite.ca/public_html/core/lib/Drupal/Core/Render/Renderer.php(156): Drupal\Core\Render\Renderer->render(Array, true)
#3 /home/customer/www/dev.mysite.ca/public_html/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}()
#4 /home/customer/www/dev.mysite.ca/public_html/core/lib/Drupal/Core/Render/Renderer.php(157): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#5 /home/customer/www/dev.mysite.ca/public_html/core/lib/Drupal/Core/Render/Renderer.php(171): Drupal\Core\Render\Renderer->renderPlain(Array)
#6 /home/customer/www/dev.mysite.ca/public_html/core/lib/Drupal/Core/Render/Renderer.php(658): Drupal\Core\Render\Renderer->renderPlaceholder('<drupal-filter-...', Array)
#7 /home/customer/www/dev.mysite.ca/public_html/core/lib/Drupal/Core/Render/Renderer.php(543): Drupal\Core\Render\Renderer->replacePlaceholders(Array)
#8 /home/customer/www/dev.mysite.ca/public_html/core/lib/Drupal/Core/Render/Renderer.php(200): Drupal\Core\Render\Renderer->doRender(Array, true)
#9 /home/customer/www/dev.mysite.ca/public_html/core/lib/Drupal/Core/Render/Renderer.php(156): Drupal\Core\Render\Renderer->render(Array, true)
#10 /home/customer/www/dev.mysite.ca/public_html/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}()
#11 /home/customer/www/dev.mysite.ca/public_html/core/lib/Drupal/Core/Render/Renderer.php(157): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#12 /home/customer/www/dev.mysite.ca/public_html/core/modules/node/src/Plugin/Search/NodeSearch.php(524): Drupal\Core\Render\Renderer->renderPlain(Array)
#13 /home/customer/www/dev.mysite.ca/public_html/core/modules/node/src/Plugin/Search/NodeSearch.php(488): Drupal\node\Plugin\Search\NodeSearch->indexNode(Object(Drupal\node\Entity\Node))
#14 /home/customer/www/dev.mysite.ca/public_html/core/modules/search/search.module(121): Drupal\node\Plugin\Search\NodeSearch->updateIndex()
#15 [internal function]: search_cron()
#16 /home/customer/www/dev.mysite.ca/public_html/core/lib/Drupal/Core/Extension/ModuleHandler.php(392): call_user_func_array('search_cron', Array)
#17 /home/customer/www/dev.mysite.ca/public_html/core/lib/Drupal/Core/Cron.php(250): Drupal\Core\Extension\ModuleHandler->invoke('search', 'cron')
#18 /home/customer/www/dev.mysite.ca/public_html/core/lib/Drupal/Core/Cron.php(136): Drupal\Core\Cron->invokeCronHandlers()
#19 /home/customer/www/dev.mysite.ca/public_html/core/lib/Drupal/Core/ProxyClass/Cron.php(75): Drupal\Core\Cron->run()
#20 /home/customer/www/dev.mysite.ca/public_html/vendor/drush/drush/src/Drupal/Commands/core/DrupalCommands.php(76): Drupal\Core\ProxyClass\Cron->run()
#21 [internal function]: Drush\Drupal\Commands\core\DrupalCommands->cron(Array)
#22 /home/customer/www/dev.mysite.ca/public_html/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
#23 /home/customer/www/dev.mysite.ca/public_html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#24 /home/customer/www/dev.mysite.ca/public_html/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#25 /home/customer/www/dev.mysite.ca/public_html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(311): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#26 /home/customer/www/dev.mysite.ca/public_html/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 /home/customer/www/dev.mysite.ca/public_html/vendor/symfony/console/Application.php(1027): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#28 /home/customer/www/dev.mysite.ca/public_html/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#29 /home/customer/www/dev.mysite.ca/public_html/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#30 /home/customer/www/dev.mysite.ca/public_html/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#31 /home/customer/www/dev.mysite.ca/public_html/vendor/drush/drush/src/Runtime/Runtime.php(48): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#32 /home/customer/www/dev.mysite.ca/public_html/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
#33 /home/customer/www/dev.mysite.ca/public_html/vendor/drush/drush/drush(4): require('/home/customer/...')
#34 {main}.

When searching for solutions I came across this thread.
I uninstalled insert view module and installed Advanced Insert View 2.0.0-alpha1

Cron is happy now.
Thanks again

kristi wachter’s picture

Just seconding dadderly -

I was using the insert view module and encountered this error when re-indexing a Search API index.

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /batch?id=20&op=do_nojs&op=do
StatusText: OK
ResponseText: TypeError: Argument 1 passed to Drupal\Core\Cache\CacheableMetadata::createFromRenderArray() must be of the type array, null given, called in /var/www/sandbox/vhost/web/core/lib/Drupal/Core/Render/Renderer.php on line 349 in Drupal\Core\Cache\CacheableMetadata::createFromRenderArray() (line 149 of /var/www/sandbox/vhost/web/core/lib/Drupal/Core/Cache/CacheableMetadata.php).

Following dadderly's comment, I uninstalled Insert View and installed Advanced Insert View instead, and now my re-indexing is working.

Thanks for this module, and thanks to dadderly for reporting!