Cannot render citation in views

Created on 1 August 2024, 5 months ago

Problem/Motivation

Select the citation in the fields in views, generates an error that doesn't display anything. Dependencies for bibcite are installed.

TypeError: array_filter(): Argument #1 ($array) must be of type array, null given in array_filter() (line 223 of /var/www/html/modules/contrib/bibcite/modules/bibcite_entity/src/Normalizer/ReferenceNormalizerBase.php).

#0 /var/www/html/modules/contrib/bibcite/modules/bibcite_entity/src/Normalizer/ReferenceNormalizerBase.php(223): array_filter()
#1 /var/www/html/modules/contrib/bibcite/modules/bibcite_entity/src/Normalizer/ReferenceNormalizerBase.php(353): Drupal\bibcite_entity\Normalizer\ReferenceNormalizerBase->convertEntityType()
#2 /var/www/html/modules/contrib/bibcite/modules/bibcite_entity/src/Normalizer/CslReferenceNormalizer.php(45): Drupal\bibcite_entity\Normalizer\ReferenceNormalizerBase->normalize()
#3 /var/www/html/vendor/symfony/serializer/Serializer.php(159): Drupal\bibcite_entity\Normalizer\CslReferenceNormalizer->normalize()
#4 /var/www/html/modules/contrib/bibcite/modules/bibcite_entity/src/Plugin/views/field/Citation.php(92): Symfony\Component\Serializer\Serializer->normalize()
#5 /var/www/html/core/modules/views/src/Plugin/views/field/FieldPluginBase.php(1196): Drupal\bibcite_entity\Plugin\views\field\Citation->render()
#6 /var/www/html/core/modules/views/views.theme.inc(238): Drupal\views\Plugin\views\field\FieldPluginBase->advancedRender()
#7 [internal function]: template_preprocess_views_view_field()
#8 /var/www/html/core/lib/Drupal/Core/Theme/ThemeManager.php(261): call_user_func_array()
#9 /var/www/html/core/lib/Drupal/Core/Render/Renderer.php(480): Drupal\Core\Theme\ThemeManager->render()
#10 /var/www/html/core/lib/Drupal/Core/Render/Renderer.php(240): Drupal\Core\Render\Renderer->doRender()
#11 /var/www/html/core/modules/views/src/Plugin/views/field/FieldPluginBase.php(1790): Drupal\Core\Render\Renderer->render()
#12 /var/www/html/core/modules/views/src/Plugin/views/style/StylePluginBase.php(765): Drupal\views\Plugin\views\field\FieldPluginBase->theme()
#13 [internal function]: Drupal\views\Plugin\views\style\StylePluginBase->elementPreRenderRow()
#14 /var/www/html/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(111): call_user_func_array()
#15 /var/www/html/core/lib/Drupal/Core/Render/Renderer.php(859): Drupal\Core\Render\Renderer->doTrustedCallback()
#16 /var/www/html/core/lib/Drupal/Core/Render/Renderer.php(421): Drupal\Core\Render\Renderer->doCallback()
#17 /var/www/html/core/lib/Drupal/Core/Render/Renderer.php(240): Drupal\Core\Render\Renderer->doRender()
#18 /var/www/html/core/lib/Drupal/Core/Render/Renderer.php(165): Drupal\Core\Render\Renderer->render()
#19 /var/www/html/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}()
#20 /var/www/html/core/lib/Drupal/Core/Render/Renderer.php(166): Drupal\Core\Render\Renderer->executeInRenderContext()
#21 /var/www/html/core/modules/views/src/Plugin/views/style/StylePluginBase.php(707): Drupal\Core\Render\Renderer->renderPlain()
#22 /var/www/html/core/modules/views/src/Plugin/views/style/StylePluginBase.php(570): Drupal\views\Plugin\views\style\StylePluginBase->renderFields()
#23 /var/www/html/core/modules/views/src/Plugin/views/style/StylePluginBase.php(461): Drupal\views\Plugin\views\style\StylePluginBase->renderGrouping()
#24 /var/www/html/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(2174): Drupal\views\Plugin\views\style\StylePluginBase->render()
#25 /var/www/html/core/modules/views/src/ViewExecutable.php(1548): Drupal\views\Plugin\views\display\DisplayPluginBase->render()
#26 /var/www/html/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(2464): Drupal\views\ViewExecutable->render()
#27 /var/www/html/core/modules/views/src/ViewExecutable.php(1677): Drupal\views\Plugin\views\display\DisplayPluginBase->preview()
#28 /var/www/html/core/modules/views_ui/src/ViewUI.php(612): Drupal\views\ViewExecutable->preview()
#29 /var/www/html/core/modules/views_ui/src/ViewPreviewForm.php(62): Drupal\views_ui\ViewUI->renderPreview()
#30 /var/www/html/core/lib/Drupal/Core/Entity/EntityForm.php(107): Drupal\views_ui\ViewPreviewForm->form()
#31 /var/www/html/core/modules/views_ui/src/ViewFormBase.php(41): Drupal\Core\Entity\EntityForm->buildForm()
#32 [internal function]: Drupal\views_ui\ViewFormBase->buildForm()
#33 /var/www/html/core/lib/Drupal/Core/Form/FormBuilder.php(536): call_user_func_array()
#34 /var/www/html/core/lib/Drupal/Core/Form/FormBuilder.php(375): Drupal\Core\Form\FormBuilder->retrieveForm()
#35 /var/www/html/core/lib/Drupal/Core/Form/FormBuilder.php(633): Drupal\Core\Form\FormBuilder->rebuildForm()
#36 /var/www/html/core/lib/Drupal/Core/Form/FormBuilder.php(325): Drupal\Core\Form\FormBuilder->processForm()
#37 /var/www/html/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm()
#38 /var/www/html/core/modules/layout_builder/src/Controller/LayoutBuilderHtmlEntityFormController.php(39): Drupal\Core\Controller\FormController->getContentResult()
#39 [internal function]: Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult()
#40 /var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#41 /var/www/html/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#42 /var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#43 /var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#44 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#45 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#46 /var/www/html/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#47 /var/www/html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#48 /var/www/html/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#49 /var/www/html/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
#50 /var/www/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
#51 /var/www/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#52 /var/www/html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#53 /var/www/html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#54 /var/www/html/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#55 /var/www/html/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#56 /var/www/html/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#57 /var/www/html/index.php(19): Drupal\Core\DrupalKernel->handle()
#58 {main}

Steps to reproduce

Drupal 10.2.4, PHP 8.1.29

Create a view for references and select field for citation.

Proposed resolution

Fix error.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024